diff --git a/Editor/Images.meta b/Editor/Images.meta new file mode 100644 index 0000000000000000000000000000000000000000..e91faab6ea0fbedbaba1bfe5063740f6927eb413 --- /dev/null +++ b/Editor/Images.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +<<<<<<< HEAD +guid: 7d34ace7d2e2513479736d20d0c95ad0 +======= +guid: 959ac6161f5900d4aa7903c24bc5a31d +>>>>>>> develop +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Editor/Images/anchor.png b/Editor/Images/anchor.png new file mode 100644 index 0000000000000000000000000000000000000000..bb1804db730faff5a6f0a7523a8729085e8dae34 Binary files /dev/null and b/Editor/Images/anchor.png differ diff --git a/Editor/Images/anchor.png.meta b/Editor/Images/anchor.png.meta new file mode 100644 index 0000000000000000000000000000000000000000..b8da83ad1c9b68b8a96b51093d3f1d54aa6d78dd --- /dev/null +++ b/Editor/Images/anchor.png.meta @@ -0,0 +1,98 @@ +fileFormatVersion: 2 +guid: 000725cae67a4f7448f79fe2a478a50d +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMasterTextureLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: {} + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Editor/Images/cloud.png b/Editor/Images/cloud.png new file mode 100644 index 0000000000000000000000000000000000000000..a00dc22e5e0f7b506d089858b7ed281d3ed6092b Binary files /dev/null and b/Editor/Images/cloud.png differ diff --git a/Editor/Images/cloud.png.meta b/Editor/Images/cloud.png.meta new file mode 100644 index 0000000000000000000000000000000000000000..d55875b36fcabd3b68f507a419bf97935937257b --- /dev/null +++ b/Editor/Images/cloud.png.meta @@ -0,0 +1,98 @@ +fileFormatVersion: 2 +guid: 8338d2b625f22b44095330be071b8e56 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMasterTextureLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: {} + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Editor/Images/link.png b/Editor/Images/link.png new file mode 100644 index 0000000000000000000000000000000000000000..dda8f37b2a455617c9f692431928b0502e31747c Binary files /dev/null and b/Editor/Images/link.png differ diff --git a/Editor/Images/link.png.meta b/Editor/Images/link.png.meta new file mode 100644 index 0000000000000000000000000000000000000000..70c4feda72dbe3c9d316954b91263554356c5505 --- /dev/null +++ b/Editor/Images/link.png.meta @@ -0,0 +1,98 @@ +fileFormatVersion: 2 +guid: fef18a27fe1e4a040b8cfda6b3b5c178 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMasterTextureLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: {} + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Editor/Images/trackable.png b/Editor/Images/trackable.png new file mode 100644 index 0000000000000000000000000000000000000000..f31019b2f9ea607e3bfa127348fa17d80296938d Binary files /dev/null and b/Editor/Images/trackable.png differ diff --git a/Editor/Images/trackable.png.meta b/Editor/Images/trackable.png.meta new file mode 100644 index 0000000000000000000000000000000000000000..fb299339b1756f509d67421574faa81ac5b0fa47 --- /dev/null +++ b/Editor/Images/trackable.png.meta @@ -0,0 +1,98 @@ +fileFormatVersion: 2 +guid: 90d4635c9d0895c42bec0551c4e790ea +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMasterTextureLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: {} + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Editor/Images/warning.png b/Editor/Images/warning.png new file mode 100644 index 0000000000000000000000000000000000000000..a989284db594278ae478f2e8cb1b8cafa036a229 Binary files /dev/null and b/Editor/Images/warning.png differ diff --git a/Editor/Images/warning.png.meta b/Editor/Images/warning.png.meta new file mode 100644 index 0000000000000000000000000000000000000000..d01302454a5d82fa883c4da0d0112d955b8d3474 --- /dev/null +++ b/Editor/Images/warning.png.meta @@ -0,0 +1,98 @@ +fileFormatVersion: 2 +guid: 2add88abf0fc00043bfb7863d59d3aa8 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMasterTextureLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: {} + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Editor/Materials.meta b/Editor/Materials.meta new file mode 100644 index 0000000000000000000000000000000000000000..295c47c929c8dc3ea770472f01ea473f4ab0e179 --- /dev/null +++ b/Editor/Materials.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ca243b843ce3c4940846e94005f2208a +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Editor/Materials/anchor.mat b/Editor/Materials/anchor.mat new file mode 100644 index 0000000000000000000000000000000000000000..b0f2689b38220eef7be617bf450462f746e2d013 --- /dev/null +++ b/Editor/Materials/anchor.mat @@ -0,0 +1,80 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: anchor + m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_ValidKeywords: [] + m_InvalidKeywords: [] + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: 000725cae67a4f7448f79fe2a478a50d, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Ints: [] + m_Floats: + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _GlossMapScale: 1 + - _Glossiness: 0.5 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 1 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} + m_BuildTextureStacks: [] diff --git a/Editor/Materials/anchor.mat.meta b/Editor/Materials/anchor.mat.meta new file mode 100644 index 0000000000000000000000000000000000000000..477ef1d43c74c370c6e47cf0afb480d6a466e57c --- /dev/null +++ b/Editor/Materials/anchor.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 730ea8fe50af5874fb3b990c534eaebc +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Editor/Materials/blue.mat b/Editor/Materials/blue.mat new file mode 100644 index 0000000000000000000000000000000000000000..55a4310238708195b07cc2119ff68f9cb7aee670 --- /dev/null +++ b/Editor/Materials/blue.mat @@ -0,0 +1,80 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: blue + m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_ValidKeywords: [] + m_InvalidKeywords: [] + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Ints: [] + m_Floats: + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _GlossMapScale: 1 + - _Glossiness: 0.5 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 1 + m_Colors: + - _Color: {r: 0, g: 0, b: 1, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} + m_BuildTextureStacks: [] diff --git a/Editor/Materials/blue.mat.meta b/Editor/Materials/blue.mat.meta new file mode 100644 index 0000000000000000000000000000000000000000..550aadad7709784990b9bf5a24d84f7d05d32cdd --- /dev/null +++ b/Editor/Materials/blue.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 1b6b868784cd25c46a90fe7b882fddb2 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Editor/Materials/green.mat b/Editor/Materials/green.mat new file mode 100644 index 0000000000000000000000000000000000000000..62e69539f44cfd71aca9b2eea32305c742eecf51 --- /dev/null +++ b/Editor/Materials/green.mat @@ -0,0 +1,80 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: green + m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_ValidKeywords: [] + m_InvalidKeywords: [] + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Ints: [] + m_Floats: + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _GlossMapScale: 1 + - _Glossiness: 0.5 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 1 + m_Colors: + - _Color: {r: 0, g: 1, b: 0, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} + m_BuildTextureStacks: [] diff --git a/Editor/Materials/green.mat.meta b/Editor/Materials/green.mat.meta new file mode 100644 index 0000000000000000000000000000000000000000..67bcad20aa45b4d5e80b478d09595ee98a1aef74 --- /dev/null +++ b/Editor/Materials/green.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 19de5bd9483daf448a5fab21d3eecba3 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Editor/Materials/link.mat b/Editor/Materials/link.mat new file mode 100644 index 0000000000000000000000000000000000000000..3e36be1d3bcc9bd667266f80d5eaeb8cd979edd0 --- /dev/null +++ b/Editor/Materials/link.mat @@ -0,0 +1,80 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: link + m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_ValidKeywords: [] + m_InvalidKeywords: [] + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 5, y: 5} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: fef18a27fe1e4a040b8cfda6b3b5c178, type: 3} + m_Scale: {x: 5, y: 5} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Ints: [] + m_Floats: + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _GlossMapScale: 1 + - _Glossiness: 0.5 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 1 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} + m_BuildTextureStacks: [] diff --git a/Editor/Materials/link.mat.meta b/Editor/Materials/link.mat.meta new file mode 100644 index 0000000000000000000000000000000000000000..b668a5a22ee75c7fa1be9daff2c495038b73f1ec --- /dev/null +++ b/Editor/Materials/link.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ce02d83032448a945ac827316ba8bb87 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Editor/Materials/red.mat b/Editor/Materials/red.mat new file mode 100644 index 0000000000000000000000000000000000000000..cdde4c4a57f5becd1430701cf361d08b56ede0df --- /dev/null +++ b/Editor/Materials/red.mat @@ -0,0 +1,80 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: red + m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_ValidKeywords: [] + m_InvalidKeywords: [] + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Ints: [] + m_Floats: + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _GlossMapScale: 1 + - _Glossiness: 0.5 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 1 + m_Colors: + - _Color: {r: 1, g: 0, b: 0, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} + m_BuildTextureStacks: [] diff --git a/Editor/Materials/red.mat.meta b/Editor/Materials/red.mat.meta new file mode 100644 index 0000000000000000000000000000000000000000..2f910fe7529404b66bd809608dab598658034394 --- /dev/null +++ b/Editor/Materials/red.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 0c6a9f85031693343a9e37c4a08627e9 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Editor/Materials/trackable.mat b/Editor/Materials/trackable.mat new file mode 100644 index 0000000000000000000000000000000000000000..1b5d4607ffec78ec72806ffd466d702e2b44f943 --- /dev/null +++ b/Editor/Materials/trackable.mat @@ -0,0 +1,80 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: trackable + m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_ValidKeywords: [] + m_InvalidKeywords: [] + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: 90d4635c9d0895c42bec0551c4e790ea, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Ints: [] + m_Floats: + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _GlossMapScale: 1 + - _Glossiness: 0.5 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 1 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} + m_BuildTextureStacks: [] diff --git a/Editor/Materials/trackable.mat.meta b/Editor/Materials/trackable.mat.meta new file mode 100644 index 0000000000000000000000000000000000000000..fe1a18aae47ffa3114e23e5adae56d349174b11b --- /dev/null +++ b/Editor/Materials/trackable.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 4f607925b7a7fcc44806b35f5aa087a4 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Editor/Scripts/Graph.meta b/Editor/Scripts/Graph.meta new file mode 100644 index 0000000000000000000000000000000000000000..4a78fd53b5e2354ed1159de1379e3445b641c58a --- /dev/null +++ b/Editor/Scripts/Graph.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 452c5e5fd6387ad4984356aa2f11d245 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Editor/Scripts/Graph/ARFEdgeLink.cs b/Editor/Scripts/Graph/ARFEdgeLink.cs new file mode 100644 index 0000000000000000000000000000000000000000..d1df58fa116de58cbe0dccbbc610a98e3225421b --- /dev/null +++ b/Editor/Scripts/Graph/ARFEdgeLink.cs @@ -0,0 +1,84 @@ +// +// ARF - Augmented Reality Framework (ETSI ISG ARF) +// +// Copyright 2024 ETSI +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Last change: July 2022 +// + +using UnityEditor; +using UnityEditor.Experimental.GraphView; +using UnityEngine; +using UnityEngine.UIElements; + +using ETSI.ARF.WorldStorage.Editor.Windows; +using ETSI.ARF.OpenAPI.WorldStorage; + +namespace ETSI.ARF.WorldStorage.Editor.Graph +{ + public class ARFEdgeLink : Edge + { + public WorldLink worldLink; + public string GUID; + + public Image savedIcon; + + public ARFEdgeLink() + { + var doubleClickManipulator = new Clickable(Clicked); + doubleClickManipulator.activators.Clear(); + doubleClickManipulator.activators.Add(new ManipulatorActivationFilter { button = MouseButton.LeftMouse, clickCount = 2 }); + this.AddManipulator(doubleClickManipulator); + } + public void Clicked() + { + Debug.Log(worldLink.ToJson()); + GraphEditorWindow.ShowWindow(this); + } + public void MarkUnsaved() + { + if (savedIcon == null) + { + //the icon to add if the node does not correspond to an element in the server + Texture2D warningImage = (Texture2D)AssetDatabase.LoadAssetAtPath("Packages/etsi.isg.arf.worldstorage/Editor/Images/cloud.png", typeof(Texture2D)); + savedIcon = new Image + { + image = warningImage + }; + savedIcon.style.width = 18; + savedIcon.style.height = 18; + savedIcon.style.minWidth = 18; + savedIcon.style.minHeight = 18; + savedIcon.style.flexGrow = 1; + savedIcon.style.alignSelf = Align.Center; + + } + if (!edgeControl.Contains(savedIcon)) + { + edgeControl.Add(savedIcon); + } + tooltip = "This element is not synchronized with the World Storage"; + } + + public void MarkSaved() + { + if (edgeControl.Contains(savedIcon)) + { + edgeControl.Remove(savedIcon); + tooltip = ""; + } + } + } +} \ No newline at end of file diff --git a/Editor/Scripts/Graph/ARFEdgeLink.cs.meta b/Editor/Scripts/Graph/ARFEdgeLink.cs.meta new file mode 100644 index 0000000000000000000000000000000000000000..723d9ee5a57433d64e93157394dddc87a891f90e --- /dev/null +++ b/Editor/Scripts/Graph/ARFEdgeLink.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 81a94cf483be20040aa4fe8d9f93d5c5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Editor/Scripts/Graph/ARFGraphView.cs b/Editor/Scripts/Graph/ARFGraphView.cs new file mode 100644 index 0000000000000000000000000000000000000000..7053c84a38e9bc4d882ea05f630836f2277dda8d --- /dev/null +++ b/Editor/Scripts/Graph/ARFGraphView.cs @@ -0,0 +1,681 @@ +// +// ARF - Augmented Reality Framework (ETSI ISG ARF) +// +// Copyright 2024 ETSI +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Last change: June 2024 +// + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; + +using UnityEngine; +using UnityEngine.UIElements; +using UnityEditor.Experimental.GraphView; +using UnityEditor; + +using ETSI.ARF.WorldStorage.Editor.Graph; +using ETSI.ARF.WorldStorage.Editor.Windows; + +using ETSI.ARF.WorldStorage.REST; +using ETSI.ARF.OpenAPI.WorldStorage; + +namespace ETSI.ARF.WorldStorage.UI +{ + public class ARFGraphView : GraphView + { + public WorldStorageServer worldStorageServer; + public WorldStorageUser worldStorageUser; + + public ARFGraphView() + { + SetupZoom(ContentZoomer.DefaultMinScale, ContentZoomer.DefaultMaxScale); + + //deleSection + deleteSelection += DeleteFunc; + + + this.AddManipulator(new ContentDragger()); + this.AddManipulator(new SelectionDragger()); + this.AddManipulator(new RectangleSelector()); + + } + + //method called when an element is deleted from the graphview + public void DeleteFunc(string operationName, AskUser askUser) + { + //build the message to list all the deleted elements + String message = "Are you sure you want to delete "; + if (selection.Count > 1) + { + message += selection.Count + " elements ?"; + } + else + { + message += "this element ?"; + } + + //remove from the graph all the deleted elements + if (EditorUtility.DisplayDialog("Deleting elements", message, "Yes", "No")) + { + if (SaveInfo.instance.elemsToRemove == null) + { + SaveInfo.instance.elemsToRemove = new Dictionary(); + } + foreach (GraphElement elt in selection.ToArray()) + { + ARFNodeWorldAnchor nodeAnchor = elt as ARFNodeWorldAnchor; + if (nodeAnchor != null) + { + nodeAnchor.DisconnectAllPorts(this); + if (SaveInfo.instance.nodePositions.ContainsKey(nodeAnchor.GUID)) + { + SaveInfo.instance.elemsToRemove.Add(nodeAnchor.GUID, typeof(WorldAnchor)); + } + RemoveElement(elt); + continue; + } + ARFNodeTrackable nodeTrackable = elt as ARFNodeTrackable; + if (nodeTrackable != null) + { + nodeTrackable.DisconnectAllPorts(this); + if (SaveInfo.instance.nodePositions.ContainsKey(nodeTrackable.GUID)) + { + SaveInfo.instance.elemsToRemove.Add(nodeTrackable.GUID, typeof(Trackable)); + } + RemoveElement(elt); + continue; + } + ARFEdgeLink edgeLink = elt as ARFEdgeLink; + if (edgeLink != null) + { + edgeLink.input.Disconnect(edgeLink); + edgeLink.output.Disconnect(edgeLink); + if (SaveInfo.instance.linkIds.Contains(edgeLink.GUID)) + { + SaveInfo.instance.elemsToRemove.Add(edgeLink.GUID, typeof(WorldLink)); + } + RemoveElement(elt); + continue; + } + } + } + + GraphEditorWindow.ResetWindow(); + } + + public override void BuildContextualMenu(UnityEngine.UIElements.ContextualMenuPopulateEvent evt) + { + Vector2 localMousePos = evt.localMousePosition; + Vector2 actualGraphPosition = viewTransform.matrix.inverse.MultiplyPoint(localMousePos); + + if (!(evt.target is ARFNode || evt.target is Group || evt.target is ARFEdgeLink)) + { + evt.menu.AppendSeparator(); + evt.menu.AppendAction("Save graph", delegate + { + if (ServerAndLocalDifferent()) + { + SaveInServer(); + } + }, (DropdownMenuAction a) => DropdownMenuAction.Status.Normal); + evt.menu.AppendAction("Reload graph", delegate + { + if (ServerAndLocalDifferent() && EditorUtility.DisplayDialog("Saving node positions", "The World Graph has been modified. \nWould you like to push the modifications to the server ?", "Yes", "No")) + { + SaveInServer(); + } + Reload(); + SaveInfo.instance.toReFrame = true; + }, (DropdownMenuAction a) => DropdownMenuAction.Status.Normal); + evt.menu.AppendAction("Create Trackable", delegate + { + //generate the Trackables's attributes + EncodingInformationStructure trackableEncodingInformation = new EncodingInformationStructure() + { + DataFormat = EncodingInformationStructureDataFormat.OTHER, + Version = "0" + }; + + Transform3D localCRS = new Transform3D(); + for (int i = 0; i < 15; i++) + { + localCRS.Add(0); + } + localCRS.Add(1); + + Size trackableSize = new Size(); + for (int i = 0; i < 3; i++) + { + trackableSize.Add(0); + } + + string name = "DefaultTrackable"; + + //trying to add number after default name + var defaultNodes = nodes.ToList().Where(node => node.title.StartsWith("DefaultTrackable")); + if (defaultNodes.Any()) + { + for (int i = 0; i < defaultNodes.Count(); i++) + { + Debug.Log($"{i} : " + defaultNodes.ElementAt(i).title); + if (!(defaultNodes.Where(node => node.title.EndsWith((i + 1).ToString() + ")")).Any())) + { + name = name + " (" + (i + 1).ToString() + ")"; + break; + } + } + } + + Trackable trackable = new Trackable(name) + { + UUID = Guid.NewGuid(), + CreatorUUID = Guid.Parse(worldStorageUser.UUID), + TrackableType = TrackableType.OTHER, + TrackableEncodingInformation = trackableEncodingInformation, + TrackablePayload = new byte[64], + LocalCRS = localCRS, + Unit = UnitSystem.CM, + TrackableSize = trackableSize + }; + + selection.Clear(); + var node = CreateTrackableNode(trackable, actualGraphPosition.x, actualGraphPosition.y); + node.MarkUnsaved(); + GraphEditorWindow.ShowWindow((ARFNodeTrackable)node); + + }, (DropdownMenuAction a) => DropdownMenuAction.Status.Normal); + evt.menu.AppendAction("Create World Anchor", delegate + { + //generate the worldAnchor attributes + Transform3D localCRS = new Transform3D(); + for (int i = 0; i < 15; i++) + { + localCRS.Add(0); + } + localCRS.Add(1); + + Size worldAnchorSize = new Size(); + for (int i = 0; i < 3; i++) + { + worldAnchorSize.Add(0); + } + + string name = "DefaultWorldAnchor"; + + //trying to add number after default name + var defaultNodes = nodes.ToList().Where(node => node.title.StartsWith("DefaultWorldAnchor")); + if (defaultNodes.Any()) + { + for (int i = 0; i < defaultNodes.Count(); i++) + { + if (!(defaultNodes.Where(node => node.title.EndsWith((i + 1).ToString() + ")")).Any())) + { + name = name + " (" + (i + 1).ToString() + ")"; + break; + } + } + } + + WorldAnchor anchor = new WorldAnchor(name) + { + UUID = Guid.NewGuid(), + CreatorUUID = Guid.Parse(worldStorageUser.UUID), + LocalCRS = localCRS, + Unit = UnitSystem.CM, + WorldAnchorSize = worldAnchorSize + }; + + selection.Clear(); + var node = CreateAnchorNode(anchor, actualGraphPosition.x, actualGraphPosition.y); + node.MarkUnsaved(); + GraphEditorWindow.ShowWindow((ARFNodeWorldAnchor)node); + + }, (DropdownMenuAction a) => DropdownMenuAction.Status.Normal); + } + evt.menu.AppendSeparator(); + if (evt.target is ARFNode || evt.target is Group || evt.target is ARFEdgeLink) + { + evt.menu.AppendSeparator(); + evt.menu.AppendAction("Delete", delegate + { + DeleteSelectionCallback(AskUser.AskUser); + }, (DropdownMenuAction a) => canDeleteSelection ? DropdownMenuAction.Status.Normal : DropdownMenuAction.Status.Disabled); + evt.menu.AppendSeparator(); + } + } + + public bool ServerAndLocalDifferent() + { + if ((SaveInfo.instance.elemsToRemove.Count != 0) || (SaveInfo.instance.elemsToUpdate.Count != 0)) + { + return true; + } + foreach (ARFNode node in nodes) + { + float nodeX = node.GetPosition().x; + float nodeY = node.GetPosition().y; + if (!SaveInfo.instance.nodePositions.ContainsKey(node.GUID)) + { + return true; + } + else + { + float dataX = SaveInfo.instance.nodePositions[node.GUID].x; + float dataY = SaveInfo.instance.nodePositions[node.GUID].y; + if ((nodeX != dataX) || (nodeY != dataY)) + { + return true; + } + } + } + foreach (ARFEdgeLink edge in edges) + { + if (!SaveInfo.instance.linkIds.Contains(edge.GUID)) + { + return true; + } + } + return false; + } + + public override List GetCompatiblePorts(Port startPort, NodeAdapter nodeAdapter) + { + var cPorts = new List(); + ports.ForEach(funcCall: port => + { + if (startPort != port && startPort.node != port.node) cPorts.Add(port); + }); + return cPorts; + } + + public void PaintWorldStorage() + { + + List worldAnchors = WorldAnchorRequest.GetWorldAnchorsSync(worldStorageServer); + foreach (WorldAnchor worldAnchor in worldAnchors) + { + var waNode = new ARFNodeWorldAnchor(worldAnchor); + + Rect posTemp = new(26, 93, 160, 77); + SaveInfo.instance.nodePositions.TryGetValue(worldAnchor.UUID.ToString(), out posTemp); + waNode.SetPosition(posTemp); + + AddElement(waNode); + } + + List trackables = TrackableRequest.GetTrackablesSync(worldStorageServer); + foreach (Trackable trackable in trackables) + { + var tracknode = new ARFNodeTrackable(trackable); + + Rect posTemp = new(26, 93, 160, 77); + SaveInfo.instance.nodePositions.TryGetValue(trackable.UUID.ToString(), out posTemp); + tracknode.SetPosition(posTemp); + + AddElement(tracknode); + } + List worldLinks = WorldLinkRequest.GetWorldLinksSync(worldStorageServer); + foreach (WorldLink worldLink in worldLinks) + { + var portPair = GetPortsFromWorldLink(worldLink); + ARFEdgeLink edge = portPair.Key.ConnectTo(portPair.Value); + edge.worldLink = worldLink; + edge.GUID = worldLink.UUID.ToString(); + + AddElement(edge); + } + } + + internal ARFNodeTrackable CreateTrackableNode(Trackable track, float posX, float posY) + { + var tracknode = new ARFNodeTrackable(track); + Rect pos = new Rect(RoundToNearestHalf(posX), RoundToNearestHalf(posY), 160, 77); + tracknode.SetPosition(pos); + + AddElement(tracknode); + return tracknode; + } + + internal ARFNodeWorldAnchor CreateAnchorNode(WorldAnchor wa, float posX, float posY) + { + var waNode = new ARFNodeWorldAnchor(wa); + + Rect pos = new Rect(RoundToNearestHalf(posX), RoundToNearestHalf(posY), 160, 77); + waNode.SetPosition(pos); + + AddElement(waNode); + return waNode; + } + + internal ARFEdgeLink CreateLink(WorldLink worldLink) + { + var portPair = GetPortsFromWorldLink(worldLink); + ARFEdgeLink edge = portPair.Key.ConnectTo(portPair.Value); + edge.worldLink = worldLink; + Debug.Log(worldLink.UUID.ToString()); + edge.GUID = worldLink.UUID.ToString(); + + AddElement(edge); + return edge; + } + + public void Reload() + { + GraphEditorWindow.ResetWindow(); + DeleteElements(graphElements); + SaveInfo.instance.InitNodePos(worldStorageServer, worldStorageUser); + PaintWorldStorage(); + FrameAllElements(); + } + + public Dictionary GetNodePositions() + { + Dictionary ret = new Dictionary(); + foreach (ARFNode elem in nodes) + { + ret.Add(elem.GUID, elem.GetPosition()); + } + return ret; + } + + private KeyValuePair GetPortsFromWorldLink(WorldLink worldLink) + { + var ret = new KeyValuePair(); + + //To + Guid idTo = worldLink.UUIDTo; + Port portIn = null; + switch (worldLink.TypeTo) + { + case TypeWorldStorage.TRACKABLE: + foreach (GraphElement node in this.graphElements) + { + ARFNodeTrackable nodeTrackable = node as ARFNodeTrackable; + if ((nodeTrackable != null) && (nodeTrackable.trackable.UUID == idTo)) + { + portIn = nodeTrackable.portIn; + break; + } + } + break; + case TypeWorldStorage.ANCHOR: + foreach (GraphElement node in this.graphElements) + { + ARFNodeWorldAnchor nodeAnchor = node as ARFNodeWorldAnchor; + if ((nodeAnchor != null) && nodeAnchor.worldAnchor.UUID == idTo) + { + portIn = nodeAnchor.portIn; + break; + } + } + break; + default: + Debug.Log("what are you doing here..."); + break; + } + + //From + Guid idFrom = worldLink.UUIDFrom; + Port portOut = null; + switch (worldLink.TypeFrom) + { + case TypeWorldStorage.TRACKABLE: + foreach (GraphElement node in this.graphElements) + { + ARFNodeTrackable nodeTrackable = node as ARFNodeTrackable; + if ((nodeTrackable != null) && (nodeTrackable.trackable.UUID == idFrom)) + { + portOut = nodeTrackable.portOut; + break; + } + } + break; + case TypeWorldStorage.ANCHOR: + foreach (GraphElement node in this.graphElements) + { + ARFNodeWorldAnchor nodeAnchor = node as ARFNodeWorldAnchor; + if ((nodeAnchor != null) && nodeAnchor.worldAnchor.UUID == idFrom) + { + portOut = nodeAnchor.portOut; + break; + } + } + break; + default: + Debug.Log("what are you doing here..."); + break; + } + + if ((portOut != null) && (portIn != null)) + { + ret = new KeyValuePair(portOut, portIn); + } + + return ret; + } + + // + // R�sum�: + // Calculate the rectangle size and position to fit all elements in graph. + // + // Param�tres�: + // container: + // This should be the view container. + // + // Retourne�: + // The calculated rectangle. + public override Rect CalculateRectToFitAll(VisualElement container) + { + Rect rectToFit = container.layout; + bool reachedFirstChild = false; + graphElements.ForEach(delegate (GraphElement ge) + { + if (!(ge is ARFEdgeLink) && !(ge is Port)) + { + if (!reachedFirstChild) + { + rectToFit = ge.ChangeCoordinatesTo(contentViewContainer, ge.contentRect); + reachedFirstChild = true; + } + else + { + rectToFit = RectUtils.Encompass(rectToFit, ge.ChangeCoordinatesTo(contentViewContainer, ge.contentRect)); + } + } + }); + return rectToFit; + } + + //k_FrameBorder is private readOnly graphView attribute, had to redeclare it to access it + private readonly int k_FrameBorder = 30; + public void FrameAllElements() + { + Vector3 frameTranslation = Vector3.zero; + Vector3 frameScaling = Vector3.one; + var rectToFit = CalculateRectToFitAll(contentViewContainer); + CalculateFrameTransform(rectToFit, layout, k_FrameBorder, out frameTranslation, out frameScaling); + Matrix4x4.TRS(frameTranslation, Quaternion.identity, frameScaling); + UpdateViewTransform(frameTranslation, frameScaling); + } + + //method to predict the position of a node (the float that will be saved in the PositionInfo singleton) + public static float RoundToNearestHalf(float a) + { + return a = Mathf.Round(a * 2f) * 0.5f; + } + + //Save all modified/deleted/added elements to the server + public void SaveInServer() + { + //DELETE ELEMENTS FROM THE SERVER + foreach (KeyValuePair elemToRemove in SaveInfo.instance.elemsToRemove) + { + string typeName = elemToRemove.Value.Name; + switch (typeName) + { + case nameof(Trackable): + TrackableRequest.DeleteTrackableAsync(worldStorageServer, Guid.Parse(elemToRemove.Key), (response) => { }); + break; + case nameof(WorldAnchor): + Debug.Log("delete worldanchor"); + WorldAnchorRequest.DeleteWorldAnchorAsync(worldStorageServer, Guid.Parse(elemToRemove.Key), (response) => { }); + break; + case nameof(WorldLink): + WorldLinkRequest.DeleteWorldLinkAsync(worldStorageServer, Guid.Parse(elemToRemove.Key), (response) => { }); + break; + default: + Debug.Log("oops"); + break; + } + } + + // UPDATE AND ADD ELEMENTS + foreach (ARFNode node in nodes) + { + if (!SaveInfo.instance.nodePositions.ContainsKey(node.GUID)) + { + // POST TRACKABLE + if (node is ARFNodeTrackable aRFNodeTrackable) + { + var posX = new Collection(); + posX.Add(aRFNodeTrackable.GetPosition().x.ToString()); + var posY = new Collection(); + posY.Add(aRFNodeTrackable.GetPosition().y.ToString()); + Trackable trackable = aRFNodeTrackable.trackable; + trackable.KeyvalueTags["unityAuthoringPosX"] = posX; + trackable.KeyvalueTags["unityAuthoringPosY"] = posY; + TrackableRequest.CreateTrackableAsync(worldStorageServer, trackable, (response) => + { + //change the uuid in its edges, if there is a new edge to be added in the world storage it needs to have the correct uuid + String uuid = response.result.Message; + + uuid = uuid.Replace("\"", ""); + foreach (ARFEdgeLink edge in aRFNodeTrackable.portIn.connections) + { + edge.worldLink.UUIDTo = Guid.Parse(uuid); + } + foreach (ARFEdgeLink edge in aRFNodeTrackable.portOut.connections) + { + edge.worldLink.UUIDFrom = Guid.Parse(uuid); + } + aRFNodeTrackable.trackable.UUID = Guid.Parse(uuid); + aRFNodeTrackable.GUID = uuid; + aRFNodeTrackable.title = trackable.Name; + }); + } + + // POST WORLDANCHOR + if (node is ARFNodeWorldAnchor aRFNodeWorldAnchor) + { + var posX = new Collection(); + posX.Add(aRFNodeWorldAnchor.GetPosition().x.ToString()); + var posY = new Collection(); + posY.Add(aRFNodeWorldAnchor.GetPosition().y.ToString()); + WorldAnchor worldAnchor = aRFNodeWorldAnchor.worldAnchor; + worldAnchor.KeyvalueTags["unityAuthoringPosX"] = posX; + worldAnchor.KeyvalueTags["unityAuthoringPosY"] = posY; + + WorldAnchorRequest.CreateWorldAnchorAsync(worldStorageServer, worldAnchor, (response) => + { + String uuid = response.result.Message; + //change the uuid in its edges, if there is a new edge to be added in the world storage it needs to have the correct uuid + uuid = uuid.Replace("\"", ""); + foreach (ARFEdgeLink edge in aRFNodeWorldAnchor.portIn.connections) + { + edge.worldLink.UUIDTo = Guid.Parse(uuid); + } + foreach (ARFEdgeLink edge in aRFNodeWorldAnchor.portOut.connections) + { + edge.worldLink.UUIDFrom = Guid.Parse(uuid); + } + aRFNodeWorldAnchor.worldAnchor.UUID = Guid.Parse(uuid); + aRFNodeWorldAnchor.GUID = uuid; + aRFNodeWorldAnchor.title = worldAnchor.Name; + }); + } + } + else + { + float xLocal = node.GetPosition().x; + float yLocal = node.GetPosition().y; + float xServer = SaveInfo.instance.nodePositions[node.GUID].x; ; + float yServer = SaveInfo.instance.nodePositions[node.GUID].y; + if (((xLocal != xServer) || (yLocal != yServer)) || SaveInfo.instance.elemsToUpdate.Contains(node.GUID)) + { + if (node is ARFNodeTrackable aRFNodeTrackable) + { + var posX = new Collection(); + posX.Add(aRFNodeTrackable.GetPosition().x.ToString()); + var posY = new Collection(); + posY.Add(aRFNodeTrackable.GetPosition().y.ToString()); + Trackable trackable = aRFNodeTrackable.trackable; + trackable.KeyvalueTags["unityAuthoringPosX"] = posX; + trackable.KeyvalueTags["unityAuthoringPosY"] = posY; + TrackableRequest.UpdateTrackableAsync(worldStorageServer, trackable, (response) => + { + aRFNodeTrackable.title = trackable.Name; + }); + } + if (node is ARFNodeWorldAnchor aRFNodeWorldAnchor) + { + var posX = new Collection(); + posX.Add(aRFNodeWorldAnchor.GetPosition().x.ToString()); + var posY = new Collection(); + posY.Add(aRFNodeWorldAnchor.GetPosition().y.ToString()); + WorldAnchor worldAnchor = aRFNodeWorldAnchor.worldAnchor; + worldAnchor.KeyvalueTags["unityAuthoringPosX"] = posX; + worldAnchor.KeyvalueTags["unityAuthoringPosY"] = posY; + WorldAnchorRequest.UpdateWorldAnchorAsync(worldStorageServer, worldAnchor, (response) => + { + aRFNodeWorldAnchor.title = worldAnchor.Name; + }); + } + } + } + node.MarkSaved(); + } + foreach (ARFEdgeLink edge in edges) + { + if (edge is ARFEdgeLink aRFEdgeLink) + { + if (!SaveInfo.instance.linkIds.Contains(aRFEdgeLink.GUID)) + { + WorldLink worldLink = aRFEdgeLink.worldLink; + WorldLinkRequest.CreateWorldLinkAsync(worldStorageServer, worldLink, (response) => + { + string uuid = response.result.Message; + uuid = uuid.Replace("\"", ""); + + aRFEdgeLink.worldLink.UUID = Guid.Parse(uuid); + aRFEdgeLink.GUID = uuid; + }); + } + else if (SaveInfo.instance.elemsToUpdate.Contains(aRFEdgeLink.GUID)) + { + WorldLink worldLink = aRFEdgeLink.worldLink; + WorldLinkRequest.UpdateWorldLinkAsync(worldStorageServer, worldLink, (response) => { }); + } + aRFEdgeLink.MarkSaved(); + } + } + SaveInfo.instance.InitNodePos(worldStorageServer, worldStorageUser); + + GraphEditorWindow.ResetWindow(); + } + } +} \ No newline at end of file diff --git a/Editor/Scripts/Graph/ARFGraphView.cs.meta b/Editor/Scripts/Graph/ARFGraphView.cs.meta new file mode 100644 index 0000000000000000000000000000000000000000..e0b1d231cdd3c54559c58031ebf545ca75692d27 --- /dev/null +++ b/Editor/Scripts/Graph/ARFGraphView.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 000c7511b9bdea24cb6c962ca1ae26ca +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Editor/Scripts/Graph/ARFNode.cs b/Editor/Scripts/Graph/ARFNode.cs new file mode 100644 index 0000000000000000000000000000000000000000..dbda1986e5edaeed13447ee1e607d0322f652e9b --- /dev/null +++ b/Editor/Scripts/Graph/ARFNode.cs @@ -0,0 +1,140 @@ +// +// ARF - Augmented Reality Framework (ETSI ISG ARF) +// +// Copyright 2024 ETSI +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Last change: July 2022 +// + +#define USING_OPENAPI_GENERATOR // alt. is Swagger + +using System; + +using UnityEditor; +using UnityEngine.UIElements; +using UnityEditor.Experimental.GraphView; +using UnityEngine; + +using ETSI.ARF.WorldStorage.Editor.Graph; +using ETSI.ARF.OpenAPI.WorldStorage; + +namespace ETSI.ARF.WorldStorage.UI +{ + public abstract class ARFNode : Node + { + public string GUID; + public bool entryPoint = false; + public ARFPort portOut; + public ARFPort portIn; + public GUID id; + + public Image savedIcon; + + public ARFNode() + { + } + public override Port InstantiatePort(Orientation orientation, Direction direction, Port.Capacity capacity, Type type) + { + switch (direction) + { + case Direction.Input: + portIn = ARFPort.CreateARF(orientation, direction, capacity, type); + return portIn; + case Direction.Output: + portOut = ARFPort.CreateARF(orientation, direction, capacity, type); + return portOut; + default: + return null; + } + } + + public void DisconnectAllPorts(ARFGraphView graphView) + { + DisconnectInputPorts(graphView); + DisconnectOutputPorts(graphView); + } + + private void DisconnectInputPorts(ARFGraphView graphView) + { + DisconnectPorts(inputContainer, graphView); + } + + private void DisconnectOutputPorts(ARFGraphView graphView) + { + DisconnectPorts(outputContainer, graphView); + } + + private void DisconnectPorts(VisualElement container, ARFGraphView graphView) + { + foreach (Port port in container.Children()) + { + if (!port.connected) + { + continue; + } + + graphView.DeleteElements(port.connections); + } + } + + public Port GeneratePort(ARFNode node, Direction portDirection, Port.Capacity capacity = Port.Capacity.Multi) + { + return node.InstantiatePort(Orientation.Horizontal, portDirection, capacity, typeof(int)); // dummy + } + + //override the BuildContextualMenu method to prevent the "disconnect" option from appearing in the contextual menu + public override void BuildContextualMenu(ContextualMenuPopulateEvent evt) + { + } + + public abstract TypeWorldStorage GetElemType(); + public void MarkUnsaved() + { + if(savedIcon == null) + { + //the icon to add if the node does not correspond to an element in the server + Texture2D warningImage = (Texture2D)AssetDatabase.LoadAssetAtPath("Packages/etsi.isg.arf.worldstorage/Editor/Images/cloud.png", typeof(Texture2D)); + savedIcon = new Image + { + image = warningImage, + scaleMode = ScaleMode.ScaleToFit + }; + savedIcon.style.width = 25; + savedIcon.style.height = 25; + savedIcon.style.minWidth = 25; + savedIcon.style.minHeight = 25; + savedIcon.style.left = 8; + savedIcon.style.paddingRight = 8; + savedIcon.style.alignSelf = Align.Center; + + } + if (!titleContainer.Contains(savedIcon)) + { + titleContainer.Insert(0,savedIcon); + } + tooltip = "This element is not synchronized with the World Storage"; + } + + public void MarkSaved() + { + if (titleContainer.Contains(savedIcon)) + { + titleContainer.Remove(savedIcon); + tooltip = ""; + } + } + + } +} \ No newline at end of file diff --git a/Editor/Scripts/Graph/ARFNode.cs.meta b/Editor/Scripts/Graph/ARFNode.cs.meta new file mode 100644 index 0000000000000000000000000000000000000000..97a115b08bf4f22d06121149b104a93e9a6f3433 --- /dev/null +++ b/Editor/Scripts/Graph/ARFNode.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0216cf1af3743f2429eb4b01db300b0e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Editor/Scripts/Graph/ARFNodeTrackable.cs b/Editor/Scripts/Graph/ARFNodeTrackable.cs new file mode 100644 index 0000000000000000000000000000000000000000..08284e71884f1f716551326c5696d73a91fcf203 --- /dev/null +++ b/Editor/Scripts/Graph/ARFNodeTrackable.cs @@ -0,0 +1,85 @@ +// +// ARF - Augmented Reality Framework (ETSI ISG ARF) +// +// Copyright 2024 ETSI +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Last change: June 2024 +// + +#define USING_OPENAPI_GENERATOR // alt. is Swagger + +using UnityEngine; +using UnityEngine.UIElements; +using UnityEditor; +using UnityEditor.Experimental.GraphView; + +using ETSI.ARF.WorldStorage.Editor.Windows; +using ETSI.ARF.OpenAPI.WorldStorage; + +namespace ETSI.ARF.WorldStorage.UI +{ + public class ARFNodeTrackable : ARFNode + { + public Trackable trackable; + + public ARFNodeTrackable(Trackable trackable) + { + this.trackable = trackable; + this.GUID = trackable.UUID.ToString(); + this.title = trackable.Name; + + /*COLOR*/ + var colorRectangle = new VisualElement(); + colorRectangle.style.height = 160; + colorRectangle.style.height = 5; + colorRectangle.style.backgroundColor = new Color(1, 0.31f, 0.31f, 0.9f); + //get the index of the title container + int titleIndex = mainContainer.hierarchy.IndexOf(titleContainer); + mainContainer.Insert(titleIndex+1, colorRectangle); + + /*PORTS*/ + var portIn = GeneratePort(this, Direction.Input, Port.Capacity.Multi); + portIn.portColor = new Color(0.66f, 0.39f, 1, 0.77f); + portIn.portName = "Target"; // "Input" + //portIn.AddManipulator(new EdgeConnector(new WorldLinkListener())); + inputContainer.Add(portIn); + + var portOut = GeneratePort(this, Direction.Output, Port.Capacity.Multi); + portOut.portColor = new Color(0.66f, 0.39f, 1, 0.77f); + portOut.portName = "Source"; // "Output"; + //portOut.AddManipulator(new EdgeConnector(new WorldLinkListener())); ; + outputContainer.Add(portOut); + + RefreshExpandedState(); + RefreshPorts(); + + /*MANIPULATOR*/ + var doubleClickManipulator = new Clickable(Clicked); + doubleClickManipulator.activators.Clear(); + doubleClickManipulator.activators.Add(new ManipulatorActivationFilter { button = MouseButton.LeftMouse, clickCount = 2 }); + this.AddManipulator(doubleClickManipulator); + } + + public void Clicked() + { + Debug.Log(trackable.ToJson()); + GraphEditorWindow.ShowWindow(this); + } + public override TypeWorldStorage GetElemType() + { + return TypeWorldStorage.TRACKABLE; + } + } +} \ No newline at end of file diff --git a/Editor/Scripts/Graph/ARFNodeTrackable.cs.meta b/Editor/Scripts/Graph/ARFNodeTrackable.cs.meta new file mode 100644 index 0000000000000000000000000000000000000000..17e98f27c0df67b74d8e87e243203ba56f30d987 --- /dev/null +++ b/Editor/Scripts/Graph/ARFNodeTrackable.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 01bfb1a0a4a788c48a6c6675034ba8d5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Editor/Scripts/Graph/ARFNodeWorldAnchor.cs b/Editor/Scripts/Graph/ARFNodeWorldAnchor.cs new file mode 100644 index 0000000000000000000000000000000000000000..2a3c0030064b0f99e8a17303d2f34cfba9d04c29 --- /dev/null +++ b/Editor/Scripts/Graph/ARFNodeWorldAnchor.cs @@ -0,0 +1,79 @@ +// +// ARF - Augmented Reality Framework (ETSI ISG ARF) +// +// Copyright 2024 ETSI +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Last change: June 2024 +// + +using UnityEngine; +using UnityEngine.UIElements; +using UnityEditor.Experimental.GraphView; + +using ETSI.ARF.WorldStorage.Editor.Windows; +using ETSI.ARF.OpenAPI.WorldStorage; + +namespace ETSI.ARF.WorldStorage.UI +{ + public class ARFNodeWorldAnchor : ARFNode + { + public WorldAnchor worldAnchor; + + public ARFNodeWorldAnchor(WorldAnchor worldAnchor) + { + this.worldAnchor = worldAnchor; + this.GUID = worldAnchor.UUID.ToString(); + this.title = worldAnchor.Name; + + /*COLOR*/ + var colorRectangle = new VisualElement(); + colorRectangle.style.height = 160; + colorRectangle.style.height = 5; + colorRectangle.style.backgroundColor = new Color(1, 0.7f, 0, 0.9f); + mainContainer.Insert(1, colorRectangle); + + /*PORTS*/ + var portIn = GeneratePort(this, Direction.Input, Port.Capacity.Multi); + portIn.portColor = new Color(0.66f, 0.39f, 1, 0.77f); + portIn.portName = "Target"; // "Input"; + //portIn.AddManipulator(new EdgeConnector(new WorldLinkListener())); + inputContainer.Add(portIn); + + var portOut = GeneratePort(this, Direction.Output, Port.Capacity.Multi); + portOut.portColor = new Color(0.66f, 0.39f, 1, 0.77f); + portOut.portName = "Source"; // "Output"; + //portOut.AddManipulator(new EdgeConnector(new WorldLinkListener())); + outputContainer.Add(portOut); + + RefreshExpandedState(); + RefreshPorts(); + + /*MANIPULATOR*/ + var doubleClickManipulator = new Clickable(Clicked); + doubleClickManipulator.activators.Clear(); + doubleClickManipulator.activators.Add(new ManipulatorActivationFilter { button = MouseButton.LeftMouse, clickCount = 2 }); + this.AddManipulator(doubleClickManipulator); + } + + public void Clicked() + { + GraphEditorWindow.ShowWindow(this); + } + public override TypeWorldStorage GetElemType() + { + return TypeWorldStorage.ANCHOR; + } + } +} \ No newline at end of file diff --git a/Editor/Scripts/Graph/ARFNodeWorldAnchor.cs.meta b/Editor/Scripts/Graph/ARFNodeWorldAnchor.cs.meta new file mode 100644 index 0000000000000000000000000000000000000000..bb1bb7e9dbcc846457423ce25bb5ae3dccc979ec --- /dev/null +++ b/Editor/Scripts/Graph/ARFNodeWorldAnchor.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 21e22c1ed011b7a4da95fad83be1d9fa +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Editor/Scripts/Graph/ARFPort.cs b/Editor/Scripts/Graph/ARFPort.cs new file mode 100644 index 0000000000000000000000000000000000000000..9728bd1ecd8581340a02a8a666577b5e9bc68eb4 --- /dev/null +++ b/Editor/Scripts/Graph/ARFPort.cs @@ -0,0 +1,80 @@ +// +// ARF - Augmented Reality Framework (ETSI ISG ARF) +// +// Copyright 2024 ETSI +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Last change: June 2024 +// + +using System; +using System.Collections.Generic; +using UnityEditor.Experimental.GraphView; +using UnityEngine; +using UnityEngine.UIElements; + +using ETSI.ARF.WorldStorage.Editor.Windows; +using ETSI.ARF.WorldStorage.UI; +using ETSI.ARF.OpenAPI.WorldStorage; + +namespace ETSI.ARF.WorldStorage.Editor.Graph +{ + public class ARFPort : Port + { + protected ARFPort(Orientation portOrientation, Direction portDirection, Capacity portCapacity, Type type) : base(portOrientation, portDirection, portCapacity, type) + { + } + + public override void Connect(Edge edge) + { + base.Connect(edge); + ARFNode fromNode = edge.output.node as ARFNode; + ARFNode toNode = edge.input.node as ARFNode; + + if (edge is ARFEdgeLink aRFedge) + { + Transform3D transform = new Transform3D(); + for (int i = 0; i < 15; i++) + { + transform.Add(0); + } + transform.Add(1); + + WorldLink worldLink = new WorldLink() + { + UUID = Guid.NewGuid(), + CreatorUUID = Guid.Parse(SaveInfo.instance.worldStorageUser.UUID), + UUIDFrom = Guid.Parse(fromNode.GUID), + UUIDTo = Guid.Parse(toNode.GUID), + TypeFrom = fromNode.GetElemType(), + TypeTo = toNode.GetElemType(), + Transform = transform, + Unit = UnitSystem.CM + }; + aRFedge.worldLink = worldLink; + } + } + + public static ARFPort CreateARF(Orientation orientation, Direction direction, Capacity capacity, Type type) where TEdge : Edge, new() + { + WorldLinkListener listener = new WorldLinkListener(); + ARFPort port = new(orientation, direction, capacity, type) + { + m_EdgeConnector = new EdgeConnector(listener) + }; + port.AddManipulator(port.m_EdgeConnector); + return port; + } + } +} \ No newline at end of file diff --git a/Editor/Scripts/Graph/ARFPort.cs.meta b/Editor/Scripts/Graph/ARFPort.cs.meta new file mode 100644 index 0000000000000000000000000000000000000000..6d043fde500829981fc15944de7d1198cb5e1375 --- /dev/null +++ b/Editor/Scripts/Graph/ARFPort.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3c67fa4402011954bb65be6215d52512 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Editor/Scripts/Graph/WorldLinkListener.cs b/Editor/Scripts/Graph/WorldLinkListener.cs new file mode 100644 index 0000000000000000000000000000000000000000..3133404ea2416d046b19d321c2e1114bb9d67959 --- /dev/null +++ b/Editor/Scripts/Graph/WorldLinkListener.cs @@ -0,0 +1,98 @@ +// +// ARF - Augmented Reality Framework (ETSI ISG ARF) +// +// Copyright 2024 ETSI +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Last change: June 2024 +// + +using UnityEngine; +using ETSI.ARF.WorldStorage.Editor.Windows; +using System.Collections.Generic; +using UnityEditor.Experimental.GraphView; +using static UnityEditor.Experimental.GraphView.Port; + +namespace ETSI.ARF.WorldStorage.Editor.Graph +{ + public class WorldLinkListener : IEdgeConnectorListener + { + private GraphViewChange m_GraphViewChange; + + private List m_EdgesToCreate; + + private List m_EdgesToDelete; + + public WorldLinkListener() + { + m_EdgesToCreate = new List(); + m_EdgesToDelete = new List(); + m_GraphViewChange.edgesToCreate = m_EdgesToCreate; + } + public void OnDrop(GraphView graphView, Edge edge) + { + m_EdgesToCreate.Clear(); + m_EdgesToCreate.Add(edge); + m_EdgesToDelete.Clear(); + if (edge.input.capacity == Capacity.Single) + { + foreach (Edge connection in edge.input.connections) + { + if (connection != edge) + { + m_EdgesToDelete.Add(connection); + } + } + } + + if (edge.output.capacity == Capacity.Single) + { + foreach (Edge connection2 in edge.output.connections) + { + if (connection2 != edge) + { + m_EdgesToDelete.Add(connection2); + } + } + } + + if (m_EdgesToDelete.Count > 0) + { + graphView.DeleteElements(m_EdgesToDelete); + } + + List edgesToCreate = m_EdgesToCreate; + if (graphView.graphViewChanged != null) + { + edgesToCreate = graphView.graphViewChanged(m_GraphViewChange).edgesToCreate; + } + + foreach (Edge item in edgesToCreate) + { + graphView.AddElement(item); + edge.input.Connect(item); + edge.output.Connect(item); + } + if (!SaveInfo.instance.linkIds.Contains(((ARFEdgeLink)edge).GUID)) + { + ((ARFEdgeLink)edge).MarkUnsaved(); + } + GraphEditorWindow.ShowWindow((ARFEdgeLink)edge); + } + + public void OnDropOutsidePort(Edge edge, Vector2 position) + { + } + } +} \ No newline at end of file diff --git a/Editor/Scripts/Graph/WorldLinkListener.cs.meta b/Editor/Scripts/Graph/WorldLinkListener.cs.meta new file mode 100644 index 0000000000000000000000000000000000000000..e19f2ea2695b2106e4290577b9abef17cb4dd141 --- /dev/null +++ b/Editor/Scripts/Graph/WorldLinkListener.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 54dbfcfdc75de1b46bc7da09df52db34 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Editor/Scripts/Windows.meta b/Editor/Scripts/Windows.meta new file mode 100644 index 0000000000000000000000000000000000000000..bf1141ac4617e76d6c3c2cfa2f92f99a21f33728 --- /dev/null +++ b/Editor/Scripts/Windows.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: fbbff3217b2a8cd428764d83150c7b22 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Editor/Scripts/Windows/BaseWindow.cs b/Editor/Scripts/Windows/BaseWindow.cs new file mode 100644 index 0000000000000000000000000000000000000000..64bba1e903b0e9623f8593e3d17e5ecc5dc74d87 --- /dev/null +++ b/Editor/Scripts/Windows/BaseWindow.cs @@ -0,0 +1,118 @@ +// +// ARF - Augmented Reality Framework (ETSI ISG ARF) +// +// Copyright 2024 ETSI +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Last change: June 2024 +// + +#define isDEBUG + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; + +using UnityEngine; +using UnityEditor; +using TMPro; + +using ETSI.ARF.WorldStorage.REST; +using ETSI.ARF.OpenAPI.WorldStorage; + +namespace ETSI.ARF.WorldStorage.UI +{ + public abstract class BaseWindow : EditorWindow + { + [HideInInspector] public WorldStorageServer worldStorageServer; + [HideInInspector] public WorldStorageUser worldStorageUser; + + [SerializeField] public List trackables = new List(); + + // + // Keyvalues + // + [SerializeField] protected KeyvalueTagList keyValueTags = new KeyvalueTagList(); + protected List<(string, string)> keyValuesFixed = new List<(string, string)>(3) + { + ("", ""),("", ""),("", "") + }; + protected void OutputKeyValue(int n) + { + string i1 = keyValuesFixed[n].Item1; + string i2 = keyValuesFixed[n].Item2; + i1 = EditorGUILayout.TextField("Key " + n, i1); + i2 = EditorGUILayout.TextField("Value " + n, i2); + keyValuesFixed[n] = (i1, i2); + } + + // + // UI stuffs + // + protected bool groupEnabled; + protected bool repaint = false; + protected Vector2 scrollPos; + protected Color ori; + protected GUIStyle gsTest; + protected string saveText = "Save"; + + public void Update() + { + if (repaint) + { + Repaint(); + repaint = false; + } + } + + void OnGUI() + { + ori = GUI.backgroundColor; // remember ori color + + gsTest = new GUIStyle("window"); + //gsTest.normal.textColor = WorldStorageWindow.arfColors[0]; + gsTest.fontStyle = FontStyle.Bold; + gsTest.alignment = TextAnchor.UpperLeft; + gsTest.fontSize = 16; + + scrollPos = EditorGUILayout.BeginScrollView(scrollPos, GUILayout.ExpandWidth(true)); + WorldStorageWindow.DrawCopyright(); + + DrawUIStuffs(); + + EditorGUILayout.EndScrollView(); + + if (GUILayout.Button("Close Window")) + { + Close(); + } + } + + public abstract void DrawUIStuffs(); + + public virtual void GetParams() + { + } + + public virtual void AddObject() + { + } + + public virtual T GenerateObject() + { + return default(T); + } + } +} \ No newline at end of file diff --git a/Editor/Scripts/Windows/BaseWindow.cs.meta b/Editor/Scripts/Windows/BaseWindow.cs.meta new file mode 100644 index 0000000000000000000000000000000000000000..eed84fadb615b82bec15c5f19ee92935b2d96a72 --- /dev/null +++ b/Editor/Scripts/Windows/BaseWindow.cs.meta @@ -0,0 +1,14 @@ +fileFormatVersion: 2 +guid: b879c85f4eccbee40a78e1a01aaf77ca +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: + - m_ViewDataDictionary: {instanceID: 0} + - worldStorageServer: {fileID: 11400000, guid: 4f997253243de534dad12937f1284975, type: 2} + - worldStorageUser: {instanceID: 0} + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Editor/Scripts/Windows/GraphEditorWindow.cs b/Editor/Scripts/Windows/GraphEditorWindow.cs new file mode 100644 index 0000000000000000000000000000000000000000..33d15ae875a4f5ba21a55325bc6055fa908e226e --- /dev/null +++ b/Editor/Scripts/Windows/GraphEditorWindow.cs @@ -0,0 +1,1280 @@ +// +// ARF - Augmented Reality Framework (ETSI ISG ARF) +// +// Copyright 2024 ETSI +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Last change: June 2024 +// + +using System; +using System.Collections.Generic; + +using UnityEditor; +using UnityEngine; + +using ETSI.ARF.WorldStorage.REST; +using ETSI.ARF.WorldStorage.UI; +using ETSI.ARF.WorldStorage.Editor.Graph; +using ETSI.ARF.OpenAPI.WorldStorage; +using System.Collections.ObjectModel; + +namespace ETSI.ARF.WorldStorage.Editor.Windows +{ + public class GraphEditorWindow : EditorWindow + { + public enum GraphEditorType + { + TRACKABLE, + WORLDANCHOR, + WORLDLINK, + NULL + } + + public GraphEditorType type; + + public ARFNodeTrackable trackableNode; + public ARFNodeWorldAnchor worldAnchorNode; + public ARFEdgeLink worldLinkEdge; + + public Trackable trackable; + public WorldAnchor worldAnchor; + public WorldLink worldLink; + + public Vector3 local_size; + public Vector3 local_rot; + public Vector3 local_pos; + + //test + string m_newKey = ""; + List m_newValues = new List(); + + // UI stuffs + private Vector2 scrollPos; + static public GraphEditorWindow winSingleton; + + public void OnEnable() + { + ResetWindow(); + } + + public static void ResetWindow() + { + Type inspectorType = Type.GetType("UnityEditor.InspectorWindow,UnityEditor.dll"); + winSingleton = GetWindow("Element Editor", true, inspectorType); + winSingleton.trackable = null; + winSingleton.worldAnchor = null; + winSingleton.worldLink = null; + + winSingleton.trackableNode = null; + winSingleton.worldAnchorNode = null; + winSingleton.worldLinkEdge = null; + + winSingleton.local_size = Vector3.zero; + winSingleton.local_rot = Vector3.zero; + winSingleton.local_pos = Vector3.zero; + + winSingleton.type = GraphEditorType.NULL; + } + + public static void ShowWindow(ARFNodeTrackable trackableNode) + { + Type inspectorType = Type.GetType("UnityEditor.InspectorWindow,UnityEditor.dll"); + winSingleton = GetWindow("Element Editor", true, inspectorType); + winSingleton.type = GraphEditorType.TRACKABLE; + + winSingleton.trackable = null; + winSingleton.worldAnchor = null; + winSingleton.worldLink = null; + + winSingleton.trackableNode = null; + winSingleton.worldAnchorNode = null; + winSingleton.worldLinkEdge = null; + + winSingleton.trackableNode = trackableNode; + winSingleton.trackable = trackableNode.trackable; + + winSingleton.local_size = new Vector3((float)winSingleton.trackable.TrackableSize[0], (float)winSingleton.trackable.TrackableSize[1], (float)winSingleton.trackable.TrackableSize[2]); + if (winSingleton.trackable.LocalCRS.Count == 16) + { + Matrix4x4 localCRS = new Matrix4x4(); + localCRS.m00 = winSingleton.trackable.LocalCRS[0]; localCRS.m01 = winSingleton.trackable.LocalCRS[1]; localCRS.m02 = winSingleton.trackable.LocalCRS[2]; localCRS.m03 = winSingleton.trackable.LocalCRS[3]; + localCRS.m10 = winSingleton.trackable.LocalCRS[4]; localCRS.m11 = winSingleton.trackable.LocalCRS[5]; localCRS.m12 = winSingleton.trackable.LocalCRS[6]; localCRS.m13 = winSingleton.trackable.LocalCRS[7]; + localCRS.m20 = winSingleton.trackable.LocalCRS[8]; localCRS.m21 = winSingleton.trackable.LocalCRS[9]; localCRS.m22 = winSingleton.trackable.LocalCRS[10]; localCRS.m23 = winSingleton.trackable.LocalCRS[11]; + localCRS.m30 = winSingleton.trackable.LocalCRS[12]; localCRS.m31 = winSingleton.trackable.LocalCRS[13]; localCRS.m32 = winSingleton.trackable.LocalCRS[14]; localCRS.m33 = winSingleton.trackable.LocalCRS[15]; + winSingleton.local_pos = localCRS.GetPosition(); + winSingleton.local_rot = localCRS.rotation.eulerAngles; + } + + } + + public static void ShowWindow(ARFNodeWorldAnchor worldAnchorNode) + { + Type inspectorType = Type.GetType("UnityEditor.InspectorWindow,UnityEditor.dll"); + winSingleton = GetWindow("Element Editor", true, inspectorType); + winSingleton.type = GraphEditorType.WORLDANCHOR; + + winSingleton.trackable = null; + winSingleton.worldAnchor = null; + winSingleton.worldLink = null; + + winSingleton.trackableNode = null; + winSingleton.worldAnchorNode = null; + winSingleton.worldLinkEdge = null; + + winSingleton.worldAnchorNode = worldAnchorNode; + winSingleton.worldAnchor = worldAnchorNode.worldAnchor; + + winSingleton.local_size = new Vector3((float)winSingleton.worldAnchor.WorldAnchorSize[0], (float)winSingleton.worldAnchor.WorldAnchorSize[1], (float)winSingleton.worldAnchor.WorldAnchorSize[2]); + if (winSingleton.worldAnchor.LocalCRS.Count == 16) + { + Matrix4x4 localCRS = new Matrix4x4(); + localCRS.m00 = winSingleton.worldAnchor.LocalCRS[0]; localCRS.m01 = winSingleton.worldAnchor.LocalCRS[1]; localCRS.m02 = winSingleton.worldAnchor.LocalCRS[2]; localCRS.m03 = winSingleton.worldAnchor.LocalCRS[3]; + localCRS.m10 = winSingleton.worldAnchor.LocalCRS[4]; localCRS.m11 = winSingleton.worldAnchor.LocalCRS[5]; localCRS.m12 = winSingleton.worldAnchor.LocalCRS[6]; localCRS.m13 = winSingleton.worldAnchor.LocalCRS[7]; + localCRS.m20 = winSingleton.worldAnchor.LocalCRS[8]; localCRS.m21 = winSingleton.worldAnchor.LocalCRS[9]; localCRS.m22 = winSingleton.worldAnchor.LocalCRS[10]; localCRS.m23 = winSingleton.worldAnchor.LocalCRS[11]; + localCRS.m30 = winSingleton.worldAnchor.LocalCRS[12]; localCRS.m31 = winSingleton.worldAnchor.LocalCRS[13]; localCRS.m32 = winSingleton.worldAnchor.LocalCRS[14]; localCRS.m33 = winSingleton.worldAnchor.LocalCRS[15]; + winSingleton.local_pos = localCRS.GetPosition(); + winSingleton.local_rot = localCRS.rotation.eulerAngles; + } + } + + public static void ShowWindow(ARFEdgeLink graphEdge) + { + Type inspectorType = Type.GetType("UnityEditor.InspectorWindow,UnityEditor.dll"); + winSingleton = GetWindow("Element Editor", true, inspectorType); + winSingleton.type = GraphEditorType.WORLDLINK; + + winSingleton.trackable = null; + winSingleton.worldAnchor = null; + winSingleton.worldLink = null; + + winSingleton.trackableNode = null; + winSingleton.worldAnchorNode = null; + winSingleton.worldLinkEdge = null; + + winSingleton.worldLinkEdge = graphEdge; + winSingleton.worldLink = graphEdge.worldLink; + + if (winSingleton.worldLink.Transform.Count == 16) + { + Matrix4x4 localCRS = new Matrix4x4(); + localCRS.m00 = winSingleton.worldLink.Transform[0]; localCRS.m01 = winSingleton.worldLink.Transform[1]; localCRS.m02 = winSingleton.worldLink.Transform[2]; localCRS.m03 = winSingleton.worldLink.Transform[3]; + localCRS.m10 = winSingleton.worldLink.Transform[4]; localCRS.m11 = winSingleton.worldLink.Transform[5]; localCRS.m12 = winSingleton.worldLink.Transform[6]; localCRS.m13 = winSingleton.worldLink.Transform[7]; + localCRS.m20 = winSingleton.worldLink.Transform[8]; localCRS.m21 = winSingleton.worldLink.Transform[9]; localCRS.m22 = winSingleton.worldLink.Transform[10]; localCRS.m23 = winSingleton.worldLink.Transform[11]; + localCRS.m30 = winSingleton.worldLink.Transform[12]; localCRS.m31 = winSingleton.worldLink.Transform[13]; localCRS.m32 = winSingleton.worldLink.Transform[14]; localCRS.m33 = winSingleton.worldLink.Transform[15]; + winSingleton.local_pos = localCRS.GetPosition(); + winSingleton.local_rot = localCRS.rotation.eulerAngles; + } + } + + public void OnGUI() + { + scrollPos = EditorGUILayout.BeginScrollView(scrollPos, GUILayout.ExpandWidth(true)); + + //style for copyrights label (left aligned) + var leftStyle = GUI.skin.GetStyle("Label"); + leftStyle.alignment = TextAnchor.UpperLeft; + + GUILayout.Label("Augmented Reality Framework", leftStyle); + GUILayout.Label("Copyright (C) 2024, ETSI (BSD 3-Clause License)", leftStyle); + + //separator line + Rect rect = EditorGUILayout.GetControlRect(false, 1); + EditorGUI.DrawRect(rect, Color.gray); + + switch (type) + { + case GraphEditorType.WORLDLINK: + BuildWorldLinkUI(); + break; + case GraphEditorType.TRACKABLE: + BuildTrackableUI(); + break; + case GraphEditorType.WORLDANCHOR: + BuildWorldAnchorUI(); + break; + default: + break; + } + + EditorGUILayout.EndScrollView(); + } + + //BUILD UI FOR MODIYING THE WORLDANCHOR + private void BuildWorldAnchorUI() + { + if (worldAnchor != null) + { + + // + //HEADER + // + + //anchor icon + EditorGUILayout.BeginHorizontal(); + Texture anchorImage = (Texture)AssetDatabase.LoadAssetAtPath("Packages/etsi.isg.arf.worldstorage/Editor/Images/anchor.png", typeof(Texture)); + GUI.backgroundColor = WorldStorageWindow.arfColors[8]; + GUILayout.Box(anchorImage, GUILayout.Width(40), GUILayout.Height(40)); + + //anchor label + EditorGUILayout.BeginVertical(GUILayout.Height(50)); + GUILayout.FlexibleSpace(); + EditorGUILayout.LabelField("WORLD ANCHOR", EditorStyles.boldLabel); + GUILayout.FlexibleSpace(); + EditorGUILayout.EndVertical(); + EditorGUILayout.EndHorizontal(); + + //separator line + var rect = EditorGUILayout.BeginHorizontal(GUILayout.Height(10)); + DrawUILine(new Color(1, 0.7f, 0, 0.9f), 5, 5); + EditorGUILayout.EndHorizontal(); + + if (worldAnchorNode.titleContainer.Contains(worldAnchorNode.savedIcon)) + { + //the icon to add if the node does not correspond to an element in the server + Texture2D warningImage = (Texture2D)AssetDatabase.LoadAssetAtPath("Packages/etsi.isg.arf.worldstorage/Editor/Images/warning.png", typeof(Texture2D)); + + GUI.backgroundColor = Color.clear; + GUILayout.BeginHorizontal(); + GUILayout.Box(warningImage, GUILayout.Width(27), GUILayout.Height(27)); + GUILayout.Label("This element is not synchronized with the World Storage!", EditorStyles.whiteBoldLabel); + + GUILayout.EndHorizontal(); + } + + // + //ELEMENT PARAMETERS + // + + EditorGUI.BeginChangeCheck(); + + //uuid + EditorGUILayout.BeginHorizontal(); + EditorGUILayout.LabelField("UUID ", EditorStyles.boldLabel, GUILayout.Width(50)); + if (!SaveInfo.instance.nodePositions.ContainsKey(worldAnchor.UUID.ToString())) + { + EditorGUILayout.LabelField("None yet (element not yet saved in the server)"); + } + else + { + EditorGUILayout.SelectableLabel(worldAnchor.UUID.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight)); + } + EditorGUILayout.EndHorizontal(); + + GUI.backgroundColor = Color.white; + + //name + EditorGUILayout.BeginHorizontal(); + EditorGUI.BeginChangeCheck(); + EditorGUILayout.LabelField("Name ", EditorStyles.boldLabel, GUILayout.Width(50)); + worldAnchor.Name = EditorGUILayout.DelayedTextField(worldAnchor.Name); + if (EditorGUI.EndChangeCheck()) + { + worldAnchorNode.title = worldAnchor.Name; + } + EditorGUILayout.EndHorizontal(); + + //unit system + EditorGUILayout.BeginHorizontal(); + EditorGUILayout.LabelField("Unit ", EditorStyles.boldLabel, GUILayout.Width(50)); + worldAnchor.Unit = (UnitSystem)EditorGUILayout.EnumPopup(worldAnchor.Unit); + EditorGUILayout.EndHorizontal(); + + //style for sublabels (right aligned) + var rightStyle = GUI.skin.GetStyle("Label"); + rightStyle.alignment = TextAnchor.UpperRight; + + //size + EditorGUILayout.BeginHorizontal(); + EditorGUILayout.LabelField("Size ", EditorStyles.boldLabel, GUILayout.Width(50)); + EditorGUILayout.EndHorizontal(); + EditorGUILayout.BeginHorizontal(); + EditorGUILayout.LabelField("Width", rightStyle, GUILayout.Width(50)); + local_size[0] = EditorGUILayout.DelayedFloatField(local_size[0]); + EditorGUILayout.LabelField("Length", rightStyle, GUILayout.Width(50)); + local_size[1] = EditorGUILayout.DelayedFloatField(local_size[1]); + EditorGUILayout.LabelField("Depth", rightStyle, GUILayout.Width(50)); + local_size[2] = EditorGUILayout.DelayedFloatField(local_size[2]); + EditorGUILayout.EndHorizontal(); + + //localCRS + EditorGUILayout.BeginHorizontal(); + EditorGUILayout.LabelField("Local CRS ", EditorStyles.boldLabel); + EditorGUILayout.EndHorizontal(); + //position + EditorGUILayout.BeginHorizontal(); + EditorGUILayout.LabelField("Position ", GUILayout.Width(60)); + EditorGUILayout.LabelField("X", rightStyle, GUILayout.Width(15)); + local_pos[0] = EditorGUILayout.DelayedFloatField(local_pos[0]); + EditorGUILayout.LabelField("Y", rightStyle, GUILayout.Width(15)); + local_pos[1] = EditorGUILayout.DelayedFloatField(local_pos[1]); + EditorGUILayout.LabelField("Z", rightStyle, GUILayout.Width(15)); + local_pos[2] = EditorGUILayout.DelayedFloatField(local_pos[2]); + EditorGUILayout.EndHorizontal(); + //rotation + EditorGUILayout.BeginHorizontal(); + EditorGUILayout.LabelField("Rotation ", GUILayout.Width(60)); + EditorGUILayout.LabelField("X", rightStyle, GUILayout.Width(15)); + local_rot[0] = EditorGUILayout.DelayedFloatField(local_rot[0]); + EditorGUILayout.LabelField("Y", rightStyle, GUILayout.Width(15)); + local_rot[1] = EditorGUILayout.DelayedFloatField(local_rot[1]); + EditorGUILayout.LabelField("Z", rightStyle, GUILayout.Width(15)); + local_rot[2] = EditorGUILayout.DelayedFloatField(local_rot[2]); + EditorGUILayout.EndHorizontal(); + + //keyvaluetags=================================================================================================TOBEMODIFIED + /*DrawUILine(Color.gray, 1, 1); + EditorGUILayout.BeginHorizontal(); + GUILayout.Label("Tags ", EditorStyles.boldLabel); + EditorGUILayout.EndHorizontal(); + + EditorGUILayout.BeginVertical(); + Dictionary> tempPairs = worldAnchor.KeyvalueTags; + EditorGUILayout.BeginHorizontal(); + m_newKey = GUILayout.TextField(m_newKey, GUILayout.Width(300)); + if (GUILayout.Button("Add Key")) + { + if (m_newKey != "") + { + List emptyList = new List(); + worldAnchor.KeyvalueTags.Add(m_newKey, emptyList); + m_newKey = ""; + } + } + GUILayout.FlexibleSpace(); + EditorGUILayout.EndHorizontal(); + //iterator on m_newValues + int j = 0; + foreach (KeyValuePair> entry in tempPairs) + { + EditorGUILayout.BeginHorizontal(); + GUILayout.Label(entry.Key); + GUILayout.FlexibleSpace(); + if (GUILayout.Button("x", GUILayout.Width(18), GUILayout.Height(18))) + { + worldAnchor.KeyvalueTags.Remove(entry.Key); + m_newValues[j] = ""; + } + EditorGUILayout.EndHorizontal(); + + + EditorGUILayout.BeginHorizontal(); + List tempValues = entry.Value; + foreach (string value in tempValues) + { + GUILayout.Label(value); + + if (GUILayout.Button("x", GUILayout.Width(18), GUILayout.Height(18))) + { + tempValues.Remove(value); + worldAnchor.KeyvalueTags[entry.Key] = tempValues; + } + } + GUILayout.FlexibleSpace(); + EditorGUILayout.EndHorizontal(); + EditorGUILayout.BeginHorizontal(); + if (m_newValues.Count < j + 1) + { + string value = ""; + m_newValues.Add(value); + } + m_newValues[j] = GUILayout.TextField(m_newValues[j], GUILayout.Width(200)); + if (GUILayout.Button("Add Value")) + { + if (m_newValues[j] != "") + { + List valueList = entry.Value; + valueList.Add(m_newValues[j]); + worldAnchor.KeyvalueTags[entry.Key] = valueList; + m_newValues[j] = ""; + } + } + GUILayout.FlexibleSpace(); + EditorGUILayout.EndHorizontal(); + + j++; + } + EditorGUILayout.EndVertical();*/ + //keyvaluetags=================================================================================================TOBEMODIFIED + + + //Actions when the ui fields have been changed + if (EditorGUI.EndChangeCheck()) + { + // + Matrix4x4 localCRS = Matrix4x4.TRS(local_pos, Quaternion.Euler(local_rot), Vector3.one); + Transform3D localCRSasFloat = new Transform3D + { + localCRS.m00, localCRS.m01, localCRS.m02, localCRS.m03, + localCRS.m10, localCRS.m11, localCRS.m12, localCRS.m13, + localCRS.m20, localCRS.m21, localCRS.m22, localCRS.m23, + localCRS.m30, localCRS.m31, localCRS.m32, localCRS.m33, + }; + worldAnchor.LocalCRS = localCRSasFloat; + + Size localSizeAsFloat = new Size + { + local_size.x, local_size.y, local_size.z + }; + worldAnchor.WorldAnchorSize = localSizeAsFloat; + + if (SaveInfo.instance.nodePositions.ContainsKey(worldAnchor.UUID.ToString()) && (!SaveInfo.instance.elemsToUpdate.Contains(worldAnchor.UUID.ToString()))) + { + SaveInfo.instance.elemsToUpdate.Add(worldAnchor.UUID.ToString()); + } + worldAnchorNode.MarkUnsaved(); + } + + // + //FOOTER + // + //GUILayout.FlexibleSpace(); + EditorGUILayout.BeginHorizontal(); + GUILayout.FlexibleSpace(); + + var originalColor = GUI.backgroundColor; + + + //reload button + GUI.backgroundColor = Color.yellow; + if (GUILayout.Button("Reload")) + { + //lose focus of fields otherwise the selected field won't updaate + EditorGUI.FocusTextInControl(null); + if (SaveInfo.instance.nodePositions.ContainsKey(worldAnchor.UUID.ToString())) + { + if (SaveInfo.instance.elemsToUpdate.Contains(worldAnchor.UUID.ToString()) && EditorUtility.DisplayDialog("Reset elements", "Are you sure you want to lose all your changes ?", "Yes", "No")) + { + WorldAnchorRequest.GetWorldAnchorAsync(SaveInfo.instance.worldStorageServer, worldAnchor.UUID, (response) => + { + worldAnchor = + worldAnchorNode.worldAnchor = worldAnchor; + ShowWindow(worldAnchorNode); + }); + } + } + else + { + if (EditorUtility.DisplayDialog("Reset elements", "Are you sure you want to lose all your changes ?", "Yes", "No")) + { + //generate the worldAnchor attributes + Transform3D localCRS = new Transform3D(); + for (int i = 0; i < 15; i++) + { + localCRS.Add(0); + } + localCRS.Add(1); + + Size worldAnchorSize = new Size(); + for (int i = 0; i < 3; i++) + { + worldAnchorSize.Add(0); + } + worldAnchor = new WorldAnchor("DefaultWorldAnchor") + { + UUID = Guid.NewGuid(), + CreatorUUID = Guid.Parse(SaveInfo.instance.worldStorageUser.UUID), + LocalCRS = localCRS, + Unit = UnitSystem.CM, + WorldAnchorSize = worldAnchorSize, + KeyvalueTags = new KeyvalueTagList() + }; + worldAnchorNode.worldAnchor = worldAnchor; + ShowWindow(worldAnchorNode); + } + } + } + + // save button + GUI.backgroundColor = Color.green; + if (GUILayout.Button("Save")) + { + System.Guid _creator = Guid.NewGuid(); // System.Guid.Parse(WorldStorageWindow.WorldStorageWindowSingleton.worldStorageUser.UUID); + if (SaveInfo.instance.nodePositions.ContainsKey(worldAnchor.UUID.ToString())) + { + if (SaveInfo.instance.elemsToUpdate.Contains(worldAnchor.UUID.ToString())) + { + WorldAnchorRequest.UpdateWorldAnchorAsync(SaveInfo.instance.worldStorageServer, worldAnchor, (response) => + { + SaveInfo.instance.elemsToUpdate.Remove(worldAnchor.UUID.ToString()); + }); + } + } + else + { + var posX = new Collection(); + posX.Add(worldAnchorNode.GetPosition().x.ToString()); + var posY = new Collection(); + posY.Add(worldAnchorNode.GetPosition().y.ToString()); + + WorldAnchor worldAnchor = worldAnchorNode.worldAnchor; + worldAnchor.KeyvalueTags["unityAuthoringPosX"] = posX; + worldAnchor.KeyvalueTags["unityAuthoringPosY"] = posY; + + WorldAnchorRequest.CreateWorldAnchorAsync(SaveInfo.instance.worldStorageServer, worldAnchor, (response) => + { + String uuid = response.result.Message; + + //change the uuid in its edges, if there is a new edge to be added in the world storage it needs to have the correct uuid + uuid = uuid.Replace("\"", ""); + foreach (ARFEdgeLink edge in worldAnchorNode.portIn.connections) + { + edge.worldLink.UUIDTo = Guid.Parse(uuid); + } + foreach (ARFEdgeLink edge in worldAnchorNode.portOut.connections) + { + edge.worldLink.UUIDFrom = Guid.Parse(uuid); + } + worldAnchorNode.worldAnchor.UUID = Guid.Parse(uuid); + worldAnchorNode.GUID = uuid; + worldAnchorNode.title = worldAnchor.Name; + + //Add the newly saved World Anchor to the SaveInfo singleton + Rect trackPos = new(worldAnchorNode.GetPosition().x, worldAnchorNode.GetPosition().y, 135, 77); + SaveInfo.instance.nodePositions[uuid] = trackPos; + }); + } + worldAnchorNode.MarkSaved(); + } + GUILayout.Space(10); + EditorGUILayout.EndHorizontal(); + GUILayout.Space(10); + + GUI.backgroundColor = originalColor; + + + } + } + + private void BuildTrackableUI() + { + if (trackable != null) + { + // + //HEADER + // + + //trackable icon + EditorGUILayout.BeginHorizontal(); + Texture trackImage = (Texture)AssetDatabase.LoadAssetAtPath("Packages/etsi.isg.arf.worldstorage/Editor/Images/trackable.png", typeof(Texture)); + GUI.backgroundColor = WorldStorageWindow.arfColors[7]; + GUILayout.Box(trackImage, GUILayout.Width(40), GUILayout.Height(40)); + + //trackable label + EditorGUILayout.BeginVertical(GUILayout.Height(50)); + GUILayout.FlexibleSpace(); + EditorGUILayout.LabelField("TRACKABLE", EditorStyles.boldLabel); + GUILayout.FlexibleSpace(); + EditorGUILayout.EndVertical(); + EditorGUILayout.EndHorizontal(); + + //separator line + var rect = EditorGUILayout.BeginHorizontal(GUILayout.Height(10)); + DrawUILine(new Color(1, 0.31f, 0.31f, 0.9f), 5, 0); + EditorGUILayout.EndHorizontal(); + + if (trackableNode.titleContainer.Contains(trackableNode.savedIcon)) + { + //the icon to add if the node does not correspond to an element in the server + Texture2D warningImage = (Texture2D)AssetDatabase.LoadAssetAtPath("Packages/etsi.isg.arf.worldstorage/Editor/Images/warning.png", typeof(Texture2D)); + + GUI.backgroundColor = Color.clear; + GUILayout.BeginHorizontal(); + GUILayout.Box(warningImage, GUILayout.Width(27), GUILayout.Height(27)); + GUILayout.Label("This element is not synchronized with the World Storage!", EditorStyles.whiteBoldLabel); + GUILayout.EndHorizontal(); + } + + // + //ELEMENT PARAMETERS + // + + EditorGUI.BeginChangeCheck(); + + //uuid + EditorGUILayout.BeginHorizontal(); + EditorGUILayout.LabelField("UUID ", EditorStyles.boldLabel, GUILayout.Width(50)); + if (!SaveInfo.instance.nodePositions.ContainsKey(trackable.UUID.ToString())) + { + EditorGUILayout.LabelField("None yet (element not yet saved in the server)"); + } + else + { + EditorGUILayout.SelectableLabel(trackable.UUID.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight)); + } + EditorGUILayout.EndHorizontal(); + + GUI.backgroundColor = Color.white; + + //name + EditorGUILayout.BeginHorizontal(); + EditorGUI.BeginChangeCheck(); + EditorGUILayout.LabelField("Name ", EditorStyles.boldLabel, GUILayout.Width(50)); + trackable.Name = EditorGUILayout.DelayedTextField(trackable.Name); + if (EditorGUI.EndChangeCheck()) + { + trackableNode.title = trackable.Name; + } + EditorGUILayout.EndHorizontal(); + + //trackable's type + EditorGUILayout.BeginHorizontal(); + EditorGUILayout.LabelField("Type ", EditorStyles.boldLabel, GUILayout.Width(50)); + trackable.TrackableType = (TrackableType)EditorGUILayout.EnumPopup(trackable.TrackableType); + EditorGUILayout.EndHorizontal(); + + //unit system + EditorGUILayout.BeginHorizontal(); + EditorGUILayout.LabelField("Unit ", EditorStyles.boldLabel, GUILayout.Width(50)); + trackable.Unit = (UnitSystem)EditorGUILayout.EnumPopup(trackable.Unit); + EditorGUILayout.EndHorizontal(); + + //style for sublabels (right aligned) + var rightStyle = GUI.skin.GetStyle("Label"); + rightStyle.alignment = TextAnchor.UpperRight; + + //size + EditorGUILayout.BeginHorizontal(); + EditorGUILayout.LabelField("Size ", EditorStyles.boldLabel, GUILayout.Width(50)); + EditorGUILayout.EndHorizontal(); + EditorGUILayout.BeginHorizontal(); + EditorGUILayout.LabelField("Width", rightStyle, GUILayout.Width(50)); + local_size[0] = EditorGUILayout.DelayedFloatField(local_size[0]); + EditorGUILayout.LabelField("Length", rightStyle, GUILayout.Width(50)); + local_size[1] = EditorGUILayout.DelayedFloatField(local_size[1]); + EditorGUILayout.LabelField("Depth", rightStyle, GUILayout.Width(50)); + local_size[2] = EditorGUILayout.DelayedFloatField(local_size[2]); + EditorGUILayout.EndHorizontal(); + + //localCRS + EditorGUILayout.BeginHorizontal(); + EditorGUILayout.LabelField("Local CRS ", EditorStyles.boldLabel); + EditorGUILayout.EndHorizontal(); + //position + EditorGUILayout.BeginHorizontal(); + EditorGUILayout.LabelField("Position ", GUILayout.Width(60)); + EditorGUILayout.LabelField("X", rightStyle, GUILayout.Width(15)); + local_pos[0] = EditorGUILayout.DelayedFloatField(local_pos[0]); + EditorGUILayout.LabelField("Y", rightStyle, GUILayout.Width(15)); + local_pos[1] = EditorGUILayout.DelayedFloatField(local_pos[1]); + EditorGUILayout.LabelField("Z", rightStyle, GUILayout.Width(15)); + local_pos[2] = EditorGUILayout.DelayedFloatField(local_pos[2]); + EditorGUILayout.EndHorizontal(); + //rotation + EditorGUILayout.BeginHorizontal(); + EditorGUILayout.LabelField("Rotation ", GUILayout.Width(60)); + EditorGUILayout.LabelField("X", rightStyle, GUILayout.Width(15)); + local_rot[0] = EditorGUILayout.DelayedFloatField(local_rot[0]); + EditorGUILayout.LabelField("Y", rightStyle, GUILayout.Width(15)); + local_rot[1] = EditorGUILayout.DelayedFloatField(local_rot[1]); + EditorGUILayout.LabelField("Z", rightStyle, GUILayout.Width(15)); + local_rot[2] = EditorGUILayout.DelayedFloatField(local_rot[2]); + EditorGUILayout.EndHorizontal(); + + //encodingInofrmation + EditorGUILayout.BeginHorizontal(); + EditorGUILayout.LabelField("Trackable Information ", EditorStyles.boldLabel); + EditorGUILayout.EndHorizontal(); + EditorGUILayout.BeginHorizontal(); + EditorGUILayout.LabelField("Format ", GUILayout.Width(50)); + trackable.TrackableEncodingInformation.DataFormat = (EncodingInformationStructureDataFormat)EditorGUILayout.EnumPopup(trackable.TrackableEncodingInformation.DataFormat); + EditorGUILayout.LabelField("Version ", GUILayout.Width(50)); + float floatVersion; + if (trackable.TrackableEncodingInformation.Version != null) + { + floatVersion = EditorGUILayout.DelayedFloatField(WorldStorageRequest.FloatParse(trackable.TrackableEncodingInformation.Version)); + } + else + { + floatVersion = EditorGUILayout.DelayedFloatField(0); + } + trackable.TrackableEncodingInformation.Version = floatVersion.ToString(); + EditorGUILayout.EndHorizontal(); + + /*//trackable payload + EditorGUILayout.BeginHorizontal(); + EditorGUILayout.LabelField("Trackable Payload ", EditorStyles.boldLabel, GUILayout.Width(140)); + EditorGUILayout.LabelField("==============================================================================="); + EditorGUILayout.EndHorizontal();*/ + + //keyvaluetags=================================================================================================TOBEMODIFIED + /*EditorGUILayout.BeginHorizontal(); + GUILayout.Label("Tags ", EditorStyles.boldLabel); + EditorGUILayout.EndHorizontal(); + + EditorGUILayout.BeginVertical(); + Dictionary> tempPairs = trackable.KeyvalueTags; + EditorGUILayout.BeginHorizontal(); + m_newKey = GUILayout.TextField(m_newKey, GUILayout.Width(300)); + if (GUILayout.Button("Add Key")) + { + if (m_newKey != "") + { + List emptyList = new List(); + trackable.KeyvalueTags.Add(m_newKey, emptyList); + m_newKey = ""; + } + } + GUILayout.FlexibleSpace(); + EditorGUILayout.EndHorizontal(); + //iterator on m_newValues + int j = 0; + foreach (KeyValuePair> entry in tempPairs) + { + DrawUILine(Color.gray, 1, 1); + EditorGUILayout.BeginHorizontal(); + GUILayout.Label(entry.Key); + GUILayout.FlexibleSpace(); + if (GUILayout.Button("x", GUILayout.Width(18), GUILayout.Height(18))) + { + trackable.KeyvalueTags.Remove(entry.Key); + m_newValues[j] = ""; + } + EditorGUILayout.EndHorizontal(); + + + EditorGUILayout.BeginHorizontal(); + List tempValues = entry.Value; + foreach (string value in tempValues) + { + GUILayout.Label(value); + + if (GUILayout.Button("x", GUILayout.Width(18), GUILayout.Height(18))) + { + tempValues.Remove(value); + trackable.KeyvalueTags[entry.Key] = tempValues; + } + } + GUILayout.FlexibleSpace(); + EditorGUILayout.EndHorizontal(); + EditorGUILayout.BeginHorizontal(); + if (m_newValues.Count < j + 1) + { + string value = ""; + m_newValues.Add(value); + } + m_newValues[j] = GUILayout.TextField(m_newValues[j], GUILayout.Width(200)); + if (GUILayout.Button("Add Value")) + { + if (m_newValues[j] != "") + { + List valueList = entry.Value; + valueList.Add(m_newValues[j]); + trackable.KeyvalueTags[entry.Key] = valueList; + m_newValues[j] = ""; + } + } + GUILayout.FlexibleSpace(); + EditorGUILayout.EndHorizontal(); + + j++; + } + EditorGUILayout.EndVertical();*//*EditorGUILayout.BeginHorizontal(); + GUILayout.Label("Tags ", EditorStyles.boldLabel); + EditorGUILayout.EndHorizontal(); + + EditorGUILayout.BeginVertical(); + Dictionary> tempPairs = trackable.KeyvalueTags; + EditorGUILayout.BeginHorizontal(); + m_newKey = GUILayout.TextField(m_newKey, GUILayout.Width(300)); + if (GUILayout.Button("Add Key")) + { + if (m_newKey != "") + { + List emptyList = new List(); + trackable.KeyvalueTags.Add(m_newKey, emptyList); + m_newKey = ""; + } + } + GUILayout.FlexibleSpace(); + EditorGUILayout.EndHorizontal(); + //iterator on m_newValues + int j = 0; + foreach (KeyValuePair> entry in tempPairs) + { + DrawUILine(Color.gray, 1, 1); + EditorGUILayout.BeginHorizontal(); + GUILayout.Label(entry.Key); + GUILayout.FlexibleSpace(); + if (GUILayout.Button("x", GUILayout.Width(18), GUILayout.Height(18))) + { + trackable.KeyvalueTags.Remove(entry.Key); + m_newValues[j] = ""; + } + EditorGUILayout.EndHorizontal(); + + + EditorGUILayout.BeginHorizontal(); + List tempValues = entry.Value; + foreach (string value in tempValues) + { + GUILayout.Label(value); + + if (GUILayout.Button("x", GUILayout.Width(18), GUILayout.Height(18))) + { + tempValues.Remove(value); + trackable.KeyvalueTags[entry.Key] = tempValues; + } + } + GUILayout.FlexibleSpace(); + EditorGUILayout.EndHorizontal(); + EditorGUILayout.BeginHorizontal(); + if (m_newValues.Count < j + 1) + { + string value = ""; + m_newValues.Add(value); + } + m_newValues[j] = GUILayout.TextField(m_newValues[j], GUILayout.Width(200)); + if (GUILayout.Button("Add Value")) + { + if (m_newValues[j] != "") + { + List valueList = entry.Value; + valueList.Add(m_newValues[j]); + trackable.KeyvalueTags[entry.Key] = valueList; + m_newValues[j] = ""; + } + } + GUILayout.FlexibleSpace(); + EditorGUILayout.EndHorizontal(); + + j++; + } + EditorGUILayout.EndVertical();*/ + //keyvaluetags=================================================================================================TOBEMODIFIED + + + //Actions when the ui fields have been changed + if (EditorGUI.EndChangeCheck()) + { + // + Matrix4x4 localCRS = Matrix4x4.TRS(local_pos, Quaternion.Euler(local_rot), Vector3.one); + Transform3D localCRSasFloat = new Transform3D + { + localCRS.m00, localCRS.m01, localCRS.m02, localCRS.m03, + localCRS.m10, localCRS.m11, localCRS.m12, localCRS.m13, + localCRS.m20, localCRS.m21, localCRS.m22, localCRS.m23, + localCRS.m30, localCRS.m31, localCRS.m32, localCRS.m33, + }; + trackable.LocalCRS = localCRSasFloat; + + Size localSizeAsFloat = new Size + { + local_size.x, local_size.y, local_size.z + }; + trackable.TrackableSize = localSizeAsFloat; + + if (SaveInfo.instance.nodePositions.ContainsKey(trackable.UUID.ToString()) && (!SaveInfo.instance.elemsToUpdate.Contains(trackable.UUID.ToString()))) + { + SaveInfo.instance.elemsToUpdate.Add(trackable.UUID.ToString()); + } + trackableNode.MarkUnsaved(); + } + + // + //FOOTER + // + GUILayout.FlexibleSpace(); + EditorGUILayout.BeginHorizontal(); + GUILayout.FlexibleSpace(); + + var originalColor = GUI.backgroundColor; + + //reload button + GUI.backgroundColor = Color.yellow; + if (GUILayout.Button("Reload")) + { + //lose focus of fields otherwise the selected field won't updaate + EditorGUI.FocusTextInControl(null); + if (SaveInfo.instance.nodePositions.ContainsKey(trackable.UUID.ToString())) + { + if (SaveInfo.instance.elemsToUpdate.Contains(trackable.UUID.ToString()) && EditorUtility.DisplayDialog("Reset elements", "Are you sure you want to lose all your changes ?", "Yes", "No")) + { + TrackableRequest.GetTrackableAsync(SaveInfo.instance.worldStorageServer, trackable.UUID, (response) => + { + trackable = response.result; + trackableNode.trackable = trackable; + ShowWindow(trackableNode); + }); + } + } + else + { + if (EditorUtility.DisplayDialog("Reset elements", "Are you sure you want to lose all your changes ?", "Yes", "No")) + { + //generate the Trackables's attributes + EncodingInformationStructure trackableEncodingInformation = new EncodingInformationStructure() + { + DataFormat = EncodingInformationStructureDataFormat.OTHER, + Version = "0" + }; + + Transform3D localCRS = new Transform3D(); + for (int i = 0; i < 15; i++) + { + localCRS.Add(0); + } + localCRS.Add(1); + + Size trackableSize = new Size(); + for (int i = 0; i < 3; i++) + { + trackableSize.Add(0); + } + + Trackable trackable = new Trackable("DefaultTrackable") + { + UUID = Guid.NewGuid(), + CreatorUUID = Guid.Parse(SaveInfo.instance.worldStorageUser.UUID), + TrackableType = TrackableType.OTHER, + TrackableEncodingInformation = trackableEncodingInformation, + TrackablePayload = new byte[64], + LocalCRS = localCRS, + Unit = UnitSystem.CM, + Confidence = 0, + TrackableSize = trackableSize, + KeyvalueTags = new KeyvalueTagList() + }; + trackableNode.trackable = trackable; + ShowWindow(trackableNode); + } + } + } + + //save button + GUI.backgroundColor = Color.green; + if (GUILayout.Button("Save")) + { + if (SaveInfo.instance.nodePositions.ContainsKey(trackable.UUID.ToString())) + { + if (SaveInfo.instance.elemsToUpdate.Contains(trackable.UUID.ToString())) + { + TrackableRequest.UpdateTrackableAsync(SaveInfo.instance.worldStorageServer, trackable, (response) => + { + SaveInfo.instance.elemsToUpdate.Remove(trackable.UUID.ToString()); + }); + } + } + else + { + var posX = new Collection(); + posX.Add(trackableNode.GetPosition().x.ToString()); + var posY = new Collection(); + posY.Add(trackableNode.GetPosition().y.ToString()); + Trackable trackable = trackableNode.trackable; + trackable.KeyvalueTags["unityAuthoringPosX"] = posX; + trackable.KeyvalueTags["unityAuthoringPosY"] = posY; + TrackableRequest.CreateTrackableAsync(SaveInfo.instance.worldStorageServer, trackable, (response) => + { + String uuid = response.result.Message; + + //change the uuid in its edges, if there is a new edge to be added in the world storage it needs to have the correct uuid + uuid = uuid.Replace("\"", ""); + foreach (ARFEdgeLink edge in trackableNode.portIn.connections) + { + edge.worldLink.UUIDTo = Guid.Parse(uuid); + } + foreach (ARFEdgeLink edge in trackableNode.portOut.connections) + { + edge.worldLink.UUIDFrom = Guid.Parse(uuid); + } + trackableNode.trackable.UUID = Guid.Parse(uuid); + trackableNode.GUID = uuid; + trackableNode.title = trackable.Name; + + //Add the newly saved Trackable to the SaveInfo singleton + Rect trackPos = new(trackableNode.GetPosition().x, trackableNode.GetPosition().y, 135, 77); + SaveInfo.instance.nodePositions[uuid] = trackPos; + }); + } + trackableNode.MarkSaved(); + } + GUILayout.Space(10); + EditorGUILayout.EndHorizontal(); + GUILayout.Space(10); + + GUI.backgroundColor = originalColor; + + + } + } + + private void BuildWorldLinkUI() + { + if (worldLink != null) + { + // + //HEADER + // + + //world link icon + EditorGUILayout.BeginHorizontal(); + Texture linkImage = (Texture)AssetDatabase.LoadAssetAtPath("Packages/etsi.isg.arf.worldstorage/Editor/Images/link.png", typeof(Texture)); + GUI.backgroundColor = WorldStorageWindow.arfColors[9]; + GUILayout.Box(linkImage, GUILayout.Width(40), GUILayout.Height(40)); + + //world link label + EditorGUILayout.BeginVertical(GUILayout.Height(50)); + GUILayout.FlexibleSpace(); + EditorGUILayout.LabelField("WORLD LINK", EditorStyles.boldLabel); + GUILayout.FlexibleSpace(); + EditorGUILayout.EndVertical(); + EditorGUILayout.EndHorizontal(); + + //separator line + var rect = EditorGUILayout.BeginHorizontal(GUILayout.Height(10)); + DrawUILine(new Color(0.66f, 0.39f, 1, 0.77f), 5, 5); + EditorGUILayout.EndHorizontal(); + + if (worldLinkEdge.contentContainer.Contains(worldLinkEdge.savedIcon)) + { + //the icon to add if the node does not correspond to an element in the server + Texture2D warningImage = (Texture2D)AssetDatabase.LoadAssetAtPath("Packages/etsi.isg.arf.worldstorage/Editor/Images/warning.png", typeof(Texture2D)); + + GUI.backgroundColor = Color.clear; + GUILayout.BeginHorizontal(); + GUILayout.Box(warningImage, GUILayout.Width(27), GUILayout.Height(27)); + GUILayout.Label("This element is not synchronized with the World Storage!", EditorStyles.whiteBoldLabel); + GUILayout.EndHorizontal(); + } + + //ELEMENT'S ATTRIBUTES + EditorGUI.BeginChangeCheck(); + + GUI.backgroundColor = Color.white; + + //uuid + EditorGUILayout.BeginHorizontal(); + EditorGUILayout.LabelField("UUID ", EditorStyles.boldLabel, GUILayout.Width(50)); + if (!SaveInfo.instance.linkIds.Contains(worldLink.UUID.ToString())) + { + EditorGUILayout.LabelField("None yet (element not yet saved in the server)"); + } + else + { + EditorGUILayout.SelectableLabel(worldLink.UUID.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight)); + } + EditorGUILayout.EndHorizontal(); + + //source element + EditorGUILayout.LabelField("Source Element (From element)", EditorStyles.boldLabel); + EditorGUILayout.BeginHorizontal(); + GUILayout.Space(50); + EditorGUILayout.LabelField("Name ", GUILayout.Width(75)); + EditorGUILayout.LabelField(worldLinkEdge.output.node.title); + EditorGUILayout.EndHorizontal(); + EditorGUILayout.BeginHorizontal(); + GUILayout.Space(50); + EditorGUILayout.LabelField("Type ", GUILayout.Width(75)); + EditorGUILayout.LabelField(worldLink.TypeFrom.ToString(), GUILayout.Width(80)); + EditorGUILayout.EndHorizontal(); + EditorGUILayout.BeginHorizontal(); + GUILayout.Space(50); + EditorGUILayout.LabelField("UUID ", GUILayout.Width(75)); + if (SaveInfo.instance.nodePositions.ContainsKey(worldLink.UUIDFrom.ToString())) + { + EditorGUILayout.LabelField(worldLink.UUIDFrom.ToString()); + } + else + { + EditorGUILayout.LabelField("no UUID yet (element not yet saved in the server)"); + } + EditorGUILayout.EndHorizontal(); + + //target element + EditorGUILayout.LabelField("Target Element (To element)", EditorStyles.boldLabel); + EditorGUILayout.BeginHorizontal(); + GUILayout.Space(50); + EditorGUILayout.LabelField("Name ", GUILayout.Width(70)); + EditorGUILayout.LabelField(worldLinkEdge.input.node.title); + EditorGUILayout.EndHorizontal(); + EditorGUILayout.BeginHorizontal(); + GUILayout.Space(50); + EditorGUILayout.LabelField("Type ", GUILayout.Width(70)); + EditorGUILayout.LabelField(worldLink.TypeTo.ToString(), GUILayout.Width(80)); + EditorGUILayout.EndHorizontal(); + EditorGUILayout.BeginHorizontal(); + GUILayout.Space(50); + EditorGUILayout.LabelField("UUID ", GUILayout.Width(70)); + if (SaveInfo.instance.nodePositions.ContainsKey(worldLink.UUIDTo.ToString())) + { + EditorGUILayout.LabelField(worldLink.UUIDTo.ToString()); + } + else + { + EditorGUILayout.LabelField("no UUID yet (element not yet saved in the server)"); + } + EditorGUILayout.EndHorizontal(); + + //unit system + EditorGUILayout.BeginHorizontal(); + EditorGUILayout.LabelField("Unit ", EditorStyles.boldLabel, GUILayout.Width(50)); + worldLink.Unit = (UnitSystem)EditorGUILayout.EnumPopup(worldLink.Unit); + EditorGUILayout.EndHorizontal(); + + //style for sublabels (right aligned) + var rightStyle = GUI.skin.GetStyle("Label"); + rightStyle.alignment = TextAnchor.UpperRight; + + //localCRS + EditorGUILayout.BeginHorizontal(); + EditorGUILayout.LabelField("3D Transform ", EditorStyles.boldLabel); + EditorGUILayout.EndHorizontal(); + //position + EditorGUILayout.BeginHorizontal(); + EditorGUILayout.LabelField("Position ", GUILayout.Width(60)); + EditorGUILayout.LabelField("X", rightStyle, GUILayout.Width(15)); + local_pos[0] = EditorGUILayout.DelayedFloatField(local_pos[0]); + EditorGUILayout.LabelField("Y", rightStyle, GUILayout.Width(15)); + local_pos[1] = EditorGUILayout.DelayedFloatField(local_pos[1]); + EditorGUILayout.LabelField("Z", rightStyle, GUILayout.Width(15)); + local_pos[2] = EditorGUILayout.DelayedFloatField(local_pos[2]); + EditorGUILayout.EndHorizontal(); + //rotation + EditorGUILayout.BeginHorizontal(); + EditorGUILayout.LabelField("Rotation ", GUILayout.Width(60)); + EditorGUILayout.LabelField("X", rightStyle, GUILayout.Width(15)); + local_rot[0] = EditorGUILayout.DelayedFloatField(local_rot[0]); + EditorGUILayout.LabelField("Y", rightStyle, GUILayout.Width(15)); + local_rot[1] = EditorGUILayout.DelayedFloatField(local_rot[1]); + EditorGUILayout.LabelField("Z", rightStyle, GUILayout.Width(15)); + local_rot[2] = EditorGUILayout.DelayedFloatField(local_rot[2]); + EditorGUILayout.EndHorizontal(); + + //Actions when the ui fields have been changed + if (EditorGUI.EndChangeCheck()) + { + // + Matrix4x4 localCRS = Matrix4x4.TRS(local_pos, Quaternion.Euler(local_rot), Vector3.one); + Transform3D localCRSasFloat = new Transform3D + { + localCRS.m00, localCRS.m01, localCRS.m02, localCRS.m03, + localCRS.m10, localCRS.m11, localCRS.m12, localCRS.m13, + localCRS.m20, localCRS.m21, localCRS.m22, localCRS.m23, + localCRS.m30, localCRS.m31, localCRS.m32, localCRS.m33, + }; + worldLink.Transform = localCRSasFloat; + + if (SaveInfo.instance.linkIds.Contains(worldLink.UUID.ToString()) && (!SaveInfo.instance.elemsToUpdate.Contains(worldLink.UUID.ToString()))) + { + SaveInfo.instance.elemsToUpdate.Add(worldLink.UUID.ToString()); + } + worldLinkEdge.MarkUnsaved(); + } + + // + //FOOTER + // + GUILayout.FlexibleSpace(); + EditorGUILayout.BeginHorizontal(); + GUILayout.FlexibleSpace(); + + var originalColor = GUI.backgroundColor; + + //reload button + GUI.backgroundColor = Color.yellow; + if (GUILayout.Button("Reload")) + { + //lose focus of fields otherwise the selected field won't updaate + EditorGUI.FocusTextInControl(null); + if (SaveInfo.instance.linkIds.Contains(worldLink.UUID.ToString())) + { + if (SaveInfo.instance.elemsToUpdate.Contains(worldLink.UUID.ToString()) && EditorUtility.DisplayDialog("Reset elements", "Are you sure you want to lose all your changes ?", "Yes", "No")) + { + WorldLinkRequest.GetWorldLinkAsync(SaveInfo.instance.worldStorageServer, worldLink.UUID, (response) => + { + worldLink = response.result; + worldLinkEdge.worldLink = worldLink; + ShowWindow(worldLinkEdge); + }); + } + } + else + { + if (EditorUtility.DisplayDialog("Reset elements", "Are you sure you want to lose all your changes ?", "Yes", "No")) + { + Transform3D transform = new Transform3D(); + for (int i = 0; i < 15; i++) + { + transform.Add(0); + } + transform.Add(1); + + worldLink.Transform = transform; + worldLink.Unit = UnitSystem.CM; + ShowWindow(worldLinkEdge); + } + } + } + + //save button + GUI.backgroundColor = Color.green; + if (GUILayout.Button("Save")) + { + //if one of the connected elements is not in the server, you can't save the link + if ((SaveInfo.instance.nodePositions.ContainsKey(worldLink.UUIDTo.ToString()) && SaveInfo.instance.nodePositions.ContainsKey(worldLink.UUIDFrom.ToString()))) + { + if (SaveInfo.instance.linkIds.Contains(worldLink.UUID.ToString())) + { + if (SaveInfo.instance.elemsToUpdate.Contains(worldLink.UUID.ToString())) + { + WorldLinkRequest.UpdateWorldLinkAsync(SaveInfo.instance.worldStorageServer, worldLink, (response) => + { + SaveInfo.instance.elemsToUpdate.Remove(worldLink.UUID.ToString()); + }); + } + } + else + { + WorldLinkRequest.CreateWorldLinkAsync(SaveInfo.instance.worldStorageServer, worldLink, (response) => + { + String uuid = response.result.Message; + + //Add the newly saved WorldLink to the SaveInfo singleton + uuid = uuid.Replace("\"", ""); + worldLink.UUID = Guid.Parse(uuid); + worldLinkEdge.GUID = uuid; + SaveInfo.instance.linkIds.Add(uuid); + }); + } + worldLinkEdge.MarkSaved(); + } + else + { + EditorUtility.DisplayDialog("Error", "You are not able to save this link because at least one of its connected elements is not saved in the World Storage", "Ok"); + } + } + GUILayout.Space(10); + EditorGUILayout.EndHorizontal(); + GUILayout.Space(10); + + } + } + + //utilty method to draw lines + public static void DrawUILine(Color color, int thickness = 2, int padding = 10) + { + Rect r = EditorGUILayout.GetControlRect(GUILayout.Height(padding + thickness)); + r.height = thickness; + r.y += padding / 2; + r.x -= 2; + r.width += 6; + EditorGUI.DrawRect(r, color); + } + + + + + } +} \ No newline at end of file diff --git a/Editor/Scripts/Windows/GraphEditorWindow.cs.meta b/Editor/Scripts/Windows/GraphEditorWindow.cs.meta new file mode 100644 index 0000000000000000000000000000000000000000..10797498c8160eb8e60e846ba012c764bd775c18 --- /dev/null +++ b/Editor/Scripts/Windows/GraphEditorWindow.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e219817d65c8b1f40ad85e6185e89e92 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Editor/Scripts/Windows/TrackableWindow.cs b/Editor/Scripts/Windows/TrackableWindow.cs new file mode 100644 index 0000000000000000000000000000000000000000..c5d8f57f09ff86f85a90884d2d5773b7604eaecf --- /dev/null +++ b/Editor/Scripts/Windows/TrackableWindow.cs @@ -0,0 +1,378 @@ +// +// ARF - Augmented Reality Framework (ETSI ISG ARF) +// +// Copyright 2024 ETSI +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Last change: June 2024 +// + +#define isDEBUG + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; + +using UnityEngine; +using UnityEditor; +using TMPro; + +using ETSI.ARF.WorldStorage.REST; +using ETSI.ARF.OpenAPI.WorldStorage; + +namespace ETSI.ARF.WorldStorage.UI +{ + public class TrackableWindow : BaseWindow + { + static public TrackableWindow winSingleton; + + // Trackable params + string UUID = System.Guid.Empty.ToString(); + string customName = "NotDefined"; + string creatorUUID = System.Guid.Empty.ToString(); + double confidence = 0f; + TrackableType type = TrackableType.OTHER; + UnitSystem unit = UnitSystem.CM; + Vector3 trackableSize; + Vector3 localCRS_pos; + Vector3 localCRS_rot; + byte[] trackablePayload = new byte[1] { 0 }; + + //graph params to generate the node + public bool useCoord; + public float nodePosX = 0; + public float nodePosY = 0; + + public TrackableWindow() + { + // init somne stuffs + } + + public static void ShowWindow(WorldStorageServer ws, WorldStorageUser user, string UUID = "") + { + winSingleton = EditorWindow.GetWindow(typeof(TrackableWindow), false, "ETSI ARF - Trackable") as TrackableWindow; + winSingleton.worldStorageServer = ws; + winSingleton.worldStorageUser = user; + if (!string.IsNullOrEmpty(UUID)) + { + winSingleton.saveText = "Update"; + winSingleton.UUID = UUID; + winSingleton.GetParams(); + } + else + { + // Create new one + winSingleton.saveText = "Create"; + winSingleton.AddObject(); + } + } + + public static GameObject GenerateAndUpdateVisual(string UUID, string name, Vector3 pos, Vector3 rot) + { + ETSI.ARF.WorldStorage.UI.Prefabs.WorldStoragePrefabs prefabs; + prefabs = (Prefabs.WorldStoragePrefabs)Resources.Load("ARFPrefabs"); + GameObject arf = GameObject.Find("ARF Visuals"); + GameObject visual = GameObject.Find(UUID); + + if (arf == null) arf = new GameObject("ARF Visuals"); + if (visual == null) + { + visual = SceneAsset.Instantiate(prefabs.trackablePrefab, pos, Quaternion.Euler(rot), arf.transform); // TODO rot + visual.name = UUID; + } + else + { + visual.transform.SetPositionAndRotation(pos, Quaternion.Euler(rot)); + } + visual.transform.Find("Canvas/Text").GetComponent().text = $"Name: { name }\nUUID: { UUID }"; + return visual; + } + + void OnGUI() + { + ori = GUI.backgroundColor; // remember ori color + + gsTest = new GUIStyle("window"); + //gsTest.normal.textColor = WorldStorageWindow.arfColors[0]; + gsTest.fontStyle = FontStyle.Bold; + gsTest.alignment = TextAnchor.UpperLeft; + gsTest.fontSize = 16; + + scrollPos = EditorGUILayout.BeginScrollView(scrollPos, GUILayout.ExpandWidth(true)); + WorldStorageWindow.DrawCopyright(); + + DrawUIStuffs(); + + EditorGUILayout.EndScrollView(); + + if (GUILayout.Button("Close Window")) + { + Close(); + } + } + + public override void DrawUIStuffs()// Trackable trackable) + { + GUILayout.BeginVertical(); // "Trackable Editor", gsTest); + EditorGUILayout.Space(); + + GUILayout.BeginHorizontal(); + GUI.backgroundColor = WorldStorageWindow.arfColors[7]; + Texture trackableImage = (Texture)AssetDatabase.LoadAssetAtPath("Packages/etsi.isg.arf.worldstorage/Editor/Images/trackable.png", typeof(Texture)); + GUILayout.Box(trackableImage, GUILayout.Width(24), GUILayout.Height(24)); + GUI.backgroundColor = ori; + GUILayout.Label("Trackable Parameters:", EditorStyles.whiteBoldLabel); + GUILayout.EndHorizontal(); + + Rect rect = EditorGUILayout.GetControlRect(false, WorldStorageWindow.lineH); + EditorGUI.DrawRect(rect, WorldStorageWindow.arfColors[7]); + + // + GUILayout.Label("Server: " + worldStorageServer.serverName, EditorStyles.whiteLargeLabel); + GUILayout.Label("User: " + worldStorageUser.userName, EditorStyles.whiteLargeLabel); + EditorGUILayout.Space(); + +#if isDEBUG + GUILayout.Label("UUID: " + UUID, EditorStyles.miniLabel); // readonly + GUILayout.Label("Creator UID: " + creatorUUID, EditorStyles.miniLabel); // readonly + EditorGUILayout.Space(); +#endif + customName = EditorGUILayout.TextField("Name of Trackable:", customName); + EditorGUILayout.Space(); + + // --------------------- + // Toolbar + // --------------------- + EditorGUILayout.BeginHorizontal(); + GUI.backgroundColor = WorldStorageWindow.arfColors[2]; + if (GUILayout.Button(saveText)) + { + Debug.Log("PUT Trackable"); + + if (!string.IsNullOrEmpty(UUID) && UUID != "0" && UUID != System.Guid.Empty.ToString()) + { + Trackable obj = GenerateObject(); + TrackableRequest.UpdateTrackableAsync(worldStorageServer, obj, (response) => + { + UUID = response.result.Message; + UUID = UUID.Trim('"'); //Bugfix: remove " from server return value + + if (WorldStorageWindow.WorldStorageWindowSingleton != null) + { + WorldStorageWindow.WorldStorageWindowSingleton.GetTrackables(); + } + Close(); + }); + } + } + + GUI.backgroundColor = WorldStorageWindow.arfColors[3]; + if (GUILayout.Button("Delete")) + { + if (EditorUtility.DisplayDialog("Delete", "Are you sure you want to delete this Trackable?", "Delete", "Cancel")) + { + Debug.Log("Delete Trackable"); + TrackableRequest.DeleteTrackableAsync(worldStorageServer, Guid.Parse(UUID), (response) => + { + UUID = System.Guid.Empty.ToString(); + customName = "Warning: Object deleted !"; + creatorUUID = System.Guid.Empty.ToString(); + confidence = 0f; + type = TrackableType.OTHER; + unit = UnitSystem.CM; + if (WorldStorageWindow.WorldStorageWindowSingleton != null) + { + WorldStorageWindow.WorldStorageWindowSingleton.GetTrackables(); + } + Close(); + }); + } + } + GUI.backgroundColor = ori; + + GUI.backgroundColor = WorldStorageWindow.arfColors[5]; + if (GUILayout.Button("Generate/Update GameObject")) + { + GenerateAndUpdateVisual(UUID, customName, localCRS_pos, localCRS_rot); + } + GUI.backgroundColor = ori; + EditorGUILayout.EndHorizontal(); + EditorGUILayout.Space(); + + // --------------------- + // Params + // --------------------- + type = (TrackableType)EditorGUILayout.EnumPopup("Trackable Type:", type); + unit = (UnitSystem)EditorGUILayout.EnumPopup("Unit System:", unit); + confidence = EditorGUILayout.DoubleField("Confidence:", confidence); + + EditorGUILayout.Space(); + GUILayout.Label("Transform (local CRS):"); + localCRS_pos = EditorGUILayout.Vector3Field(" Position:", localCRS_pos); + localCRS_rot = EditorGUILayout.Vector3Field(" Rotation:", localCRS_rot); + + EditorGUILayout.Space(); + trackableSize = EditorGUILayout.Vector3Field("Trackable Size:", trackableSize); + + EditorGUILayout.Space(); + if (GUILayout.Button("Generate Dummy Payload")) + { + // dummy + trackablePayload = new byte[100]; + for (int i = 0; i < trackablePayload.Length; i++) + { + trackablePayload[i] = (byte)i; + } + } + + // --------------------- + // Keyvalues + // --------------------- + EditorGUILayout.Space(); + groupEnabled = EditorGUILayout.BeginToggleGroup("Optional Parameters:", groupEnabled); + if (keyValuesFixed.Count > 0) + { + OutputKeyValue(0); + OutputKeyValue(1); + OutputKeyValue(2); + } + EditorGUILayout.EndToggleGroup(); + // + GUILayout.EndVertical(); + } + + public override void GetParams() + { + //customName = "Requesting information..."; + TrackableRequest.GetTrackableAsync(worldStorageServer, Guid.Parse(UUID), (response) => + { + Trackable obj = response.result; + customName = obj.Name; + Debug.Log("name=" + customName); + creatorUUID = obj.CreatorUUID.ToString(); + type = obj.TrackableType; + unit = obj.Unit; + confidence = obj.Confidence; + if (obj.TrackableSize.Count == 3) + { + trackableSize = new Vector3((float)obj.TrackableSize[0], (float)obj.TrackableSize[1], (float)obj.TrackableSize[2]); + } + else trackableSize = Vector3.zero; + + if (obj.LocalCRS.Count == 16) + { + Matrix4x4 localCRS = WorldStorageUnityHelper.ConvertETSIARFTransform3DToUnity(obj.LocalCRS); + localCRS_pos = localCRS.GetPosition(); + localCRS_rot = localCRS.rotation.eulerAngles; + } + else + { + localCRS_pos = Vector3.zero; + localCRS_rot = Vector3.zero; + } + + // --------------------- + // Keyvalues + // --------------------- + //var first = WorldStorageWindow.GetFirstKeyValueTags(obj.KeyvalueTags); + //keyValuesFixed.Clear(); // no + for (int i = 0; i < keyValuesFixed.Count; i++) keyValuesFixed[i] = ("", ""); + + if (obj.KeyvalueTags.Count > 0) + { + int cnt = 0; + foreach (var item in obj.KeyvalueTags) + { + if (item.Key == "unityAuthoringPosX" || item.Key == "unityAuthoringPosY") continue; // ignore internal params + if (cnt < keyValuesFixed.Count) keyValuesFixed[cnt] = (item.Key, item.Value[0]); + cnt++; + } + } + repaint = true; + }); + } + + public override void AddObject() + { + Debug.Log("POST Trackable"); + UUID = System.Guid.Empty.ToString(); + customName = "Default Trackable"; + + Trackable obj = GenerateObject(); + TrackableRequest.CreateTrackableAsync(worldStorageServer, obj, (response) => + { + UUID = response.result.Message; + UUID = UUID.Trim('"'); //Bugfix: remove " from server return value + WorldStorageWindow.WorldStorageWindowSingleton.GetTrackables(); + }); + } + + public override Trackable GenerateObject() + { + EncodingInformationStructure trackableEncodingInformation = new EncodingInformationStructure() + { + DataFormat = EncodingInformationStructureDataFormat.ARCORE, + Version = "1.0" + }; + Debug.Log("Created encoding information"); + + Size _trackableSize = new Size(); + + _trackableSize.Add(trackableSize.x); + _trackableSize.Add(trackableSize.y); + _trackableSize.Add(trackableSize.z); + Debug.Log("Created dimension"); + + Matrix4x4 localCRS = new Matrix4x4(); + localCRS = Matrix4x4.TRS(localCRS_pos, Quaternion.Euler(localCRS_rot), Vector3.one); + Transform3D _localCRS = WorldStorageUnityHelper.ConvertUnityToETSIARFTransform3D(localCRS); + + // Remember the position of the Unity graph node + var posX = new Collection(); + posX.Add(nodePosX.ToString()); + var posY = new Collection(); + posY.Add(nodePosY.ToString()); + + // --------------------- + // Keyvalues + // --------------------- + keyValueTags.Clear(); + keyValueTags.Add("unityAuthoringPosX", posX); + keyValueTags.Add("unityAuthoringPosY", posY); + if (keyValuesFixed.Count > 0) + foreach (var item in keyValuesFixed) + { + if (!string.IsNullOrEmpty(item.Item1)) keyValueTags.Add(item.Item1, new Collection { item.Item2 }); + } + + System.Guid _uuid = System.Guid.Parse(UUID); + System.Guid _creator = System.Guid.Parse(worldStorageUser.UUID); + Trackable t = new Trackable(customName) + { + UUID = _uuid, + CreatorUUID = _creator, + TrackableType = type, + TrackableEncodingInformation = trackableEncodingInformation, + TrackablePayload = trackablePayload, + LocalCRS = _localCRS, + Unit = unit, + Confidence = confidence, + TrackableSize = _trackableSize, + KeyvalueTags = keyValueTags + }; + return t; + } + } +} \ No newline at end of file diff --git a/Editor/Scripts/Windows/TrackableWindow.cs.meta b/Editor/Scripts/Windows/TrackableWindow.cs.meta new file mode 100644 index 0000000000000000000000000000000000000000..020c2af305925803868dbb5f22c964e5176c8f49 --- /dev/null +++ b/Editor/Scripts/Windows/TrackableWindow.cs.meta @@ -0,0 +1,14 @@ +fileFormatVersion: 2 +guid: 229d5ea484d30f945b9318581fb4f2da +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: + - m_ViewDataDictionary: {instanceID: 0} + - worldStorageServer: {fileID: 11400000, guid: 4f997253243de534dad12937f1284975, type: 2} + - worldStorageUser: {instanceID: 0} + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Editor/Scripts/Windows/WorldAnchorWindow.cs b/Editor/Scripts/Windows/WorldAnchorWindow.cs new file mode 100644 index 0000000000000000000000000000000000000000..a612081dd318cc496026bde4fa23789468ab3eb1 --- /dev/null +++ b/Editor/Scripts/Windows/WorldAnchorWindow.cs @@ -0,0 +1,345 @@ +// +// ARF - Augmented Reality Framework (ETSI ISG ARF) +// +// Copyright 2024 ETSI +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Last change: June 2024 +// + +#define isDEBUG + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; + +using UnityEngine; +using UnityEditor; +using TMPro; + +using ETSI.ARF.WorldStorage.REST; +using ETSI.ARF.OpenAPI.WorldStorage; + +namespace ETSI.ARF.WorldStorage.UI +{ + public class WorldAnchorWindow : BaseWindow + { + static public WorldAnchorWindow winSingleton; + + // World Anchors params + string UUID = System.Guid.Empty.ToString(); + string customName = "NotDefined"; + string creatorUUID = System.Guid.Empty.ToString(); + UnitSystem unit = UnitSystem.CM; + Vector3 worldAnchorSize; + Vector3 localCRS_pos; + Vector3 localCRS_rot; + + //graph params to generate the node + public bool useCoord; + public float nodePosX = 0; + public float nodePosY = 0; + + public WorldAnchorWindow() + { + // init somne stuffs + } + + public static void ShowWindow(WorldStorageServer ws, WorldStorageUser user, string UUID = "") + { + winSingleton = EditorWindow.GetWindow(typeof(WorldAnchorWindow), false, "ETSI ARF - World Anchor") as WorldAnchorWindow; + winSingleton.worldStorageServer = ws; + winSingleton.worldStorageUser = user; + if (!string.IsNullOrEmpty(UUID)) + { + winSingleton.saveText = "Update"; + winSingleton.UUID = UUID; + winSingleton.GetParams(); + } + else + { + // Create new one + winSingleton.saveText = "Create"; + winSingleton.AddObject(); + } + } + + public static GameObject GenerateAndUpdateVisual(string UUID, string name, Vector3 pos, Vector3 rot) + { + ETSI.ARF.WorldStorage.UI.Prefabs.WorldStoragePrefabs prefabs; + prefabs = (Prefabs.WorldStoragePrefabs)Resources.Load("ARFPrefabs"); + GameObject arf = GameObject.Find("ARF Visuals"); + GameObject visual = GameObject.Find(UUID); + + if (arf == null) arf = new GameObject("ARF Visuals"); + if (visual == null) + { + visual = SceneAsset.Instantiate(prefabs.worldAnchorPrefab, pos, Quaternion.Euler(rot), arf.transform); // TODO rot + visual.name = UUID; + } + else + { + visual.transform.SetPositionAndRotation(pos, Quaternion.Euler(rot)); + } + visual.transform.Find("Canvas/Text").GetComponent().text = $"Name: { name }\nUUID: { UUID }"; + return visual; + } + + void OnGUI() + { + ori = GUI.backgroundColor; // remember ori color + + gsTest = new GUIStyle("window"); + //gsTest.normal.textColor = WorldStorageWindow.arfColors[0]; + gsTest.fontStyle = FontStyle.Bold; + gsTest.alignment = TextAnchor.UpperLeft; + gsTest.fontSize = 16; + + scrollPos = EditorGUILayout.BeginScrollView(scrollPos, GUILayout.ExpandWidth(true)); + WorldStorageWindow.DrawCopyright(); + + DrawUIStuffs(); + + EditorGUILayout.EndScrollView(); + + if (GUILayout.Button("Close Window")) + { + Close(); + } + } + + public override void DrawUIStuffs() + { + GUILayout.BeginVertical(); // "World Anchor Editor", gsTest); + EditorGUILayout.Space(); + + GUILayout.BeginHorizontal(); + GUI.backgroundColor = WorldStorageWindow.arfColors[8]; + Texture anchorImage = (Texture)AssetDatabase.LoadAssetAtPath("Packages/etsi.isg.arf.worldstorage/Editor/Images/anchor.png", typeof(Texture)); + GUILayout.Box(anchorImage, GUILayout.Width(24), GUILayout.Height(24)); + GUI.backgroundColor = ori; + GUILayout.Label("World Anchor Parameters:", EditorStyles.whiteBoldLabel); + GUILayout.EndHorizontal(); + + Rect rect = EditorGUILayout.GetControlRect(false, WorldStorageWindow.lineH); + EditorGUI.DrawRect(rect, WorldStorageWindow.arfColors[8]); + + // + GUILayout.Label("Server: " + worldStorageServer.serverName, EditorStyles.whiteLargeLabel); + GUILayout.Label("User: " + worldStorageUser.userName, EditorStyles.whiteLargeLabel); + EditorGUILayout.Space(); + +#if isDEBUG + GUILayout.Label("UUID: " + UUID, EditorStyles.miniLabel); // readonly + GUILayout.Label("Creator UID: " + creatorUUID, EditorStyles.miniLabel); // readonly + EditorGUILayout.Space(); +#endif + customName = EditorGUILayout.TextField("Name of Anchor:", customName); + EditorGUILayout.Space(); + + // --------------------- + // Toolbar + // --------------------- + EditorGUILayout.BeginHorizontal(); + GUI.backgroundColor = WorldStorageWindow.arfColors[2]; + if (GUILayout.Button(saveText)) + { + Debug.Log("PUT World Anchor"); + + if (!string.IsNullOrEmpty(UUID) && UUID != "0" && UUID != System.Guid.Empty.ToString()) + { + WorldAnchor obj = GenerateObject(); + WorldAnchorRequest.UpdateWorldAnchorAsync(worldStorageServer, obj, (response) => + { + UUID = response.result.Message; + UUID = UUID.Trim('"'); //Bugfix: remove " from server return value + + if (WorldStorageWindow.WorldStorageWindowSingleton != null) + { + WorldStorageWindow.WorldStorageWindowSingleton.GetWorldAnchors(); + } + Close(); + }); + } + } + + GUI.backgroundColor = WorldStorageWindow.arfColors[3]; + if (GUILayout.Button("Delete")) + { + if (EditorUtility.DisplayDialog("Delete", "Are you sure you want to delete this World Anchor?", "Delete", "Cancel")) + { + Debug.Log("Delete World Anchor"); + WorldAnchorRequest.DeleteWorldAnchorAsync(worldStorageServer, Guid.Parse(UUID), (response) => + { + UUID = System.Guid.Empty.ToString(); + customName = "Warning: Object deleted !"; + creatorUUID = System.Guid.Empty.ToString(); + unit = UnitSystem.CM; + if (WorldStorageWindow.WorldStorageWindowSingleton != null) + { + WorldStorageWindow.WorldStorageWindowSingleton.GetWorldAnchors(); + } + Close(); + }); + } + } + GUI.backgroundColor = ori; + + GUI.backgroundColor = WorldStorageWindow.arfColors[5]; + if (GUILayout.Button("Generate/Update GameObject")) + { + GenerateAndUpdateVisual(UUID, customName, localCRS_pos, localCRS_rot); + } + GUI.backgroundColor = ori; + EditorGUILayout.EndHorizontal(); + EditorGUILayout.Space(); + + // --------------------- + // Params + // --------------------- + unit = (UnitSystem)EditorGUILayout.EnumPopup("Unit System:", unit); + + EditorGUILayout.Space(); + GUILayout.Label("Transform (local CRS):"); + localCRS_pos = EditorGUILayout.Vector3Field(" Position:", localCRS_pos); + localCRS_rot = EditorGUILayout.Vector3Field(" Rotation:", localCRS_rot); + + EditorGUILayout.Space(); + worldAnchorSize = EditorGUILayout.Vector3Field("Anchor Size:", worldAnchorSize); + + // --------------------- + // Keyvalues + // --------------------- + EditorGUILayout.Space(); + groupEnabled = EditorGUILayout.BeginToggleGroup("Optional Parameters:", groupEnabled); + if (keyValuesFixed.Count > 0) + { + OutputKeyValue(0); + OutputKeyValue(1); + OutputKeyValue(2); + } + EditorGUILayout.EndToggleGroup(); + // + GUILayout.EndVertical(); + } + + public override void GetParams() + { + //customName = "Requesting information..."; + WorldAnchorRequest.GetWorldAnchorAsync(worldStorageServer, Guid.Parse(UUID), (response) => + { + WorldAnchor obj = response.result; + customName = obj.Name; + creatorUUID = obj.CreatorUUID.ToString(); + unit = obj.Unit; + if (obj.WorldAnchorSize.Count == 3) + { + worldAnchorSize = new Vector3((float)obj.WorldAnchorSize[0], (float)obj.WorldAnchorSize[1], (float)obj.WorldAnchorSize[2]); + } + else worldAnchorSize = Vector3.zero; + + if (obj.LocalCRS.Count == 16) + { + Matrix4x4 localCRS = WorldStorageUnityHelper.ConvertETSIARFTransform3DToUnity(obj.LocalCRS); + localCRS_pos = localCRS.GetPosition(); + localCRS_rot = localCRS.rotation.eulerAngles; + } + else + { + localCRS_pos = Vector3.zero; + localCRS_rot = Vector3.zero; + } + + // --------------------- + // Keyvalues + // --------------------- + //var first = WorldStorageWindow.GetFirstKeyValueTags(obj.KeyvalueTags); + //keyValuesFixed.Clear(); // no + for (int i = 0; i < keyValuesFixed.Count; i++) keyValuesFixed[i] = ("", ""); + + if (obj.KeyvalueTags.Count > 0) + { + int cnt = 0; + foreach (var item in obj.KeyvalueTags) + { + if (item.Key == "unityAuthoringPosX" || item.Key == "unityAuthoringPosY") continue; // ignore internal params + if (cnt < keyValuesFixed.Count) keyValuesFixed[cnt] = (item.Key, item.Value[0]); + cnt++; + } + } + repaint = true; + }); + } + + public override void AddObject() + { + Debug.Log("POST World Anchor"); + UUID = System.Guid.Empty.ToString(); + customName = "Default Anchor"; + + WorldAnchor obj = GenerateObject(); + WorldAnchorRequest.CreateWorldAnchorAsync(worldStorageServer, obj, (response) => + { + UUID = response.result.Message; + UUID = UUID.Trim('"'); //Bugfix: remove " from server return value + WorldStorageWindow.WorldStorageWindowSingleton.GetWorldAnchors(); + }); + } + + public override WorldAnchor GenerateObject() + { + Size _worldAnchorSize = new Size(); + _worldAnchorSize.Add(worldAnchorSize.x); + _worldAnchorSize.Add(worldAnchorSize.y); + _worldAnchorSize.Add(worldAnchorSize.z); + Debug.Log("Created dimension"); + + Matrix4x4 localCRS = new Matrix4x4(); + localCRS = Matrix4x4.TRS(localCRS_pos, Quaternion.Euler(localCRS_rot), Vector3.one); + Transform3D _localCRS = WorldStorageUnityHelper.ConvertUnityToETSIARFTransform3D(localCRS); + + // Remember the position of the Unity graph node + var posX = new Collection(); + posX.Add(nodePosX.ToString()); + var posY = new Collection(); + posY.Add(nodePosY.ToString()); + + // --------------------- + // Keyvalues + // --------------------- + keyValueTags.Clear(); + keyValueTags.Add("unityAuthoringPosX", posX); + keyValueTags.Add("unityAuthoringPosY", posY); + if (keyValuesFixed.Count > 0) + foreach (var item in keyValuesFixed) + { + if (!string.IsNullOrEmpty(item.Item1)) keyValueTags.Add(item.Item1, new Collection { item.Item2 }); + } + + Guid _uuid = Guid.Parse(UUID); + Guid _creator = Guid.Parse(worldStorageUser.UUID); + WorldAnchor t = new WorldAnchor(customName) + { + UUID = _uuid, + CreatorUUID = _creator, + LocalCRS = _localCRS, + Unit = unit, + WorldAnchorSize = _worldAnchorSize, + KeyvalueTags = keyValueTags + }; + return t; + } + } +} \ No newline at end of file diff --git a/Editor/Scripts/Windows/WorldAnchorWindow.cs.meta b/Editor/Scripts/Windows/WorldAnchorWindow.cs.meta new file mode 100644 index 0000000000000000000000000000000000000000..c4ffaff830a063cc1184c01ac8c139ab428aebf3 --- /dev/null +++ b/Editor/Scripts/Windows/WorldAnchorWindow.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a0f67f823dd6ff246be6c656b120756e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Editor/Scripts/Windows/WorldGraphWindow.cs b/Editor/Scripts/Windows/WorldGraphWindow.cs new file mode 100644 index 0000000000000000000000000000000000000000..02a81dbb30f139d615e6102e8b935db65c771375 --- /dev/null +++ b/Editor/Scripts/Windows/WorldGraphWindow.cs @@ -0,0 +1,303 @@ +// +// ARF - Augmented Reality Framework (ETSI ISG ARF) +// +// Copyright 2024 ETSI +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Last change: July 2022 +// + +using System; +using System.Collections.Generic; + +using UnityEditor; +using UnityEditor.Experimental.GraphView; +using UnityEditor.UIElements; +using UnityEngine; +using UnityEngine.UIElements; + +using ETSI.ARF.WorldStorage.Editor.Graph; +using ETSI.ARF.WorldStorage; +using ETSI.ARF.WorldStorage.REST; +using ETSI.ARF.WorldStorage.UI; +using ETSI.ARF.OpenAPI.WorldStorage; + +namespace ETSI.ARF.WorldStorage.Editor.Windows +{ + public class WorldGraphWindow : EditorWindow + { + [HideInInspector] public WorldStorageServer worldStorageServer; + [HideInInspector] public WorldStorageUser worldStorageUser; + + private ARFGraphView myGraph; + + //to delay the reframe (otherwise it reframes when the graph isn't built yet) + int twoFrames = 0; + + [MenuItem("ARFWorldStorage/Edit Graph...")] + public static void ShowWindow() + { + GetWindow("Graph Editor", true, typeof(SceneView)); + } + + public static void ShowWindowFromWorldStorageWindow(WorldStorageServer server, WorldStorageUser user) + { + var window = GetWindow("Graph Editor", true, typeof(SceneView)); + window.worldStorageServer = server; + window.worldStorageUser = user; + if (window.myGraph != null) + { + if (window.myGraph.ServerAndLocalDifferent() && EditorUtility.DisplayDialog("Saving node positions", "The World Graph has been modified. \nWould you like to push the modifications to the server ?", "Yes", "No")) + { + window.myGraph.SaveInServer(); + } + window.rootVisualElement.Remove(window.myGraph); + } + GraphEditorWindow.ResetWindow(); + SaveInfo.instance.nodePositions = null; + window.OnEnable(); + } + + public void OnEnable() + { + if (worldStorageServer != null) + { + try + { + if (SaveInfo.instance.nodePositions == null) + { + SaveInfo.instance.InitNodePos(worldStorageServer, worldStorageUser); + } + ConstructGraphView(); + myGraph.style.top = Length.Percent(11); + myGraph.style.bottom = Length.Percent(5); + rootVisualElement.Add(myGraph); + } + catch (Exception e) + { + EditorUtility.DisplayDialog("Error", "The server you selected is unreachable", "Ok"); + myGraph = null; + Debug.Log(e.ToString()); + } + } + } + + //initiate the graphView Attribute + public void ConstructGraphView() + { + myGraph = new ARFGraphView + { + name = "ARF Graph", + worldStorageServer = worldStorageServer, + worldStorageUser = worldStorageUser + }; + //top offset so that the graph does'nt overlap with the rest of the ui + myGraph.style.top = Length.Percent(11); + myGraph.PaintWorldStorage(); + myGraph.StretchToParentSize(); + SaveInfo.instance.toReFrame = true; + } + + + void OnGUI() + { + if (SaveInfo.instance.nodePositions == null) + { + SaveInfo.instance.InitNodePos(worldStorageServer, worldStorageUser); + } + + + EditorGUILayout.BeginVertical(); + + EditorGUI.BeginChangeCheck(); + worldStorageServer = (WorldStorageServer)EditorGUILayout.ObjectField("World Storage Server", worldStorageServer, typeof(WorldStorageServer), false, GUILayout.Width(500)); + worldStorageUser = (WorldStorageUser)EditorGUILayout.ObjectField("User", worldStorageUser, typeof(WorldStorageUser), false, GUILayout.Width(500)); + if (EditorGUI.EndChangeCheck()) + { + GraphEditorWindow.ResetWindow(); + + if ((myGraph != null)) + { + if (myGraph.ServerAndLocalDifferent() && EditorUtility.DisplayDialog("Saving node positions", "The World Graph has been modified. \nWould you like to push the modifications to the server ?", "Yes", "No")) + { + myGraph.SaveInServer(); + } + rootVisualElement.Remove(myGraph); + } + if (worldStorageServer != null) + { + try + { + SaveInfo.instance.InitNodePos(worldStorageServer, worldStorageUser); + ConstructGraphView(); + myGraph.style.top = Length.Percent(11); + myGraph.style.bottom = Length.Percent(5); + rootVisualElement.Add(myGraph); + Debug.Log("World Graph window initialized."); + } + catch (Exception e) + { + EditorUtility.DisplayDialog("Error", "The server you selected is unreachable", "Ok"); + myGraph = null; + Debug.Log(e.ToString()); + } + } + else + { + myGraph = null; + } + } + + + //style for copyrights label (left aligned) + var leftStyle = GUI.skin.GetStyle("Label"); + leftStyle.alignment = TextAnchor.MiddleLeft; + + GUILayout.Label("Augmented Reality Framework", leftStyle); + GUILayout.Label("Copyright (C) 2024, ETSI (BSD 3-Clause License)", leftStyle); + + //separator line + Rect rect = EditorGUILayout.GetControlRect(false, 1); + EditorGUI.DrawRect(rect, Color.gray); + + //reframe all elements to see them all + if (SaveInfo.instance.toReFrame && (twoFrames == 2)) + { + myGraph.FrameAllElements(); + SaveInfo.instance.toReFrame = false; + twoFrames = 0; + } + else if (SaveInfo.instance.toReFrame) + { + twoFrames++; + } + EditorGUILayout.EndVertical(); + + GUILayout.FlexibleSpace(); + + //Notify the user that the graph is different from the one in the server + if (myGraph != null) + { + if (myGraph.ServerAndLocalDifferent()) + { + //the icon to add if the node does not correspond to an element in the server + Texture2D warningImage = (Texture2D)AssetDatabase.LoadAssetAtPath("Packages/etsi.isg.arf.worldstorage/Editor/Images/warning.png", typeof(Texture2D)); + + GUI.backgroundColor = Color.clear; + GUILayout.BeginHorizontal(); + GUILayout.Box(warningImage, GUILayout.Width(27), GUILayout.Height(27)); + GUILayout.Box("There are elements in your graph that have been added, modified or deleted ! The current graph is not synchronized with the World Storage", leftStyle, GUILayout.ExpandWidth(true), GUILayout.Height(27)); + GUILayout.EndHorizontal(); + } + } + } + + public void DeleteNode(ARFNode node) + { + rootVisualElement.Remove(myGraph); + node.DisconnectAllPorts(myGraph); + myGraph.DeleteElements(new List { node }); + rootVisualElement.Add(myGraph); + } + + public void DeleteEdge(ARFEdgeLink edge) + { + rootVisualElement.Remove(myGraph); + myGraph.DeleteElements(new List { edge }); + rootVisualElement.Add(myGraph); + } + } + + public class SaveInfo : ScriptableSingleton + { + [SerializeField] + public Dictionary nodePositions; + public List linkIds; + + public Dictionary elemsToRemove; + public List elemsToUpdate; + + //keep the info of the graph reframe + public Boolean toReFrame = false; + + public WorldStorageServer worldStorageServer; + public WorldStorageUser worldStorageUser; + + public void InitNodePos(WorldStorageServer server, WorldStorageUser user) + { + worldStorageServer = server; + worldStorageUser = user; + + instance.nodePositions = new Dictionary(); + + List listT = TrackableRequest.GetTrackablesSync(worldStorageServer); + foreach (Trackable track in listT) + { + if (track.KeyvalueTags.ContainsKey("unityAuthoringPosX") && track.KeyvalueTags.ContainsKey("unityAuthoringPosY")) + { + var posX = RoundToNearestHalf(WorldStorageRequest.FloatParse(track.KeyvalueTags["unityAuthoringPosX"][0])); + var posY = RoundToNearestHalf(WorldStorageRequest.FloatParse(track.KeyvalueTags["unityAuthoringPosY"][0])); + Rect trackPos = new(posX, posY, 135, 77); + instance.nodePositions[track.UUID.ToString()] = trackPos; + } + else + { + Rect trackPos = new(0, 0, 135, 77); + instance.nodePositions[track.UUID.ToString()] = trackPos; + } + } + + List listA = WorldAnchorRequest.GetWorldAnchorsSync(worldStorageServer); + foreach (WorldAnchor wa in listA) + { + if (wa.KeyvalueTags.ContainsKey("unityAuthoringPosX") && wa.KeyvalueTags.ContainsKey("unityAuthoringPosY")) + { + var posX = RoundToNearestHalf(WorldStorageRequest.FloatParse(wa.KeyvalueTags["unityAuthoringPosX"][0])); + var posY = RoundToNearestHalf(WorldStorageRequest.FloatParse(wa.KeyvalueTags["unityAuthoringPosY"][0])); + Rect waPos = new(posX, posY, 135, 77); + instance.nodePositions[wa.UUID.ToString()] = waPos; + } + else + { + Rect trackPos = new(0, 0, 135, 77); + instance.nodePositions[wa.UUID.ToString()] = trackPos; + } + } + + + instance.linkIds = new List(); + List listWL = WorldLinkRequest.GetWorldLinksSync(worldStorageServer); + foreach (WorldLink link in listWL) + { + instance.linkIds.Add(link.UUID.ToString()); + } + + instance.elemsToRemove = new Dictionary(); + instance.elemsToUpdate = new List(); + } + + //method to predict the position of a node (the float that will be saved in the PositionInfo singleton) + public static float RoundToNearestHalf(float a) + { + return a = Mathf.Round(a * 2f) * 0.5f; + } + + public static void PrintInfo() + { + Debug.Log("elems to delete : " + string.Join(", ", instance.elemsToRemove.Keys)); + Debug.Log("elems to update : " + string.Join(", ", instance.elemsToUpdate)); + Debug.Log("elems tout court : " + string.Join(", ", instance.nodePositions.Keys)); + } + } +} \ No newline at end of file diff --git a/Editor/Scripts/Windows/WorldGraphWindow.cs.meta b/Editor/Scripts/Windows/WorldGraphWindow.cs.meta new file mode 100644 index 0000000000000000000000000000000000000000..add62927e11e960a03f3343413c056b51ab7b98d --- /dev/null +++ b/Editor/Scripts/Windows/WorldGraphWindow.cs.meta @@ -0,0 +1,14 @@ +fileFormatVersion: 2 +guid: 2c1a0c92306453d46897c1af6cb5c2f9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: + - m_ViewDataDictionary: {instanceID: 0} + - worldStorageServer: {instanceID: 0} + - worldStorageUser: {fileID: 11400000, guid: c0696089e4a855b46ad490437919b1e8, type: 2} + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Editor/Scripts/Windows/WorldLinkWindow.cs b/Editor/Scripts/Windows/WorldLinkWindow.cs new file mode 100644 index 0000000000000000000000000000000000000000..99cf17f9b3eb06cee63f0af2ab8a6735305eac3d --- /dev/null +++ b/Editor/Scripts/Windows/WorldLinkWindow.cs @@ -0,0 +1,517 @@ +// +// ARF - Augmented Reality Framework (ETSI ISG ARF) +// +// Copyright 2024 ETSI +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Last change: June 2024 +// + +#define isDEBUG + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; + +using UnityEngine; +using UnityEditor; +using TMPro; + +using ETSI.ARF.WorldStorage.REST; +using ETSI.ARF.OpenAPI.WorldStorage; + +namespace ETSI.ARF.WorldStorage.UI +{ + public class WorldLinkWindow : BaseWindow + { + static public WorldLinkWindow winSingleton; + + public class Element + { + public string UUID = System.Guid.Empty.ToString(); + public string name = "(none)"; + public TypeWorldStorage type = TypeWorldStorage.UNKNOWN; + public Vector3 pos = Vector3.zero; + } + + [SerializeField] public List anchors = new List(); + + private static GUILayoutOption miniButtonWidth = GUILayout.Width(50); + private static GUILayoutOption middleButtonWidth = GUILayout.Width(70); + + // World Anchors params + string UUID = System.Guid.Empty.ToString(); + string customName = "(no name for World Links)"; + string creatorUUID = System.Guid.Empty.ToString(); + + // From & To elements: + private bool showListFrom = true; + private bool showListTo = true; + private Element FROM = new Element(); + private Element TO = new Element(); + + UnitSystem unit = UnitSystem.CM; + Vector3 transf_pos; + Vector3 transf_rot; + + public WorldLinkWindow() + { + // init somne stuffs + } + + public static void ShowWindow(WorldStorageServer ws, WorldStorageUser user, string UUID = "") + { + winSingleton = EditorWindow.GetWindow(typeof(WorldLinkWindow), false, "ETSI ARF - World Link") as WorldLinkWindow; + winSingleton.worldStorageServer = ws; + winSingleton.worldStorageUser = user; + if (!string.IsNullOrEmpty(UUID)) + { + winSingleton.saveText = "Update"; + winSingleton.UUID = UUID; + winSingleton.GetParams(); + } + else + { + // Create new one + winSingleton.saveText = "Create"; + winSingleton.AddObject(); + } + } + + public static GameObject GenerateAndUpdateVisual(string UUID, Element from, Element to) + { + ETSI.ARF.WorldStorage.UI.Prefabs.WorldStoragePrefabs prefabs; + prefabs = (Prefabs.WorldStoragePrefabs)Resources.Load("ARFPrefabs"); + GameObject arf = GameObject.Find("ARF Visuals"); + GameObject visual = GameObject.Find(UUID); + + //Value between from and to + Vector3 centerPos = (from.pos + to.pos) * 0.5f; + Vector3 rot = Vector3.zero; // Direction + + if (arf == null) arf = new GameObject("ARF Visuals"); + if (visual == null) + { + visual = SceneAsset.Instantiate(prefabs.worldLinkPrefab, centerPos, Quaternion.Euler(rot), arf.transform); // TODO rot + visual.name = UUID; + } + else + { + visual.transform.SetPositionAndRotation(centerPos, Quaternion.Euler(rot)); + } + + // Update the gizno, if GaneObject are founds!!! + GameObject go1 = GameObject.Find(from.UUID); + GameObject go2 = GameObject.Find(to.UUID); + if (go1 && go2) + { + LinkVisual gizmo = visual.GetComponent(); + if (gizmo) + { + gizmo.fromElement = go1; + gizmo.toElement = go2; + } + } + + // Update the annotation + visual.transform.Find("Canvas/Text").GetComponent().text = $"UUID: { UUID }\nFrom: { from.name }\nTo: { to.name }"; + return visual; + } + + + void OnGUI() + { + ori = GUI.backgroundColor; // remember ori color + + gsTest = new GUIStyle("window"); + //gsTest.normal.textColor = WorldStorageWindow.arfColors[0]; + gsTest.fontStyle = FontStyle.Bold; + gsTest.alignment = TextAnchor.UpperLeft; + gsTest.fontSize = 16; + gsTest.fixedHeight = 100; + + scrollPos = EditorGUILayout.BeginScrollView(scrollPos, GUILayout.ExpandWidth(true)); + WorldStorageWindow.DrawCopyright(); + + DrawUIStuffs(); + + EditorGUILayout.EndScrollView(); + + if (GUILayout.Button("Close Window")) + { + Close(); + } + } + + private void GetElementFROM() + { + // Trackable? + TrackableRequest.GetTrackableAsync(worldStorageServer, Guid.Parse(FROM.UUID), (response) => + { + try + { + Trackable result = response.result; + FROM.name = result.Name; + FROM.type = TypeWorldStorage.TRACKABLE; + + Matrix4x4 localCRS = WorldStorageUnityHelper.ConvertETSIARFTransform3DToUnity(result.LocalCRS); + FROM.pos = localCRS.GetPosition(); + } + catch + { + // Anchor? + WorldAnchorRequest.GetWorldAnchorAsync(worldStorageServer, Guid.Parse(FROM.UUID), (response) => + { + try + { + WorldAnchor result = response.result; + FROM.name = result.Name; + FROM.type = TypeWorldStorage.ANCHOR; + + Matrix4x4 localCRS = WorldStorageUnityHelper.ConvertETSIARFTransform3DToUnity(result.LocalCRS); + FROM.pos = localCRS.GetPosition(); + } + catch + { + // Nothing! + FROM.name = ""; + FROM.type = TypeWorldStorage.UNKNOWN; + } + }); + } + }); + } + + private void GetElementTO() + { + // Trackable? + TrackableRequest.GetTrackableAsync(worldStorageServer, Guid.Parse(TO.UUID), (response) => + { + try + { + Trackable result = response.result; + TO.name = result.Name; + TO.type = TypeWorldStorage.TRACKABLE; + + Matrix4x4 localCRS = WorldStorageUnityHelper.ConvertETSIARFTransform3DToUnity(result.LocalCRS); + TO.pos = localCRS.GetPosition(); + } + catch + { + // Anchor? + WorldAnchorRequest.GetWorldAnchorAsync(worldStorageServer, Guid.Parse(TO.UUID), (response) => + { + try + { + WorldAnchor result = response.result; + TO.name = result.Name; + TO.type = TypeWorldStorage.ANCHOR; + + Matrix4x4 localCRS = WorldStorageUnityHelper.ConvertETSIARFTransform3DToUnity(result.LocalCRS); + TO.pos = localCRS.GetPosition(); + } + catch + { + // Nothing! + TO.UUID = System.Guid.Empty.ToString(); + TO.name = ""; + TO.type = TypeWorldStorage.UNKNOWN; + } + }); + } + }); + } + + public override void DrawUIStuffs() + { + GUILayout.BeginVertical(); // "World Link Editor", gsTest); + EditorGUILayout.Space(); + + GUILayout.BeginHorizontal(); + GUI.backgroundColor = WorldStorageWindow.arfColors[9]; + Texture linkImage = (Texture)AssetDatabase.LoadAssetAtPath("Packages/etsi.isg.arf.worldstorage/Editor/Images/link.png", typeof(Texture)); + GUILayout.Box(linkImage, GUILayout.Width(24), GUILayout.Height(24)); + GUI.backgroundColor = ori; + GUILayout.Label("World Link Parameters:", EditorStyles.whiteBoldLabel); + GUILayout.EndHorizontal(); + + Rect rect = EditorGUILayout.GetControlRect(false, WorldStorageWindow.lineH); + EditorGUI.DrawRect(rect, WorldStorageWindow.arfColors[9]); + + // + GUILayout.Label("Server: " + worldStorageServer.serverName, EditorStyles.whiteLargeLabel); + GUILayout.Label("User: " + worldStorageUser.userName, EditorStyles.whiteLargeLabel); + EditorGUILayout.Space(); + +#if isDEBUG + GUILayout.Label("UUID: " + UUID, EditorStyles.miniLabel); // readonly + GUILayout.Label("Creator UID: " + creatorUUID, EditorStyles.miniLabel); // readonly +#endif + + EditorGUILayout.Space(); + + // --------------------- + // Toolbar + // --------------------- + EditorGUILayout.BeginHorizontal(); + GUI.backgroundColor = WorldStorageWindow.arfColors[2]; + if (GUILayout.Button(saveText)) + { + Debug.Log("PUT World Link"); + + if (!string.IsNullOrEmpty(UUID) && UUID != "0" && UUID != System.Guid.Empty.ToString()) + { + WorldLink obj = GenerateObject(); + WorldLinkRequest.UpdateWorldLinkAsync(worldStorageServer, obj, (response) => + { + UUID = response.result.Message; + UUID = UUID.Trim('"'); //Bugfix: remove " from server return value + + if (WorldStorageWindow.WorldStorageWindowSingleton != null) + { + WorldStorageWindow.WorldStorageWindowSingleton.GetWorldLinks(); + } + Close(); + }); + } + } + + GUI.backgroundColor = WorldStorageWindow.arfColors[3]; + if (GUILayout.Button("Delete")) + { + if (EditorUtility.DisplayDialog("Delete", "Are you sure you want to delete this World Link?", "Delete", "Cancel")) + { + Debug.Log("Delete World Link"); + WorldLinkRequest.DeleteWorldLinkAsync(worldStorageServer, Guid.Parse(UUID), (response) => + { + UUID = System.Guid.Empty.ToString(); + customName = "Warning: Object deleted !"; + creatorUUID = System.Guid.Empty.ToString(); + unit = UnitSystem.CM; + WorldStorageWindow.WorldStorageWindowSingleton.GetWorldLinks(); + }); + } + } + GUI.backgroundColor = ori; + + GUI.backgroundColor = WorldStorageWindow.arfColors[5]; + if (GUILayout.Button("Generate/Update GameObject")) + { + GenerateAndUpdateVisual(UUID, FROM, TO); + } + GUI.backgroundColor = ori; + EditorGUILayout.EndHorizontal(); + EditorGUILayout.Space(); + + // --------------------- + // Params + // --------------------- + string lastFromUUID = FROM.UUID; + string lastToUUID = TO.UUID; + + if (GUILayout.Button("Use 'From-To' Objects from Scene Selection")) + { + GameObject from, to; + GameObject[] SelectedObjects = Selection.gameObjects; + + if (SelectedObjects.Length == 2) + { + Debug.Log("Creation du lien (Many thanks Eric ;-)"); + from = SelectedObjects[0]; + to = SelectedObjects[1]; + FROM.UUID = from.name; + TO.UUID = to.name; + } + else + { + EditorUtility.DisplayDialog("Selection", "Please select exactly 2 GameObject from typ Trackable(s) and/or WorldAnchor(s) in the scene!", "OK"); + } + } + + showListFrom = EditorGUILayout.Foldout(showListFrom, "Parent Object (From)"); + if (showListFrom) + { + EditorGUILayout.BeginHorizontal(); + FROM.UUID = EditorGUILayout.TextField("UUID:", FROM.UUID); + if (FROM.UUID.Contains("[")) + { + // extract the UUID + FROM.UUID = FROM.UUID.Split('[', ']')[1]; + } + + GUI.backgroundColor = WorldStorageWindow.arfColors[0]; + if (GUILayout.Button(" Request ", EditorStyles.miniButtonLeft, middleButtonWidth) || lastFromUUID != FROM.UUID) + { + GetElementFROM(); + } + EditorGUILayout.EndHorizontal(); + GUI.backgroundColor = ori; + EditorGUILayout.LabelField("Name:", FROM.name); + EditorGUILayout.LabelField("Type:", FROM.type.ToString()); + } + + EditorGUILayout.Space(); + showListTo = EditorGUILayout.Foldout(showListTo, "Child Object (To)"); + if (showListTo) + { + EditorGUILayout.BeginHorizontal(); + TO.UUID = EditorGUILayout.TextField("UUID:", TO.UUID); + if (TO.UUID.Contains("[")) + { + // extract the UUID + TO.UUID = TO.UUID.Split('[', ']')[1]; + } + GUI.backgroundColor = WorldStorageWindow.arfColors[0]; + if (GUILayout.Button("Request ", EditorStyles.miniButtonLeft, middleButtonWidth) || lastToUUID != TO.UUID) + { + GetElementTO(); + } + EditorGUILayout.EndHorizontal(); + GUI.backgroundColor = ori; + EditorGUILayout.LabelField("Name:", TO.name); + EditorGUILayout.LabelField("Type:", TO.type.ToString()); + } + + EditorGUILayout.Space(); + unit = (UnitSystem)EditorGUILayout.EnumPopup("Unit System:", unit); + + EditorGUILayout.Space(); + //TODO Is this required??? + GUILayout.Label("Transform:"); + transf_pos = EditorGUILayout.Vector3Field("Position:", transf_pos); + transf_rot = EditorGUILayout.Vector3Field("Rotation:", transf_rot); + + // --------------------- + // Keyvalues + // --------------------- + EditorGUILayout.Space(); + groupEnabled = EditorGUILayout.BeginToggleGroup("Optional Parameters:", groupEnabled); + if (keyValuesFixed.Count > 0) + { + OutputKeyValue(0); + OutputKeyValue(1); + OutputKeyValue(2); + } + EditorGUILayout.EndToggleGroup(); + // + GUILayout.EndVertical(); + } + + public override void GetParams() + { + //customName = "Requesting information..."; + WorldLinkRequest.GetWorldLinkAsync(worldStorageServer, Guid.Parse(UUID), (response) => + { + WorldLink obj = response.result; + //customName = obj.Name; + creatorUUID = obj.CreatorUUID.ToString(); + + FROM.UUID = obj.UUIDFrom.ToString(); + FROM.type = obj.TypeFrom; + + TO.UUID = obj.UUIDTo.ToString(); + TO.type = obj.TypeTo; + + unit = obj.Unit; + if (obj.Transform.Count == 16) + { + Matrix4x4 transf = WorldStorageUnityHelper.ConvertETSIARFTransform3DToUnity(obj.Transform); + transf_pos = transf.GetPosition(); + transf_rot = transf.rotation.eulerAngles; + } + else + { + transf_pos = Vector3.zero; + transf_rot = Vector3.zero; + } + + // Get here the params of the from/to elements (GET) + GetElementFROM(); + GetElementTO(); + + // --------------------- + // Keyvalues + // --------------------- + //var first = WorldStorageWindow.GetFirstKeyValueTags(obj.KeyvalueTags); + //keyValuesFixed.Clear(); // no + for (int i = 0; i < keyValuesFixed.Count; i++) keyValuesFixed[i] = ("", ""); + + if (obj.KeyvalueTags.Count > 0) + { + int cnt = 0; + foreach (var item in obj.KeyvalueTags) + { + if (item.Key == "unityAuthoringPosX" || item.Key == "unityAuthoringPosY") continue; // ignore internal params + if (cnt < keyValuesFixed.Count) keyValuesFixed[cnt] = (item.Key, item.Value[0]); + cnt++; + } + } + repaint = true; + }); + } + + public override void AddObject() + { + Debug.Log("POST World Link"); + UUID = System.Guid.Empty.ToString(); + customName = "Default Link"; + + WorldLink obj = GenerateObject(); + WorldLinkRequest.CreateWorldLinkAsync(worldStorageServer, obj, (response) => + { + UUID = response.result.Message; + UUID = UUID.Trim('"'); //Bugfix: remove " from server return value + WorldStorageWindow.WorldStorageWindowSingleton.GetWorldLinks(); + }); + } + + public override WorldLink GenerateObject() + { + Matrix4x4 localCRS = new Matrix4x4(); + localCRS = Matrix4x4.TRS(transf_pos, Quaternion.Euler(transf_rot), Vector3.one); + Transform3D transform3d = WorldStorageUnityHelper.ConvertUnityToETSIARFTransform3D(localCRS); + + // --------------------- + // Keyvalues + // --------------------- + keyValueTags.Clear(); + //keyValueTags.Add("unityAuthoringPosX", posX); + //keyValueTags.Add("unityAuthoringPosY", posY); + if (keyValuesFixed.Count > 0) + foreach (var item in keyValuesFixed) + { + if (!string.IsNullOrEmpty(item.Item1)) keyValueTags.Add(item.Item1, new Collection { item.Item2 }); + } + + System.Guid _uuid = System.Guid.Parse(UUID); + System.Guid _creator = System.Guid.Parse(worldStorageUser.UUID); + System.Guid _from = System.Guid.Parse(FROM.UUID); + System.Guid _to = System.Guid.Parse(TO.UUID); + WorldLink t = new WorldLink() + { + UUID = _uuid, + CreatorUUID = _creator, + UUIDFrom = _from, + UUIDTo = _to, + TypeFrom = FROM.type, + TypeTo = TO.type, + Transform = transform3d, + Unit = unit, + KeyvalueTags = keyValueTags + }; + return t; + } + } +} \ No newline at end of file diff --git a/Editor/Scripts/Windows/WorldLinkWindow.cs.meta b/Editor/Scripts/Windows/WorldLinkWindow.cs.meta new file mode 100644 index 0000000000000000000000000000000000000000..6fdeb449c37b137881847fdb1819809eb9dfce05 --- /dev/null +++ b/Editor/Scripts/Windows/WorldLinkWindow.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f66d40f8781c5784cbe1013328d78ae6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Editor/Scripts/Windows/WorldStorageWindow.cs b/Editor/Scripts/Windows/WorldStorageWindow.cs new file mode 100644 index 0000000000000000000000000000000000000000..22301597a6e2508998d886b996307ce681e6eebb --- /dev/null +++ b/Editor/Scripts/Windows/WorldStorageWindow.cs @@ -0,0 +1,646 @@ +// +// ARF - Augmented Reality Framework (ETSI ISG ARF) +// +// Copyright 2024 ETSI +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Last change: June 2024 +// + +#define isDEBUG + +using System; +using System.Collections; +using System.Collections.Generic; + +using UnityEngine; +using UnityEditor; + +using ETSI.ARF.WorldStorage; +using ETSI.ARF.WorldStorage.REST; +using ETSI.ARF.WorldStorage.Editor.Windows; +using ETSI.ARF.OpenAPI.WorldStorage; + +namespace ETSI.ARF.WorldStorage.UI +{ + public class WorldStorageWindow : EditorWindow + { + static public WorldStorageWindow WorldStorageWindowSingleton; + static public string lastUserID = "8fb169e2-8910-4cd5-a8f9-b7abff38d013"; // dummy + + [HideInInspector] public WorldStorageServer worldStorageServer; + [HideInInspector] public WorldStorageUser worldStorageUser; + + [SerializeField] public List creators = new List(); + [SerializeField] public List trackables = new List(); + [SerializeField] public List anchors = new List(); + [SerializeField] public List links = new List(); + + string ping = "-"; + string state = "Unknow"; + string vers = "Unknow"; + + private bool repaint = false; + private Vector2 scrollPos; + private Color ori; + private GUIStyle gsTest; + + private static GUILayoutOption miniButtonWidth = GUILayout.Width(32); + private static GUILayoutOption buttonWidth = GUILayout.Width(64f); + private bool showListT = true; + private bool showListA = true; + private bool showListL = true; + + private string filterByKeyValueTag = ""; + + static public string winName = "ARF Authoring Editor"; + static public int lineH = 5; + static public Color[] arfColors = new Color[] + { + Color.yellow, // paneltext + new Color(0.3f, 1f, 1f), // button REST + new Color(0.3f, 1f, 0.3f), // button create + new Color(1f, 0f, 0f), // button delete (red) + new Color(.5f, .7f, 1f), // button graph window + new Color(.3f, .7f, 1f), // button generate prefab + new Color(1f, 1f, 0.3f), // button request + new Color(1f, 0.3f, 0.3f), // 7/ color for trackables + new Color(1f, 0.7f, 0f), // 8/ color for anchors + new Color(.66f, .4f, 1f), // 9/ color for links + new Color(.66f, .66f, 66f), // color for light grey + new Color(.22f, .22f, 22f) // color for dark grey + }; + + + //[MenuItem("[ ISG-ARF ]/World Storage Editor")] + public static void ShowWindow() + { + WorldStorageWindowSingleton = EditorWindow.GetWindow(typeof(WorldStorageWindow), false, WorldStorageWindow.winName) as WorldStorageWindow; + ResponseObject ro = AdminRequest.PingAsync(WorldStorageWindowSingleton.worldStorageServer, (response) => + { + WorldStorageWindowSingleton.ping = response.result; + WorldStorageWindowSingleton.repaint = true; + }); + WorldStorageWindow.lastUserID = WorldStorageWindowSingleton.worldStorageUser.UUID; + } + + public void Update() + { + if (repaint) + { + Repaint(); + repaint = false; + } + } + + public WorldStorageWindow() + { + } + + static public void DrawCopyright() + { + // Title + GUILayout.Label("Augmented Reality Framework", EditorStyles.boldLabel); + GUILayout.Label("Copyright (C) 2024, ETSI (BSD 3-Clause License)"); + } + + void OnGUI() + { + ori = GUI.backgroundColor; + gsTest = new GUIStyle("window"); + //gsTest.normal.textColor = WorldStorageWindow.arfColors[0]; + gsTest.fontStyle = FontStyle.Bold; + gsTest.alignment = TextAnchor.UpperLeft; + gsTest.fontSize = 16; + + scrollPos = EditorGUILayout.BeginScrollView(scrollPos, GUILayout.ExpandWidth(true)); + WorldStorageWindow.DrawCopyright(); + + // Server info + GUILayout.BeginVertical("World Storage Server", gsTest); + EditorGUILayout.Space(); + Rect rect = EditorGUILayout.GetControlRect(false, 1); // WorldStorageWindow.lineH); + EditorGUI.DrawRect(rect, Color.black); + // + GUILayout gl = new GUILayout(); + + GUILayout.Label("Server Name: " + worldStorageServer.serverName, EditorStyles.whiteLargeLabel); + GUILayout.Label("User Name: " + worldStorageUser.userName, EditorStyles.whiteLargeLabel); +#if isDEBUG + GUILayout.Label("Creator UID: " + worldStorageUser.UUID); + GUILayout.Label("Base Path: " + worldStorageServer.basePath); + GUILayout.Label("Port: " + worldStorageServer.port); +#endif + + GUI.backgroundColor = WorldStorageWindow.arfColors[1]; + if (GUILayout.Button("Open World Representation Graph Window...")) + { + WorldGraphWindow.ShowWindowFromWorldStorageWindow(worldStorageServer, worldStorageUser); + } + GUI.backgroundColor = ori; + + DrawElementStuffs(); + + EditorGUILayout.EndScrollView(); + } + + public void OnInspectorUpdate() + { + this.Repaint(); + } + + void DrawElementStuffs() + { + + EditorGUILayout.Space(); + + // ########################################################### + // Handle admin + // ########################################################### + #region Ping + GUILayout.BeginHorizontal(); + ping = EditorGUILayout.TextField("Last Ping", ping); + if (GUILayout.Button("Ping")) + { + ResponseObject ro = AdminRequest.PingAsync(worldStorageServer, (response) => + { + ping = response.result; + }); + } + GUI.backgroundColor = ori; + GUILayout.EndHorizontal(); + #endregion + + #region State + GUILayout.BeginHorizontal(); + state = EditorGUILayout.TextField("State", state); + + if (GUILayout.Button("Get World Storage Sate")) + { + ResponseObject ro = AdminRequest.AdminAsync(worldStorageServer, (response) => + { + state = response.result; + }); + } + GUI.backgroundColor = ori; + GUILayout.EndHorizontal(); + #endregion + + #region Version + GUILayout.BeginHorizontal(); + vers = EditorGUILayout.TextField("Version", vers); + + if (GUILayout.Button("Get World Storage API Version")) + { + ResponseObject ro = AdminRequest.VersionAsync(worldStorageServer, (response) => + { + vers = response.result; + }); + } + GUI.backgroundColor = ori; + GUILayout.EndHorizontal(); + #endregion + + EditorGUILayout.Space(); + + ScriptableObject target = this; + SerializedObject so = new SerializedObject(target); + + // ########################################################### + // Get creators + // ########################################################### + #region Get all creator UUID + EditorGUILayout.Space(); + GUI.backgroundColor = WorldStorageWindow.arfColors[4]; + if (GUILayout.Button("Request UUID of Creators")) GetCreators(); + GUI.backgroundColor = ori; + + SerializedProperty stringsProperty = so.FindProperty("creators"); + EditorGUILayout.PropertyField(stringsProperty, true); // True means show children + so.ApplyModifiedProperties(); // Remember to apply modified properties + #endregion + + //EditorGUILayout.Space(); + //GUILayout.Label("World Storage Elements:", EditorStyles.whiteLargeLabel); + + + // ########################################################### + // Filter (Key = Group) + // ########################################################### + #region Filter + EditorGUILayout.Space(); + filterByKeyValueTag = EditorGUILayout.TextField("Filter for KeyValue Group:", filterByKeyValueTag); + #endregion + + // ########################################################### + // Handle trackables + // ########################################################### + #region Get all trackable objects + EditorGUILayout.Space(); + + GUI.backgroundColor = WorldStorageWindow.arfColors[0]; + if (GUILayout.Button("Request All")) + { + GetTrackables(); + GetWorldAnchors(); + GetWorldLinks(); + } + + + GUILayout.BeginHorizontal(); + GUI.backgroundColor = WorldStorageWindow.arfColors[7]; + Texture trackableImage = (Texture)AssetDatabase.LoadAssetAtPath("Packages/etsi.isg.arf.worldstorage/Editor/Images/trackable.png", typeof(Texture)); + GUILayout.Box(trackableImage, GUILayout.Width(24), GUILayout.Height(24)); + GUI.backgroundColor = ori; + GUILayout.Label("Trackables:", EditorStyles.whiteBoldLabel); + GUILayout.EndHorizontal(); + + EditorGUILayout.BeginHorizontal(); + GUI.backgroundColor = WorldStorageWindow.arfColors[0]; + if (GUILayout.Button("Request Trackables")) + { + GetTrackables(); + } + + GUI.backgroundColor = WorldStorageWindow.arfColors[2]; + if (GUILayout.Button("Create New")) + { + Debug.Log("Create trackable and open window"); + TrackableWindow.ShowWindow(worldStorageServer, worldStorageUser); + } + + GUI.backgroundColor = ori; + //GUI.backgroundColor = WorldStorageWindow.arfColors[3]; + if (GUILayout.Button("Delete all Trackables (3 stay in!!!)")) + { + if (EditorUtility.DisplayDialog("Deleting elements", "Do you really want to delete all trackables?", "Yes", "No")) + { + Debug.Log("Deleting all Trackable "); + int n = 0; + string UUID; + foreach (var customName in trackables) + { + if (!customName.Contains("[")) UUID = customName; + else + { + // extract the UUID + UUID = customName.Split('[', ']')[1]; + } + if (++n > 3) TrackableRequest.DeleteTrackableAsync(worldStorageServer, Guid.Parse(UUID), (response) => + { + // nothing to do + }); + } + + GetTrackables(); + WorldStorageWindow.WorldStorageWindowSingleton.repaint = true; + } + } + GUI.backgroundColor = ori; + EditorGUILayout.EndHorizontal(); + + // Show list + stringsProperty = so.FindProperty("trackables"); + showListT = EditorGUILayout.BeginFoldoutHeaderGroup(showListT, "List of Trackables"); + if (showListT) + for (int i = 0; i < stringsProperty.arraySize; i++) + { + EditorGUILayout.BeginHorizontal(); + EditorGUILayout.PropertyField(stringsProperty.GetArrayElementAtIndex(i)); + + string UUID = WorldStorageWindow.GetUUIDFromString(stringsProperty.GetArrayElementAtIndex(i).stringValue); + if (UUID == null && i < trackables.Count) UUID = trackables[i]; // try this + if (GUILayout.Button("Edit...", EditorStyles.miniButtonLeft, buttonWidth)) + { + Debug.Log("Open Trackable Window"); + TrackableWindow.ShowWindow(worldStorageServer, worldStorageUser, UUID); + } + + GUI.backgroundColor = WorldStorageWindow.arfColors[3]; + if (GUILayout.Button("X", EditorStyles.miniButtonLeft, miniButtonWidth)) + { + if (EditorUtility.DisplayDialog("Delete", "Are you sure you want to delete this element?", "Delete", "Cancel")) + { + TrackableRequest.DeleteTrackableAsync(worldStorageServer, Guid.Parse(UUID), (response) => + { + WorldStorageWindowSingleton.GetTrackables(); + WorldStorageWindowSingleton.repaint = true; + }); + } + } + GUI.backgroundColor = ori; + + EditorGUILayout.EndHorizontal(); + } + EditorGUILayout.EndFoldoutHeaderGroup(); + #endregion + + // ########################################################### + // Handle anchors + // ########################################################### + #region Get all anchor objects + EditorGUILayout.Space(); + + GUILayout.BeginHorizontal(); + GUI.backgroundColor = WorldStorageWindow.arfColors[8]; + Texture anchorImage = (Texture)AssetDatabase.LoadAssetAtPath("Packages/etsi.isg.arf.worldstorage/Editor/Images/anchor.png", typeof(Texture)); + GUILayout.Box(anchorImage, GUILayout.Width(24), GUILayout.Height(24)); + GUI.backgroundColor = ori; + GUILayout.Label("World Anchors:", EditorStyles.whiteBoldLabel); + GUILayout.EndHorizontal(); + + EditorGUILayout.BeginHorizontal(); + GUI.backgroundColor = WorldStorageWindow.arfColors[0]; + if (GUILayout.Button("Request Anchors")) + { + GetWorldAnchors(); + } + + GUI.backgroundColor = WorldStorageWindow.arfColors[2]; + if (GUILayout.Button("Create New")) + { + Debug.Log("Create anchor and open window"); + WorldAnchorWindow.ShowWindow(worldStorageServer, worldStorageUser); + } + + GUI.backgroundColor = ori; + //GUI.backgroundColor = WorldStorageWindow.arfColors[3]; + if (GUILayout.Button("Delete all Anchors (3 stay in!!!)")) + { + if (EditorUtility.DisplayDialog("Deleting elements", "Do you really want to delete all anchors?", "Yes", "No")) + { + Debug.Log("Deleting all World Anchors "); + int n = 0; + string UUID; + foreach (var customName in anchors) + { + if (!customName.Contains("[")) UUID = customName; + else + { + // extract the UUID + UUID = customName.Split('[', ']')[1]; + } + if (++n > 3) WorldAnchorRequest.DeleteWorldAnchorAsync(worldStorageServer, Guid.Parse(UUID), (response) => + { + WorldStorageWindowSingleton.GetWorldAnchors(); + WorldStorageWindowSingleton.repaint = true; + }); + } + } + } + GUI.backgroundColor = ori; + EditorGUILayout.EndHorizontal(); + + // Show list + stringsProperty = so.FindProperty("anchors"); + showListA = EditorGUILayout.BeginFoldoutHeaderGroup(showListA, "List of World Anchors"); + if (showListA) + for (int i = 0; i < stringsProperty.arraySize; i++) + { + EditorGUILayout.BeginHorizontal(); + EditorGUILayout.PropertyField(stringsProperty.GetArrayElementAtIndex(i)); + + string UUID = WorldStorageWindow.GetUUIDFromString(stringsProperty.GetArrayElementAtIndex(i).stringValue); + if (UUID == null && i < anchors.Count) UUID = anchors[i]; // try this + if (GUILayout.Button("Edit...", EditorStyles.miniButtonLeft, buttonWidth)) + { + Debug.Log("Open Anchor Window"); + WorldAnchorWindow.ShowWindow(worldStorageServer, worldStorageUser, UUID); + } + + GUI.backgroundColor = WorldStorageWindow.arfColors[3]; + if (GUILayout.Button("X", EditorStyles.miniButtonLeft, miniButtonWidth)) + { + if (EditorUtility.DisplayDialog("Delete", "Are you sure you want to delete this element?", "Delete", "Cancel")) + { + WorldAnchorRequest.DeleteWorldAnchorAsync(worldStorageServer, Guid.Parse(UUID), (response) => + { + WorldStorageWindowSingleton.GetWorldAnchors(); + }); + } + } + GUI.backgroundColor = ori; + + EditorGUILayout.EndHorizontal(); + } + EditorGUILayout.EndFoldoutHeaderGroup(); + #endregion + + // ########################################################### + // Handle Links + // ########################################################### + #region Get all link objects + EditorGUILayout.Space(); + + GUILayout.BeginHorizontal(); + GUI.backgroundColor = WorldStorageWindow.arfColors[9]; + Texture linkImage = (Texture)AssetDatabase.LoadAssetAtPath("Packages/etsi.isg.arf.worldstorage/Editor/Images/link.png", typeof(Texture)); + GUILayout.Box(linkImage, GUILayout.Width(24), GUILayout.Height(24)); + GUI.backgroundColor = ori; + GUILayout.Label("World Links:", EditorStyles.whiteBoldLabel); + GUILayout.EndHorizontal(); + + EditorGUILayout.BeginHorizontal(); + GUI.backgroundColor = WorldStorageWindow.arfColors[0]; + if (GUILayout.Button("Request Links")) + { + GetWorldLinks(); + } + + GUI.backgroundColor = WorldStorageWindow.arfColors[2]; + if (GUILayout.Button("Create New")) + { + Debug.Log("Create link and open window"); + WorldLinkWindow.ShowWindow(worldStorageServer, worldStorageUser); + } + + GUI.backgroundColor = ori; + //GUI.backgroundColor = WorldStorageWindow.arfColors[3]; + if (GUILayout.Button("Delete all Links (3 stay in!!!)")) + { + if (EditorUtility.DisplayDialog("Deleting elements", "Do you really want to delete all links?", "Yes", "No")) + { + Debug.Log("Deleting all World Links"); + int n = 0; + string UUID; + foreach (var customName in links) + { + if (!customName.Contains("[")) UUID = customName; + else + { + // extract the UUID + UUID = customName.Split('[', ']')[1]; + } + if (++n > 3) WorldLinkRequest.DeleteWorldLinkAsync(worldStorageServer, Guid.Parse(UUID), (response) => + { + WorldStorageWindowSingleton.GetWorldLinks(); + }); + } + } + } + GUI.backgroundColor = ori; + EditorGUILayout.EndHorizontal(); + + // Show list + stringsProperty = so.FindProperty("links"); + showListL = EditorGUILayout.BeginFoldoutHeaderGroup(showListL, "List of World Links"); + if (showListL) + for (int i = 0; i < stringsProperty.arraySize; i++) + { + EditorGUILayout.BeginHorizontal(); + EditorGUILayout.PropertyField(stringsProperty.GetArrayElementAtIndex(i)); + + string UUID = WorldStorageWindow.GetUUIDFromString(stringsProperty.GetArrayElementAtIndex(i).stringValue); + if (UUID == null && i < links.Count) UUID = links[i]; // try this + if (GUILayout.Button("Edit...", EditorStyles.miniButtonLeft, buttonWidth)) + { + Debug.Log("Open Link Window"); + + WorldLinkWindow.ShowWindow(worldStorageServer, worldStorageUser, UUID); + } + + GUI.backgroundColor = WorldStorageWindow.arfColors[3]; + if (GUILayout.Button("X", EditorStyles.miniButtonLeft, miniButtonWidth)) + { + if (EditorUtility.DisplayDialog("Delete", "Are you sure you want to delete this element?", "Delete", "Cancel")) + { + WorldLinkRequest.DeleteWorldLinkAsync(worldStorageServer, Guid.Parse(UUID), (response) => + { + WorldStorageWindowSingleton.GetWorldLinks(); + }); + } + } + GUI.backgroundColor = ori; + + EditorGUILayout.EndHorizontal(); + } + EditorGUILayout.EndFoldoutHeaderGroup(); + #endregion + + // + GUILayout.EndVertical(); + } + + // ########################################################### + // Get elements from current server + // ########################################################### + #region Helpers + static public string GetUUIDFromString(string text) + { + if (!text.Contains("[")) return null; + else + { + // extract the UUID + return text.Split('[', ']')[1]; + } + } + + public void GetCreators() + { + // Get all objects + Debug.Log("Get all creators id"); + TrackableRequest.GetTrackablesAsync(worldStorageServer, (response) => + { + // Workaround + creators.Clear(); + foreach (var item in response.result.Trackables) + { + if (!creators.Contains(item.CreatorUUID.ToString())) creators.Add(item.CreatorUUID.ToString()); + } + }); + } + + static public (string, string) GetFirstKeyValueTags(KeyvalueTagList dict) + { + if (dict.Count >= 1) + { + // Get the first value in account (demo) + foreach (var item in dict) + { + string key1 = item.Key; + if (item.Value.Count >= 1) + { + string value1 = item.Value[0]; + return (key1, value1); + } + } + } + return ("", ""); + } + + public void GetTrackables() + { + // Get all objects + Debug.Log("Get all server objects"); + trackables.Clear(); + repaint = true; + TrackableRequest.GetTrackablesAsync(worldStorageServer, (response) => + { + Debug.Log("Get objects num = " + response.result.Trackables.Count); + foreach (var item in response.result.Trackables) + { + if (filterByKeyValueTag != "") + { + var first = GetFirstKeyValueTags(item.KeyvalueTags); + if (first.Item1.ToLower() != "group" || first.Item2 != filterByKeyValueTag) continue; + } + if (!string.IsNullOrEmpty(item.Name)) trackables.Add(item.Name + " [" + item.UUID.ToString() + "]"); + else trackables.Add(item.UUID.ToString()); + } + repaint = true; + }); + } + + public void GetWorldAnchors() + { + // Get all objects + Debug.Log("Get all server objects"); + anchors.Clear(); + repaint = true; + WorldAnchorRequest.GetWorldAnchorsAsync(worldStorageServer, (response) => + { + Debug.Log("Get objects num = " + response.result.WorldAnchors.Count); + foreach (var item in response.result.WorldAnchors) + { + if (filterByKeyValueTag != "") + { + var first = GetFirstKeyValueTags(item.KeyvalueTags); + if (first.Item1.ToLower() != "group" || first.Item2 != filterByKeyValueTag) continue; + } + if (!string.IsNullOrEmpty(item.Name)) anchors.Add(item.Name + " [" + item.UUID.ToString() + "]"); + else anchors.Add(item.UUID.ToString()); + } + repaint = true; + }); + } + + public void GetWorldLinks() + { + // Get all objects + Debug.Log("Get all server objects"); + links.Clear(); + repaint = true; + WorldLinkRequest.GetWorldLinksAsync(worldStorageServer, (response) => + { + Debug.Log("Get objects num = " + response.result.WorldLinks.Count); + foreach (var item in response.result.WorldLinks) + { + links.Add(item.UUID.ToString()); + } + repaint = true; + }); + } + #endregion + } +} \ No newline at end of file diff --git a/Editor/Scripts/Windows/WorldStorageWindow.cs.meta b/Editor/Scripts/Windows/WorldStorageWindow.cs.meta new file mode 100644 index 0000000000000000000000000000000000000000..ec99c51dab094a4ad96d5a8815ad02617d7c3307 --- /dev/null +++ b/Editor/Scripts/Windows/WorldStorageWindow.cs.meta @@ -0,0 +1,14 @@ +fileFormatVersion: 2 +guid: a1647df9b48bf4f49a664a929fff57ff +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: + - m_ViewDataDictionary: {instanceID: 0} + - worldStorageServer: {fileID: 11400000, guid: 4f997253243de534dad12937f1284975, type: 2} + - worldStorageUser: {fileID: 11400000, guid: c0696089e4a855b46ad490437919b1e8, type: 2} + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Editor/Scripts/WorldStorageInfoEditor.cs b/Editor/Scripts/WorldStorageInfoEditor.cs index 7d7e422b0becfcdf4863964beb1167be692de1a3..89cbd5305038824c03b68c5a6403a7c46aaa5af7 100644 --- a/Editor/Scripts/WorldStorageInfoEditor.cs +++ b/Editor/Scripts/WorldStorageInfoEditor.cs @@ -1,7 +1,7 @@ // // ARF - Augmented Reality Framework (ETSI ISG ARF) // -// Copyright 2022 ETSI +// Copyright 2024 ETSI // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/Editor/Scripts/WorldStoragePrefabs.cs b/Editor/Scripts/WorldStoragePrefabs.cs new file mode 100644 index 0000000000000000000000000000000000000000..be46c26538991d61db430e1e3f59b64738ef51f4 --- /dev/null +++ b/Editor/Scripts/WorldStoragePrefabs.cs @@ -0,0 +1,36 @@ +// +// ARF - Augmented Reality Framework (ETSI ISG ARF) +// +// Copyright 2024 ETSI +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Last change: July 2022 +// + +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UnityEditor; + +namespace ETSI.ARF.WorldStorage.UI.Prefabs +{ + [System.Serializable] + [CreateAssetMenu(fileName = "ARFPrefabs", menuName = "ARF World Storage/Setup for Visuals (prefabs)", order = 1)] + public class WorldStoragePrefabs : ScriptableObject + { + [SerializeField] public GameObject trackablePrefab; + [SerializeField] public GameObject worldAnchorPrefab; + [SerializeField] public GameObject worldLinkPrefab; + } +} \ No newline at end of file diff --git a/Editor/Scripts/WorldStoragePrefabs.cs.meta b/Editor/Scripts/WorldStoragePrefabs.cs.meta new file mode 100644 index 0000000000000000000000000000000000000000..c921b2346f741651adbfe7293a583be4a8b6cb5c --- /dev/null +++ b/Editor/Scripts/WorldStoragePrefabs.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1aec4cd1383f70e4092183ea55088e8e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Editor/Scripts/WorldStorageServerEditor.cs b/Editor/Scripts/WorldStorageServerEditor.cs new file mode 100644 index 0000000000000000000000000000000000000000..98b8311209d4b9885cb180189f5964fe45a044c7 --- /dev/null +++ b/Editor/Scripts/WorldStorageServerEditor.cs @@ -0,0 +1,64 @@ +// +// ARF - Augmented Reality Framework (ETSI ISG ARF) +// +// Copyright 2024 ETSI +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Last change: June 2022 +// + +using System.Collections; +using System.Collections.Generic; + +using UnityEngine; +using UnityEditor; + +namespace ETSI.ARF.WorldStorage.UI +{ + [CustomEditor(typeof(WorldStorageServer))] + public class WorldStorageServerEditor : UnityEditor.Editor + { + WorldStorageServer worldStorageServer; + WorldStorageWindow win; + + public void OnEnable() + { + worldStorageServer = (WorldStorageServer)target; + } + + public override void OnInspectorGUI() + { + serializedObject.Update(); + + Color ori = GUI.backgroundColor; + + GUILayout.Label("Copyright(c) 2022, ETSI - ARF"); + EditorGUILayout.Space(); + GUILayout.Label("Parameters:", EditorStyles.boldLabel); + DrawDefaultInspector(); + EditorGUILayout.Space(); + + // open window button + GUI.backgroundColor = WorldStorageWindow.arfColors[1]; + if (GUILayout.Button("Open World Storage Window...")) + { + Debug.Log("Open Main ARF Window"); + win = EditorWindow.GetWindow(typeof(WorldStorageWindow), false, "ETSI ARF - Authoring Editor") as WorldStorageWindow; + win.worldStorageServer = worldStorageServer; + win.worldStorageUser = worldStorageServer.currentUser; + } + GUI.backgroundColor = ori; + } + } +} \ No newline at end of file diff --git a/Editor/Scripts/WorldStorageServerEditor.cs.meta b/Editor/Scripts/WorldStorageServerEditor.cs.meta new file mode 100644 index 0000000000000000000000000000000000000000..2cc100f65e07665be1a6553ce793290920974cdf --- /dev/null +++ b/Editor/Scripts/WorldStorageServerEditor.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 878ee3c4c6608354f90354fd159f4e04 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Editor/Scripts/WorldStorageUserEditor.cs b/Editor/Scripts/WorldStorageUserEditor.cs new file mode 100644 index 0000000000000000000000000000000000000000..61710a072e6e56f340ae3b533cf5fd45f7f20afa --- /dev/null +++ b/Editor/Scripts/WorldStorageUserEditor.cs @@ -0,0 +1,62 @@ +// +// ARF - Augmented Reality Framework (ETSI ISG ARF) +// +// Copyright 2024 ETSI +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Last change: June 2024 +// + +using System.Collections; +using System.Collections.Generic; + +using UnityEngine; +using UnityEditor; + +namespace ETSI.ARF.WorldStorage.UI +{ + [CustomEditor(typeof(WorldStorageUser))] + public class WorldStorageUserEditor : UnityEditor.Editor + { + WorldStorageUser worldStorageUser; + WorldStorageWindow win; + + public void OnEnable() + { + worldStorageUser = (WorldStorageUser)target; + } + + public override void OnInspectorGUI() + { + serializedObject.Update(); + + Color ori = GUI.backgroundColor; + + GUILayout.Label("Copyright(c) 2022, ETSI - ARF"); + EditorGUILayout.Space(); + GUILayout.Label("Parameters:", EditorStyles.boldLabel); + DrawDefaultInspector(); + EditorGUILayout.Space(); + + // creator UUID button + GUI.backgroundColor = WorldStorageWindow.arfColors[1]; + if (GUILayout.Button("Generate New Creator UUID")) + { + worldStorageUser.UUID = System.Guid.NewGuid().ToString(); + if (win != null) win.worldStorageUser.UUID = worldStorageUser.UUID; + } + GUI.backgroundColor = ori; + } + } +} \ No newline at end of file diff --git a/Editor/Scripts/WorldStorageUserEditor.cs.meta b/Editor/Scripts/WorldStorageUserEditor.cs.meta new file mode 100644 index 0000000000000000000000000000000000000000..fda722e173a00845529c4320e13d4eb268184994 --- /dev/null +++ b/Editor/Scripts/WorldStorageUserEditor.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 134a71a4b493ae1468ea8de88c99135c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Editor/etsi.isg.arf.worldstorage.Editor.asmdef b/Editor/etsi.isg.arf.worldstorage.Editor.asmdef index ab260154237e432fadf27bda76e5036f4045ed51..b49a6d79f3a1c09f488de5dd73afb8bbb6bd263b 100644 --- a/Editor/etsi.isg.arf.worldstorage.Editor.asmdef +++ b/Editor/etsi.isg.arf.worldstorage.Editor.asmdef @@ -2,7 +2,8 @@ "name": "etsi.isg.arf.worldstorage.editor", "rootNamespace": "", "references": [ - "GUID:99fdaa6f193b69346bfc8863615f98f0" + "GUID:99fdaa6f193b69346bfc8863615f98f0", + "GUID:6055be8ebefd69e48b49212b09b47b2f" ], "includePlatforms": [ "Editor" diff --git a/Runtime/Prefabs.meta b/Runtime/Prefabs.meta new file mode 100644 index 0000000000000000000000000000000000000000..3afe3fd00467d620a850aacf421f90f4f376e4e5 --- /dev/null +++ b/Runtime/Prefabs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 58d625e15ff264e479d393186a4a9827 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/Prefabs/ARFTrackable.prefab b/Runtime/Prefabs/ARFTrackable.prefab new file mode 100644 index 0000000000000000000000000000000000000000..678ddae96b013c7b7ce8241fc169cdc894b6bec9 --- /dev/null +++ b/Runtime/Prefabs/ARFTrackable.prefab @@ -0,0 +1,835 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &1239500166128132140 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1814829793678878270} + m_Layer: 0 + m_Name: ARFTrackable + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1814829793678878270 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1239500166128132140} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 4532241398218188797} + - {fileID: 33536572583887604} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1389085265039543899 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 788171341007892784} + - component: {fileID: 8839914115087242523} + - component: {fileID: 4246121306890513542} + - component: {fileID: 1020142642249578057} + m_Layer: 0 + m_Name: Y + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &788171341007892784 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1389085265039543899} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0.1, z: 0} + m_LocalScale: {x: 0.020000001, y: 0.05, z: 0.020000001} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 4532241398218188797} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &8839914115087242523 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1389085265039543899} + m_Mesh: {fileID: 10206, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &4246121306890513542 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1389085265039543899} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 19de5bd9483daf448a5fab21d3eecba3, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!136 &1020142642249578057 +CapsuleCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1389085265039543899} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + m_Radius: 0.5000001 + m_Height: 2 + m_Direction: 1 + m_Center: {x: 0.000000059604645, y: 0, z: -0.00000008940697} +--- !u!1 &1687101261560852242 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 377487265314945344} + - component: {fileID: 6822513350628080072} + - component: {fileID: 6739960153126183626} + - component: {fileID: 8765868915607131294} + m_Layer: 0 + m_Name: Z + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &377487265314945344 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1687101261560852242} + m_LocalRotation: {x: 0.7071068, y: -0, z: -0, w: 0.7071068} + m_LocalPosition: {x: 0, y: 0, z: 0.1} + m_LocalScale: {x: 0.020000001, y: 0.05000001, z: 0.019999998} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 4532241398218188797} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} +--- !u!33 &6822513350628080072 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1687101261560852242} + m_Mesh: {fileID: 10206, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &6739960153126183626 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1687101261560852242} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 1b6b868784cd25c46a90fe7b882fddb2, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!136 &8765868915607131294 +CapsuleCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1687101261560852242} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + m_Radius: 0.5000001 + m_Height: 2 + m_Direction: 1 + m_Center: {x: 0.000000059604645, y: 0, z: -0.00000008940697} +--- !u!1 &1823986580348874447 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1436432047471570793} + - component: {fileID: 5158975352210721371} + - component: {fileID: 4673833591676428792} + - component: {fileID: 961187375770271614} + m_Layer: 0 + m_Name: X + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1436432047471570793 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1823986580348874447} + m_LocalRotation: {x: -0, y: -0, z: 0.7071068, w: 0.7071068} + m_LocalPosition: {x: 0.1, y: 0, z: 0} + m_LocalScale: {x: 0.019999998, y: 0.05000001, z: 0.020000001} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 4532241398218188797} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90} +--- !u!33 &5158975352210721371 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1823986580348874447} + m_Mesh: {fileID: 10206, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &4673833591676428792 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1823986580348874447} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 0c6a9f85031693343a9e37c4a08627e9, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!136 &961187375770271614 +CapsuleCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1823986580348874447} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + m_Radius: 0.5000001 + m_Height: 2 + m_Direction: 1 + m_Center: {x: 0.000000059604645, y: 0, z: -0.00000008940697} +--- !u!1 &4451045791079530586 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2888022835692577799} + - component: {fileID: 3434672324534858807} + - component: {fileID: 420668000673399792} + m_Layer: 5 + m_Name: Text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &2888022835692577799 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4451045791079530586} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0.001, y: 0.001, z: 0.001} + m_ConstrainProportionsScale: 1 + m_Children: [] + m_Father: {fileID: 33536572583887604} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 0, y: -0.025} + m_SizeDelta: {x: 250, y: 50} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &3434672324534858807 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4451045791079530586} + m_CullTransparentMesh: 1 +--- !u!114 &420668000673399792 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4451045791079530586} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_text: 'Name: + + UUID:' + m_isRightToLeft: 0 + m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} + m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} + m_fontSharedMaterials: [] + m_fontMaterial: {fileID: 0} + m_fontMaterials: [] + m_fontColor32: + serializedVersion: 2 + rgba: 4294967295 + m_fontColor: {r: 1, g: 1, b: 1, a: 1} + m_enableVertexGradient: 0 + m_colorMode: 3 + m_fontColorGradient: + topLeft: {r: 1, g: 1, b: 1, a: 1} + topRight: {r: 1, g: 1, b: 1, a: 1} + bottomLeft: {r: 1, g: 1, b: 1, a: 1} + bottomRight: {r: 1, g: 1, b: 1, a: 1} + m_fontColorGradientPreset: {fileID: 0} + m_spriteAsset: {fileID: 0} + m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: -1183493901 + m_overrideHtmlColors: 0 + m_faceColor: + serializedVersion: 2 + rgba: 4294967295 + m_fontSize: 16 + m_fontSizeBase: 16 + m_fontWeight: 400 + m_enableAutoSizing: 0 + m_fontSizeMin: 18 + m_fontSizeMax: 72 + m_fontStyle: 0 + m_HorizontalAlignment: 1 + m_VerticalAlignment: 256 + m_textAlignment: 65535 + m_characterSpacing: 0 + m_wordSpacing: 0 + m_lineSpacing: 0 + m_lineSpacingMax: 0 + m_paragraphSpacing: 0 + m_charWidthMaxAdj: 0 + m_enableWordWrapping: 1 + m_wordWrappingRatios: 0.4 + m_overflowMode: 0 + m_linkedTextComponent: {fileID: 0} + parentLinkedComponent: {fileID: 0} + m_enableKerning: 1 + m_enableExtraPadding: 0 + checkPaddingRequired: 0 + m_isRichText: 1 + m_parseCtrlCharacters: 1 + m_isOrthographic: 1 + m_isCullingEnabled: 0 + m_horizontalMapping: 0 + m_verticalMapping: 0 + m_uvLineOffset: 0 + m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 + m_VertexBufferAutoSizeReduction: 0 + m_useMaxVisibleDescender: 1 + m_pageToDisplay: 1 + m_margin: {x: 0, y: 0, z: 0, w: 0} + m_isUsingLegacyAnimationComponent: 0 + m_isVolumetricText: 0 + m_hasFontAssetChanged: 0 + m_baseMaterial: {fileID: 0} + m_maskOffset: {x: 0, y: 0, z: 0, w: 0} +--- !u!1 &5897666007833324009 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 8156859587808685068} + - component: {fileID: 1360188677730577841} + - component: {fileID: 3860478840123770047} + m_Layer: 5 + m_Name: Headline + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &8156859587808685068 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5897666007833324009} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0.001, y: 0.001, z: 0.001} + m_ConstrainProportionsScale: 1 + m_Children: [] + m_Father: {fileID: 33536572583887604} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 0, y: 0.02} + m_SizeDelta: {x: 250, y: 25} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &1360188677730577841 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5897666007833324009} + m_CullTransparentMesh: 1 +--- !u!114 &3860478840123770047 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5897666007833324009} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_text: AR Trackable + m_isRightToLeft: 0 + m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} + m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} + m_fontSharedMaterials: [] + m_fontMaterial: {fileID: 0} + m_fontMaterials: [] + m_fontColor32: + serializedVersion: 2 + rgba: 4294967295 + m_fontColor: {r: 1, g: 1, b: 1, a: 1} + m_enableVertexGradient: 0 + m_colorMode: 3 + m_fontColorGradient: + topLeft: {r: 1, g: 1, b: 1, a: 1} + topRight: {r: 1, g: 1, b: 1, a: 1} + bottomLeft: {r: 1, g: 1, b: 1, a: 1} + bottomRight: {r: 1, g: 1, b: 1, a: 1} + m_fontColorGradientPreset: {fileID: 0} + m_spriteAsset: {fileID: 0} + m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: -1183493901 + m_overrideHtmlColors: 0 + m_faceColor: + serializedVersion: 2 + rgba: 4294967295 + m_fontSize: 24 + m_fontSizeBase: 24 + m_fontWeight: 400 + m_enableAutoSizing: 0 + m_fontSizeMin: 18 + m_fontSizeMax: 72 + m_fontStyle: 1 + m_HorizontalAlignment: 1 + m_VerticalAlignment: 256 + m_textAlignment: 65535 + m_characterSpacing: 0 + m_wordSpacing: 0 + m_lineSpacing: 0 + m_lineSpacingMax: 0 + m_paragraphSpacing: 0 + m_charWidthMaxAdj: 0 + m_enableWordWrapping: 1 + m_wordWrappingRatios: 0.4 + m_overflowMode: 0 + m_linkedTextComponent: {fileID: 0} + parentLinkedComponent: {fileID: 0} + m_enableKerning: 1 + m_enableExtraPadding: 0 + checkPaddingRequired: 0 + m_isRichText: 1 + m_parseCtrlCharacters: 1 + m_isOrthographic: 1 + m_isCullingEnabled: 0 + m_horizontalMapping: 0 + m_verticalMapping: 0 + m_uvLineOffset: 0 + m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 + m_VertexBufferAutoSizeReduction: 0 + m_useMaxVisibleDescender: 1 + m_pageToDisplay: 1 + m_margin: {x: 0, y: 0, z: 0, w: 0} + m_isUsingLegacyAnimationComponent: 0 + m_isVolumetricText: 0 + m_hasFontAssetChanged: 0 + m_baseMaterial: {fileID: 0} + m_maskOffset: {x: 0, y: 0, z: 0, w: 0} +--- !u!1 &8182691244837652424 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4532241398218188797} + m_Layer: 0 + m_Name: Axe + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4532241398218188797 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8182691244837652424} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 8225488253825437765} + - {fileID: 1436432047471570793} + - {fileID: 788171341007892784} + - {fileID: 377487265314945344} + m_Father: {fileID: 1814829793678878270} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &8225488253825437761 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 8225488253825437765} + - component: {fileID: 8225488253825437764} + - component: {fileID: 8225488253825437763} + - component: {fileID: 8225488253825437762} + m_Layer: 0 + m_Name: Center + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &8225488253825437765 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8225488253825437761} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0.1, y: 0.1, z: 0.1} + m_ConstrainProportionsScale: 1 + m_Children: [] + m_Father: {fileID: 4532241398218188797} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &8225488253825437764 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8225488253825437761} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &8225488253825437763 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8225488253825437761} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 4f607925b7a7fcc44806b35f5aa087a4, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!65 &8225488253825437762 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8225488253825437761} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!1 &8292506020522815698 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 33536572583887604} + - component: {fileID: 1417027443369488948} + - component: {fileID: 1035955511594240086} + - component: {fileID: 5661858723465099382} + m_Layer: 5 + m_Name: Canvas + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &33536572583887604 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8292506020522815698} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 8156859587808685068} + - {fileID: 2888022835692577799} + m_Father: {fileID: 1814829793678878270} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0.1263, y: -0.1} + m_SizeDelta: {x: 640, y: 480} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!223 &1417027443369488948 +Canvas: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8292506020522815698} + m_Enabled: 1 + serializedVersion: 3 + m_RenderMode: 2 + m_Camera: {fileID: 0} + m_PlaneDistance: 100 + m_PixelPerfect: 0 + m_ReceivesEvents: 1 + m_OverrideSorting: 0 + m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_AdditionalShaderChannelsFlag: 25 + m_SortingLayerID: 0 + m_SortingOrder: 0 + m_TargetDisplay: 0 +--- !u!114 &1035955511594240086 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8292506020522815698} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UiScaleMode: 0 + m_ReferencePixelsPerUnit: 100 + m_ScaleFactor: 1 + m_ReferenceResolution: {x: 800, y: 600} + m_ScreenMatchMode: 0 + m_MatchWidthOrHeight: 0 + m_PhysicalUnit: 3 + m_FallbackScreenDPI: 96 + m_DefaultSpriteDPI: 96 + m_DynamicPixelsPerUnit: 1 + m_PresetInfoIsWorld: 1 +--- !u!114 &5661858723465099382 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8292506020522815698} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreReversedGraphics: 1 + m_BlockingObjects: 0 + m_BlockingMask: + serializedVersion: 2 + m_Bits: 4294967295 diff --git a/Runtime/Prefabs/ARFTrackable.prefab.meta b/Runtime/Prefabs/ARFTrackable.prefab.meta new file mode 100644 index 0000000000000000000000000000000000000000..817771efe87d4afef926c78c799ea1ed2df89c57 --- /dev/null +++ b/Runtime/Prefabs/ARFTrackable.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 889bc3e43608e504c977b93ba5f8ed37 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/Prefabs/ARFWorldAnchor.prefab b/Runtime/Prefabs/ARFWorldAnchor.prefab new file mode 100644 index 0000000000000000000000000000000000000000..cea4dce362ad7454861c898d27598b7341617802 --- /dev/null +++ b/Runtime/Prefabs/ARFWorldAnchor.prefab @@ -0,0 +1,835 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &1058305942658709743 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4263110725940009300} + - component: {fileID: 4129045750120536829} + - component: {fileID: 6557221987491350997} + m_Layer: 5 + m_Name: Headline + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &4263110725940009300 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1058305942658709743} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0.001, y: 0.001, z: 0.001} + m_ConstrainProportionsScale: 1 + m_Children: [] + m_Father: {fileID: 1497700213276983046} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 0, y: 0.02} + m_SizeDelta: {x: 250, y: 25} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &4129045750120536829 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1058305942658709743} + m_CullTransparentMesh: 1 +--- !u!114 &6557221987491350997 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1058305942658709743} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_text: AR World Anchor + m_isRightToLeft: 0 + m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} + m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} + m_fontSharedMaterials: [] + m_fontMaterial: {fileID: 0} + m_fontMaterials: [] + m_fontColor32: + serializedVersion: 2 + rgba: 4294967295 + m_fontColor: {r: 1, g: 1, b: 1, a: 1} + m_enableVertexGradient: 0 + m_colorMode: 3 + m_fontColorGradient: + topLeft: {r: 1, g: 1, b: 1, a: 1} + topRight: {r: 1, g: 1, b: 1, a: 1} + bottomLeft: {r: 1, g: 1, b: 1, a: 1} + bottomRight: {r: 1, g: 1, b: 1, a: 1} + m_fontColorGradientPreset: {fileID: 0} + m_spriteAsset: {fileID: 0} + m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: -1183493901 + m_overrideHtmlColors: 0 + m_faceColor: + serializedVersion: 2 + rgba: 4294967295 + m_fontSize: 24 + m_fontSizeBase: 24 + m_fontWeight: 400 + m_enableAutoSizing: 0 + m_fontSizeMin: 18 + m_fontSizeMax: 72 + m_fontStyle: 1 + m_HorizontalAlignment: 1 + m_VerticalAlignment: 256 + m_textAlignment: 65535 + m_characterSpacing: 0 + m_wordSpacing: 0 + m_lineSpacing: 0 + m_lineSpacingMax: 0 + m_paragraphSpacing: 0 + m_charWidthMaxAdj: 0 + m_enableWordWrapping: 1 + m_wordWrappingRatios: 0.4 + m_overflowMode: 0 + m_linkedTextComponent: {fileID: 0} + parentLinkedComponent: {fileID: 0} + m_enableKerning: 1 + m_enableExtraPadding: 0 + checkPaddingRequired: 0 + m_isRichText: 1 + m_parseCtrlCharacters: 1 + m_isOrthographic: 1 + m_isCullingEnabled: 0 + m_horizontalMapping: 0 + m_verticalMapping: 0 + m_uvLineOffset: 0 + m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 + m_VertexBufferAutoSizeReduction: 0 + m_useMaxVisibleDescender: 1 + m_pageToDisplay: 1 + m_margin: {x: 0, y: 0, z: 0, w: 0} + m_isUsingLegacyAnimationComponent: 0 + m_isVolumetricText: 0 + m_hasFontAssetChanged: 0 + m_baseMaterial: {fileID: 0} + m_maskOffset: {x: 0, y: 0, z: 0, w: 0} +--- !u!1 &1525499792725534490 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 6503384942250313519} + m_Layer: 0 + m_Name: Axe + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &6503384942250313519 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1525499792725534490} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 1622323168209334423} + - {fileID: 8595771872739495867} + - {fileID: 7950346510699467234} + - {fileID: 7032495084649945490} + m_Father: {fileID: 9046317383172441836} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1622323168209334419 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1622323168209334423} + - component: {fileID: 1622323168209334422} + - component: {fileID: 1622323168209334417} + - component: {fileID: 1622323168209334416} + m_Layer: 0 + m_Name: Center + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1622323168209334423 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1622323168209334419} + m_LocalRotation: {x: 0, y: 1, z: 0, w: 0} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0.1, y: 0.1, z: 0.1} + m_ConstrainProportionsScale: 1 + m_Children: [] + m_Father: {fileID: 6503384942250313519} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 180, z: 0} +--- !u!33 &1622323168209334422 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1622323168209334419} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &1622323168209334417 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1622323168209334419} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 730ea8fe50af5874fb3b990c534eaebc, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!65 &1622323168209334416 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1622323168209334419} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!1 &4529171925897838154 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2044833251513730170} + - component: {fileID: 8475275463028488054} + - component: {fileID: 3041298355498540117} + m_Layer: 5 + m_Name: Text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &2044833251513730170 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4529171925897838154} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0.001, y: 0.001, z: 0.001} + m_ConstrainProportionsScale: 1 + m_Children: [] + m_Father: {fileID: 1497700213276983046} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 0, y: -0.025} + m_SizeDelta: {x: 250, y: 50} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &8475275463028488054 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4529171925897838154} + m_CullTransparentMesh: 1 +--- !u!114 &3041298355498540117 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4529171925897838154} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_text: 'Name: + + UUID:' + m_isRightToLeft: 0 + m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} + m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} + m_fontSharedMaterials: [] + m_fontMaterial: {fileID: 0} + m_fontMaterials: [] + m_fontColor32: + serializedVersion: 2 + rgba: 4294967295 + m_fontColor: {r: 1, g: 1, b: 1, a: 1} + m_enableVertexGradient: 0 + m_colorMode: 3 + m_fontColorGradient: + topLeft: {r: 1, g: 1, b: 1, a: 1} + topRight: {r: 1, g: 1, b: 1, a: 1} + bottomLeft: {r: 1, g: 1, b: 1, a: 1} + bottomRight: {r: 1, g: 1, b: 1, a: 1} + m_fontColorGradientPreset: {fileID: 0} + m_spriteAsset: {fileID: 0} + m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: -1183493901 + m_overrideHtmlColors: 0 + m_faceColor: + serializedVersion: 2 + rgba: 4294967295 + m_fontSize: 16 + m_fontSizeBase: 16 + m_fontWeight: 400 + m_enableAutoSizing: 0 + m_fontSizeMin: 18 + m_fontSizeMax: 72 + m_fontStyle: 0 + m_HorizontalAlignment: 1 + m_VerticalAlignment: 256 + m_textAlignment: 65535 + m_characterSpacing: 0 + m_wordSpacing: 0 + m_lineSpacing: 0 + m_lineSpacingMax: 0 + m_paragraphSpacing: 0 + m_charWidthMaxAdj: 0 + m_enableWordWrapping: 1 + m_wordWrappingRatios: 0.4 + m_overflowMode: 0 + m_linkedTextComponent: {fileID: 0} + parentLinkedComponent: {fileID: 0} + m_enableKerning: 1 + m_enableExtraPadding: 0 + checkPaddingRequired: 0 + m_isRichText: 1 + m_parseCtrlCharacters: 1 + m_isOrthographic: 1 + m_isCullingEnabled: 0 + m_horizontalMapping: 0 + m_verticalMapping: 0 + m_uvLineOffset: 0 + m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 + m_VertexBufferAutoSizeReduction: 0 + m_useMaxVisibleDescender: 1 + m_pageToDisplay: 1 + m_margin: {x: 0, y: 0, z: 0, w: 0} + m_isUsingLegacyAnimationComponent: 0 + m_isVolumetricText: 0 + m_hasFontAssetChanged: 0 + m_baseMaterial: {fileID: 0} + m_maskOffset: {x: 0, y: 0, z: 0, w: 0} +--- !u!1 &8344222362070912960 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7032495084649945490} + - component: {fileID: 4182441150992537882} + - component: {fileID: 4119753123192799768} + - component: {fileID: 2090784007532835916} + m_Layer: 0 + m_Name: Z + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &7032495084649945490 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8344222362070912960} + m_LocalRotation: {x: 0.7071068, y: -0, z: -0, w: 0.7071068} + m_LocalPosition: {x: 0, y: 0, z: 0.1} + m_LocalScale: {x: 0.020000001, y: 0.05000001, z: 0.019999998} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 6503384942250313519} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} +--- !u!33 &4182441150992537882 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8344222362070912960} + m_Mesh: {fileID: 10206, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &4119753123192799768 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8344222362070912960} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 1b6b868784cd25c46a90fe7b882fddb2, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!136 &2090784007532835916 +CapsuleCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8344222362070912960} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + m_Radius: 0.5000001 + m_Height: 2 + m_Direction: 1 + m_Center: {x: 0.000000059604645, y: 0, z: -0.00000008940697} +--- !u!1 &8473238451594182910 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 9046317383172441836} + m_Layer: 0 + m_Name: ARFWorldAnchor + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &9046317383172441836 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8473238451594182910} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 6503384942250313519} + - {fileID: 1497700213276983046} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &8638588117357457033 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7950346510699467234} + - component: {fileID: 2164195824166614473} + - component: {fileID: 6793727845488397396} + - component: {fileID: 7677843500006282907} + m_Layer: 0 + m_Name: Y + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &7950346510699467234 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8638588117357457033} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0.1, z: 0} + m_LocalScale: {x: 0.020000001, y: 0.05, z: 0.020000001} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 6503384942250313519} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &2164195824166614473 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8638588117357457033} + m_Mesh: {fileID: 10206, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &6793727845488397396 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8638588117357457033} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 19de5bd9483daf448a5fab21d3eecba3, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!136 &7677843500006282907 +CapsuleCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8638588117357457033} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + m_Radius: 0.5000001 + m_Height: 2 + m_Direction: 1 + m_Center: {x: 0.000000059604645, y: 0, z: -0.00000008940697} +--- !u!1 &8828373246506081872 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1497700213276983046} + - component: {fileID: 8595258003796922682} + - component: {fileID: 3895121440785909528} + - component: {fileID: 2278103916936109689} + m_Layer: 5 + m_Name: Canvas + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1497700213276983046 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8828373246506081872} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 4263110725940009300} + - {fileID: 2044833251513730170} + m_Father: {fileID: 9046317383172441836} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0.1263, y: -0.1} + m_SizeDelta: {x: 640, y: 480} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!223 &8595258003796922682 +Canvas: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8828373246506081872} + m_Enabled: 1 + serializedVersion: 3 + m_RenderMode: 2 + m_Camera: {fileID: 0} + m_PlaneDistance: 100 + m_PixelPerfect: 0 + m_ReceivesEvents: 1 + m_OverrideSorting: 0 + m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_AdditionalShaderChannelsFlag: 25 + m_SortingLayerID: 0 + m_SortingOrder: 0 + m_TargetDisplay: 0 +--- !u!114 &3895121440785909528 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8828373246506081872} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UiScaleMode: 0 + m_ReferencePixelsPerUnit: 100 + m_ScaleFactor: 1 + m_ReferenceResolution: {x: 800, y: 600} + m_ScreenMatchMode: 0 + m_MatchWidthOrHeight: 0 + m_PhysicalUnit: 3 + m_FallbackScreenDPI: 96 + m_DefaultSpriteDPI: 96 + m_DynamicPixelsPerUnit: 1 + m_PresetInfoIsWorld: 1 +--- !u!114 &2278103916936109689 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8828373246506081872} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreReversedGraphics: 1 + m_BlockingObjects: 0 + m_BlockingMask: + serializedVersion: 2 + m_Bits: 4294967295 +--- !u!1 &9076285480843021853 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 8595771872739495867} + - component: {fileID: 2539246307318246025} + - component: {fileID: 2628309207522230570} + - component: {fileID: 7634649738335838124} + m_Layer: 0 + m_Name: X + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &8595771872739495867 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9076285480843021853} + m_LocalRotation: {x: -0, y: -0, z: 0.7071068, w: 0.7071068} + m_LocalPosition: {x: 0.1, y: 0, z: 0} + m_LocalScale: {x: 0.019999998, y: 0.05000001, z: 0.020000001} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 6503384942250313519} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90} +--- !u!33 &2539246307318246025 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9076285480843021853} + m_Mesh: {fileID: 10206, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &2628309207522230570 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9076285480843021853} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 0c6a9f85031693343a9e37c4a08627e9, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!136 &7634649738335838124 +CapsuleCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9076285480843021853} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + m_Radius: 0.5000001 + m_Height: 2 + m_Direction: 1 + m_Center: {x: 0.000000059604645, y: 0, z: -0.00000008940697} diff --git a/Runtime/Prefabs/ARFWorldAnchor.prefab.meta b/Runtime/Prefabs/ARFWorldAnchor.prefab.meta new file mode 100644 index 0000000000000000000000000000000000000000..898f39e353c4a7269fbdc67c8fc42c2c4997d253 --- /dev/null +++ b/Runtime/Prefabs/ARFWorldAnchor.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 832a64407eb5c8249bb8e4a074649918 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/Prefabs/ARFWorldLink.prefab b/Runtime/Prefabs/ARFWorldLink.prefab new file mode 100644 index 0000000000000000000000000000000000000000..077a9e1a8f869fcdfd180ebcb87153a84a6a8dc2 --- /dev/null +++ b/Runtime/Prefabs/ARFWorldLink.prefab @@ -0,0 +1,555 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &1239500166128132140 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1814829793678878270} + - component: {fileID: 2766171691247251799} + m_Layer: 0 + m_Name: ARFWorldLink + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1814829793678878270 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1239500166128132140} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 4532241398218188797} + - {fileID: 33536572583887604} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &2766171691247251799 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1239500166128132140} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 33fce8a1d8d349d47b8565dfe031b6b1, type: 3} + m_Name: + m_EditorClassIdentifier: + fromElement: {fileID: 0} + toElement: {fileID: 0} +--- !u!1 &4451045791079530586 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2888022835692577799} + - component: {fileID: 3434672324534858807} + - component: {fileID: 420668000673399792} + m_Layer: 5 + m_Name: Text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &2888022835692577799 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4451045791079530586} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0.001, y: 0.001, z: 0.001} + m_ConstrainProportionsScale: 1 + m_Children: [] + m_Father: {fileID: 33536572583887604} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 0, y: -0.025} + m_SizeDelta: {x: 250, y: 50} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &3434672324534858807 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4451045791079530586} + m_CullTransparentMesh: 1 +--- !u!114 &420668000673399792 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4451045791079530586} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_text: 'UUID: + + From: + + To:' + m_isRightToLeft: 0 + m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} + m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} + m_fontSharedMaterials: [] + m_fontMaterial: {fileID: 0} + m_fontMaterials: [] + m_fontColor32: + serializedVersion: 2 + rgba: 4294967295 + m_fontColor: {r: 1, g: 1, b: 1, a: 1} + m_enableVertexGradient: 0 + m_colorMode: 3 + m_fontColorGradient: + topLeft: {r: 1, g: 1, b: 1, a: 1} + topRight: {r: 1, g: 1, b: 1, a: 1} + bottomLeft: {r: 1, g: 1, b: 1, a: 1} + bottomRight: {r: 1, g: 1, b: 1, a: 1} + m_fontColorGradientPreset: {fileID: 0} + m_spriteAsset: {fileID: 0} + m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: -1183493901 + m_overrideHtmlColors: 0 + m_faceColor: + serializedVersion: 2 + rgba: 4294967295 + m_fontSize: 16 + m_fontSizeBase: 16 + m_fontWeight: 400 + m_enableAutoSizing: 0 + m_fontSizeMin: 18 + m_fontSizeMax: 72 + m_fontStyle: 0 + m_HorizontalAlignment: 1 + m_VerticalAlignment: 256 + m_textAlignment: 65535 + m_characterSpacing: 0 + m_wordSpacing: 0 + m_lineSpacing: 0 + m_lineSpacingMax: 0 + m_paragraphSpacing: 0 + m_charWidthMaxAdj: 0 + m_enableWordWrapping: 1 + m_wordWrappingRatios: 0.4 + m_overflowMode: 0 + m_linkedTextComponent: {fileID: 0} + parentLinkedComponent: {fileID: 0} + m_enableKerning: 1 + m_enableExtraPadding: 0 + checkPaddingRequired: 0 + m_isRichText: 1 + m_parseCtrlCharacters: 1 + m_isOrthographic: 1 + m_isCullingEnabled: 0 + m_horizontalMapping: 0 + m_verticalMapping: 0 + m_uvLineOffset: 0 + m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 + m_VertexBufferAutoSizeReduction: 0 + m_useMaxVisibleDescender: 1 + m_pageToDisplay: 1 + m_margin: {x: 0, y: 0, z: 0, w: 0} + m_isUsingLegacyAnimationComponent: 0 + m_isVolumetricText: 0 + m_hasFontAssetChanged: 0 + m_baseMaterial: {fileID: 0} + m_maskOffset: {x: 0, y: 0, z: 0, w: 0} +--- !u!1 &5897666007833324009 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 8156859587808685068} + - component: {fileID: 1360188677730577841} + - component: {fileID: 3860478840123770047} + m_Layer: 5 + m_Name: Headline + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &8156859587808685068 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5897666007833324009} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0.001, y: 0.001, z: 0.001} + m_ConstrainProportionsScale: 1 + m_Children: [] + m_Father: {fileID: 33536572583887604} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 0, y: 0.02} + m_SizeDelta: {x: 250, y: 25} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &1360188677730577841 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5897666007833324009} + m_CullTransparentMesh: 1 +--- !u!114 &3860478840123770047 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5897666007833324009} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_text: AR World Link + m_isRightToLeft: 0 + m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} + m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} + m_fontSharedMaterials: [] + m_fontMaterial: {fileID: 0} + m_fontMaterials: [] + m_fontColor32: + serializedVersion: 2 + rgba: 4294967295 + m_fontColor: {r: 1, g: 1, b: 1, a: 1} + m_enableVertexGradient: 0 + m_colorMode: 3 + m_fontColorGradient: + topLeft: {r: 1, g: 1, b: 1, a: 1} + topRight: {r: 1, g: 1, b: 1, a: 1} + bottomLeft: {r: 1, g: 1, b: 1, a: 1} + bottomRight: {r: 1, g: 1, b: 1, a: 1} + m_fontColorGradientPreset: {fileID: 0} + m_spriteAsset: {fileID: 0} + m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: -1183493901 + m_overrideHtmlColors: 0 + m_faceColor: + serializedVersion: 2 + rgba: 4294967295 + m_fontSize: 24 + m_fontSizeBase: 24 + m_fontWeight: 400 + m_enableAutoSizing: 0 + m_fontSizeMin: 18 + m_fontSizeMax: 72 + m_fontStyle: 1 + m_HorizontalAlignment: 1 + m_VerticalAlignment: 256 + m_textAlignment: 65535 + m_characterSpacing: 0 + m_wordSpacing: 0 + m_lineSpacing: 0 + m_lineSpacingMax: 0 + m_paragraphSpacing: 0 + m_charWidthMaxAdj: 0 + m_enableWordWrapping: 1 + m_wordWrappingRatios: 0.4 + m_overflowMode: 0 + m_linkedTextComponent: {fileID: 0} + parentLinkedComponent: {fileID: 0} + m_enableKerning: 1 + m_enableExtraPadding: 0 + checkPaddingRequired: 0 + m_isRichText: 1 + m_parseCtrlCharacters: 1 + m_isOrthographic: 1 + m_isCullingEnabled: 0 + m_horizontalMapping: 0 + m_verticalMapping: 0 + m_uvLineOffset: 0 + m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 + m_VertexBufferAutoSizeReduction: 0 + m_useMaxVisibleDescender: 1 + m_pageToDisplay: 1 + m_margin: {x: 0, y: 0, z: 0, w: 0} + m_isUsingLegacyAnimationComponent: 0 + m_isVolumetricText: 0 + m_hasFontAssetChanged: 0 + m_baseMaterial: {fileID: 0} + m_maskOffset: {x: 0, y: 0, z: 0, w: 0} +--- !u!1 &8182691244837652424 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4532241398218188797} + m_Layer: 0 + m_Name: Axe + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4532241398218188797 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8182691244837652424} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 8225488253825437765} + m_Father: {fileID: 1814829793678878270} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &8225488253825437761 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 8225488253825437765} + - component: {fileID: 8225488253825437764} + - component: {fileID: 8225488253825437763} + - component: {fileID: 8225488253825437762} + m_Layer: 0 + m_Name: Center + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &8225488253825437765 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8225488253825437761} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0.1, y: 0.1, z: 0.1} + m_ConstrainProportionsScale: 1 + m_Children: [] + m_Father: {fileID: 4532241398218188797} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &8225488253825437764 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8225488253825437761} + m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &8225488253825437763 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8225488253825437761} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: ce02d83032448a945ac827316ba8bb87, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!65 &8225488253825437762 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8225488253825437761} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!1 &8292506020522815698 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 33536572583887604} + - component: {fileID: 1417027443369488948} + - component: {fileID: 1035955511594240086} + - component: {fileID: 5661858723465099382} + m_Layer: 5 + m_Name: Canvas + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &33536572583887604 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8292506020522815698} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 8156859587808685068} + - {fileID: 2888022835692577799} + m_Father: {fileID: 1814829793678878270} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0.1263, y: -0.1} + m_SizeDelta: {x: 640, y: 480} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!223 &1417027443369488948 +Canvas: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8292506020522815698} + m_Enabled: 1 + serializedVersion: 3 + m_RenderMode: 2 + m_Camera: {fileID: 0} + m_PlaneDistance: 100 + m_PixelPerfect: 0 + m_ReceivesEvents: 1 + m_OverrideSorting: 0 + m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_AdditionalShaderChannelsFlag: 25 + m_SortingLayerID: 0 + m_SortingOrder: 0 + m_TargetDisplay: 0 +--- !u!114 &1035955511594240086 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8292506020522815698} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UiScaleMode: 0 + m_ReferencePixelsPerUnit: 100 + m_ScaleFactor: 1 + m_ReferenceResolution: {x: 800, y: 600} + m_ScreenMatchMode: 0 + m_MatchWidthOrHeight: 0 + m_PhysicalUnit: 3 + m_FallbackScreenDPI: 96 + m_DefaultSpriteDPI: 96 + m_DynamicPixelsPerUnit: 1 + m_PresetInfoIsWorld: 1 +--- !u!114 &5661858723465099382 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8292506020522815698} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreReversedGraphics: 1 + m_BlockingObjects: 0 + m_BlockingMask: + serializedVersion: 2 + m_Bits: 4294967295 diff --git a/Runtime/Prefabs/ARFWorldLink.prefab.meta b/Runtime/Prefabs/ARFWorldLink.prefab.meta new file mode 100644 index 0000000000000000000000000000000000000000..7c41f4e2831d8613ffa1308ed382a5742f1dc4a6 --- /dev/null +++ b/Runtime/Prefabs/ARFWorldLink.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: fbd37f7ee889c994a913eeca05e0501f +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/Resources.meta b/Runtime/Resources.meta new file mode 100644 index 0000000000000000000000000000000000000000..f531d88e65aa5e54b557807af106d7dcee571057 --- /dev/null +++ b/Runtime/Resources.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f07b85312ef176543b32402edd2bdb8a +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/Resources/ARFPrefabs.asset b/Runtime/Resources/ARFPrefabs.asset new file mode 100644 index 0000000000000000000000000000000000000000..9190b5a8381d85742ca69a44a7d107638837f8c9 --- /dev/null +++ b/Runtime/Resources/ARFPrefabs.asset @@ -0,0 +1,17 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1aec4cd1383f70e4092183ea55088e8e, type: 3} + m_Name: ARFPrefabs + m_EditorClassIdentifier: + trackablePrefab: {fileID: 1239500166128132140, guid: 889bc3e43608e504c977b93ba5f8ed37, type: 3} + worldAnchorPrefab: {fileID: 8473238451594182910, guid: 832a64407eb5c8249bb8e4a074649918, type: 3} + worldLinkPrefab: {fileID: 1239500166128132140, guid: fbd37f7ee889c994a913eeca05e0501f, type: 3} diff --git a/Runtime/Resources/ARFPrefabs.asset.meta b/Runtime/Resources/ARFPrefabs.asset.meta new file mode 100644 index 0000000000000000000000000000000000000000..a377b92ac1ae4d71f01bfa5f1ceb36f054ee85f2 --- /dev/null +++ b/Runtime/Resources/ARFPrefabs.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: cc22d9e73b4dcca4da1f7bdd0321a3d2 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/Scenes/OpenAPITest.cs b/Runtime/Scenes/OpenAPITest.cs index a9f75a636b6caaf923b5867876a66d434f96be03..e4298c6f64e14a6455a8e8a88bda60aef43d5219 100644 --- a/Runtime/Scenes/OpenAPITest.cs +++ b/Runtime/Scenes/OpenAPITest.cs @@ -15,6 +15,7 @@ public class OpenAPITest : MonoBehaviour public TMP_Text servername; public TMP_Text output; + private string serverState = "-"; private string msg = null; private Queue handleResponseQ = new Queue(); @@ -41,7 +42,7 @@ public class OpenAPITest : MonoBehaviour if (o is ResponseObject) { ResponseObject response = o as ResponseObject; - output.text = $"Request Time: { response.requestTime.ToLongTimeString() } / Total Time: { response.DeltaTime.TotalMilliseconds }ms\n\nContent:\n{ response.result }"; + output.text = $"Server State:\n\n{ serverState }"; } else if (o is ResponseObject) { @@ -62,7 +63,7 @@ public class OpenAPITest : MonoBehaviour } } - public void OnButtonClick_TestPing() + public void OnButtonClick_ServerTest() { if (server == null) { @@ -70,11 +71,23 @@ public class OpenAPITest : MonoBehaviour return; } - ResponseObject token = AdminRequest.PingAsync(server, (response) => + serverState = $"Requesting server state @ time: { DateTime.Now.ToLongTimeString() }...\n"; + + AdminRequest.PingAsync(server, (response1) => { - handleResponseQ.Enqueue(response); + serverState += $"\nSending: Ping\n Receiving: { response1.result }\n Req time: { response1.requestTime.ToLongTimeString() } Tot time: { response1.DeltaTime.TotalMilliseconds }"; + handleResponseQ.Enqueue(response1); + }); + AdminRequest.AdminAsync(server, (response2) => + { + serverState += $"\nSending: Admin\n Receiving: { response2.result }\n Req time: { response2.requestTime.ToLongTimeString() } Tot time: { response2.DeltaTime.TotalMilliseconds }"; + handleResponseQ.Enqueue(response2); + }); + AdminRequest.VersionAsync(server, (response3) => + { + serverState += $"\nSending: Version\n Receiving: { response3.result }\n Req time: { response3.requestTime.ToLongTimeString() } Tot time: { response3.DeltaTime.TotalMilliseconds }"; + handleResponseQ.Enqueue(response3); }); - output.text = "Starting request @ time: " + token.requestTime.ToLongTimeString() + "..."; } public void OnButtonClick_GetLastTrackable() @@ -106,7 +119,7 @@ public class OpenAPITest : MonoBehaviour return; } - ResponseObject> token = TrackableRequest.GetTrackablesAsync(server, (response) => + ResponseObject token = TrackableRequest.GetTrackablesAsync(server, (response) => { handleResponseQ.Enqueue(response); }); @@ -123,9 +136,9 @@ public class OpenAPITest : MonoBehaviour Trackable tr = new Trackable(DateTime.Now.ToFileTime().ToString()); tr.TrackableType = TrackableType.OTHER; - ResponseObject token = TrackableRequest.CreateTrackableAsync(server, tr, (response) => + ResponseObject token = TrackableRequest.CreateTrackableAsync(server, tr, (response) => { - lastUUID = Guid.Parse(response.result); + lastUUID = Guid.Parse(response.result.Message); handleResponseQ.Enqueue(response); }); lastUUID = Guid.Empty; @@ -148,9 +161,9 @@ public class OpenAPITest : MonoBehaviour ResponseObject token = TrackableRequest.GetTrackableAsync(server, lastUUID, (response) => { response.result.Name += "'"; - ResponseObject token = TrackableRequest.UpdateTrackableAsync(server, response.result, (response) => + ResponseObject token = TrackableRequest.UpdateTrackableAsync(server, response.result, (response) => { - handleResponseQ.Enqueue(response); + handleResponseQ.Enqueue(response.result.Message); }); }); } @@ -169,9 +182,9 @@ public class OpenAPITest : MonoBehaviour return; } - ResponseObject token = TrackableRequest.DeleteTrackableAsync(server, lastUUID, (response) => + ResponseObject token = TrackableRequest.DeleteTrackableAsync(server, lastUUID, (response) => { - handleResponseQ.Enqueue(response); + handleResponseQ.Enqueue(response.result.Message); lastUUID = Guid.Empty; }); } diff --git a/Runtime/Scenes/Package Test.unity b/Runtime/Scenes/Package Test.unity index 607faa70b9331a2829b5cd4e1879460aa1a110b6..a112c3dd89404531579600ba5face55788dd86f1 100644 --- a/Runtime/Scenes/Package Test.unity +++ b/Runtime/Scenes/Package Test.unity @@ -38,7 +38,7 @@ RenderSettings: m_ReflectionIntensity: 1 m_CustomReflection: {fileID: 0} m_Sun: {fileID: 0} - m_IndirectSpecularColor: {r: 0.44402242, g: 0.49316543, b: 0.5722324, a: 1} + m_IndirectSpecularColor: {r: 0.18028378, g: 0.22571412, b: 0.30692285, a: 1} m_UseRadianceAmbientProbe: 0 --- !u!157 &3 LightmapSettings: @@ -189,8 +189,8 @@ MonoBehaviour: m_fontMaterials: [] m_fontColor32: serializedVersion: 2 - rgba: 4281479730 - m_fontColor: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} + rgba: 4278190080 + m_fontColor: {r: 0, g: 0, b: 0, a: 1} m_enableVertexGradient: 0 m_colorMode: 3 m_fontColorGradient: @@ -207,8 +207,8 @@ MonoBehaviour: m_faceColor: serializedVersion: 2 rgba: 4294967295 - m_fontSize: 36 - m_fontSizeBase: 36 + m_fontSize: 32 + m_fontSizeBase: 32 m_fontWeight: 400 m_enableAutoSizing: 0 m_fontSizeMin: 0 @@ -257,6 +257,179 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 67681887} m_CullTransparentMesh: 1 +--- !u!1 &181827838 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 181827839} + m_Layer: 0 + m_Name: c5dafaa0-a64e-44fc-98a7-f0f60bd181b0 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &181827839 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 181827838} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 976672958} + - {fileID: 1650656169} + m_Father: {fileID: 1006052647} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &216668784 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 216668785} + - component: {fileID: 216668788} + - component: {fileID: 216668787} + - component: {fileID: 216668786} + m_Layer: 0 + m_Name: Center + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &216668785 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 216668784} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0.1, y: 0.1, z: 0.1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 313423862} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!65 &216668786 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 216668784} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 0 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 3 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &216668787 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 216668784} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 4f607925b7a7fcc44806b35f5aa087a4, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!33 &216668788 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 216668784} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &313423861 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 313423862} + m_Layer: 0 + m_Name: Axe + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &313423862 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 313423861} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 216668785} + - {fileID: 1877813050} + - {fileID: 2116690940} + - {fileID: 1685018303} + m_Father: {fileID: 1035254689} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &395487864 GameObject: m_ObjectHideFlags: 0 @@ -399,8 +572,8 @@ MonoBehaviour: m_fontMaterials: [] m_fontColor32: serializedVersion: 2 - rgba: 4281479730 - m_fontColor: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} + rgba: 4278190080 + m_fontColor: {r: 0, g: 0, b: 0, a: 1} m_enableVertexGradient: 0 m_colorMode: 3 m_fontColorGradient: @@ -417,8 +590,8 @@ MonoBehaviour: m_faceColor: serializedVersion: 2 rgba: 4294967295 - m_fontSize: 36 - m_fontSizeBase: 36 + m_fontSize: 32 + m_fontSizeBase: 32 m_fontWeight: 400 m_enableAutoSizing: 0 m_fontSizeMin: 0 @@ -480,7 +653,7 @@ GameObject: - component: {fileID: 485599440} - component: {fileID: 485599439} m_Layer: 5 - m_Name: Button Ping + m_Name: Button WS State m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -551,8 +724,8 @@ MonoBehaviour: m_PersistentCalls: m_Calls: - m_Target: {fileID: 2123268211} - m_TargetAssemblyTypeName: OpenAPITest, Assembly-CSharp - m_MethodName: OnButtonClick_TestPing + m_TargetAssemblyTypeName: OpenAPITest, etsi.isg.arf.worldstorage + m_MethodName: OnButtonClick_ServerTest m_Mode: 1 m_Arguments: m_ObjectArgument: {fileID: 0} @@ -611,7 +784,7 @@ GameObject: - component: {fileID: 491226576} - component: {fileID: 491226577} m_Layer: 5 - m_Name: Buttons + m_Name: UI m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -643,7 +816,7 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: 32, y: -200} + m_AnchoredPosition: {x: 32, y: 0} m_SizeDelta: {x: -64, y: 400} m_Pivot: {x: 0, y: 1} --- !u!114 &491226577 @@ -938,6 +1111,111 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 517791554} m_CullTransparentMesh: 1 +--- !u!1 &607234448 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 607234449} + - component: {fileID: 607234452} + - component: {fileID: 607234451} + - component: {fileID: 607234450} + m_Layer: 0 + m_Name: Center + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &607234449 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 607234448} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 1, z: 0, w: 0} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0.1, y: 0.1, z: 0.1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 976672958} + m_LocalEulerAnglesHint: {x: 0, y: 180, z: 0} +--- !u!65 &607234450 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 607234448} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 0 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 3 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &607234451 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 607234448} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 730ea8fe50af5874fb3b990c534eaebc, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!33 &607234452 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 607234448} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} --- !u!1 &768727573 GameObject: m_ObjectHideFlags: 0 @@ -995,7 +1273,7 @@ MonoBehaviour: m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] - m_text: Request trackables + m_text: Request all trackables m_isRightToLeft: 0 m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} @@ -1004,8 +1282,8 @@ MonoBehaviour: m_fontMaterials: [] m_fontColor32: serializedVersion: 2 - rgba: 4281479730 - m_fontColor: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} + rgba: 4278190080 + m_fontColor: {r: 0, g: 0, b: 0, a: 1} m_enableVertexGradient: 0 m_colorMode: 3 m_fontColorGradient: @@ -1022,8 +1300,8 @@ MonoBehaviour: m_faceColor: serializedVersion: 2 rgba: 4294967295 - m_fontSize: 36 - m_fontSizeBase: 36 + m_fontSize: 32 + m_fontSizeBase: 32 m_fontWeight: 400 m_enableAutoSizing: 0 m_fontSizeMin: 0 @@ -1307,6 +1585,107 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 925389933} m_CullTransparentMesh: 1 +--- !u!1 &976672957 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 976672958} + m_Layer: 0 + m_Name: Axe + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &976672958 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 976672957} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 607234449} + - {fileID: 1580568510} + - {fileID: 1802205027} + - {fileID: 1614791896} + m_Father: {fileID: 181827839} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1006052646 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1006052647} + m_Layer: 0 + m_Name: ARF Visuals + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1006052647 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1006052646} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 1035254689} + - {fileID: 181827839} + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1035254688 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1035254689} + m_Layer: 0 + m_Name: 80153adf-b32c-4f77-a374-b20a92c822d1 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1035254689 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1035254688} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 313423862} + - {fileID: 1564988513} + m_Father: {fileID: 1006052647} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &1064828074 GameObject: m_ObjectHideFlags: 0 @@ -1373,8 +1752,8 @@ MonoBehaviour: m_fontMaterials: [] m_fontColor32: serializedVersion: 2 - rgba: 4281479730 - m_fontColor: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} + rgba: 4278190080 + m_fontColor: {r: 0, g: 0, b: 0, a: 1} m_enableVertexGradient: 0 m_colorMode: 3 m_fontColorGradient: @@ -1391,8 +1770,8 @@ MonoBehaviour: m_faceColor: serializedVersion: 2 rgba: 4294967295 - m_fontSize: 36 - m_fontSizeBase: 36 + m_fontSize: 32 + m_fontSizeBase: 32 m_fontWeight: 400 m_enableAutoSizing: 0 m_fontSizeMin: 0 @@ -1441,7 +1820,7 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1064828074} m_CullTransparentMesh: 1 ---- !u!1 &1144814801 +--- !u!1 &1087987906 GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -1449,42 +1828,42 @@ GameObject: m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - - component: {fileID: 1144814802} - - component: {fileID: 1144814804} - - component: {fileID: 1144814803} + - component: {fileID: 1087987907} + - component: {fileID: 1087987909} + - component: {fileID: 1087987908} m_Layer: 5 - m_Name: Label + m_Name: Text m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!224 &1144814802 +--- !u!224 &1087987907 RectTransform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1144814801} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_GameObject: {fileID: 1087987906} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 + m_LocalScale: {x: 0.001, y: 0.001, z: 0.001} + m_ConstrainProportionsScale: 1 m_Children: [] - m_Father: {fileID: 491226576} + m_Father: {fileID: 1650656169} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 100} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 0, y: -0.025} + m_SizeDelta: {x: 250, y: 50} m_Pivot: {x: 0.5, y: 0.5} ---- !u!114 &1144814803 +--- !u!114 &1087987908 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1144814801} + m_GameObject: {fileID: 1087987906} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3} @@ -1498,7 +1877,9 @@ MonoBehaviour: m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] - m_text: 'Response:' + m_text: 'Name: Default Anchor + + UUID: c5dafaa0-a64e-44fc-98a7-f0f60bd181b0' m_isRightToLeft: 0 m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} @@ -1525,15 +1906,15 @@ MonoBehaviour: m_faceColor: serializedVersion: 2 rgba: 4294967295 - m_fontSize: 36 - m_fontSizeBase: 36 + m_fontSize: 16 + m_fontSizeBase: 16 m_fontWeight: 400 m_enableAutoSizing: 0 m_fontSizeMin: 18 m_fontSizeMax: 72 - m_fontStyle: 4 + m_fontStyle: 0 m_HorizontalAlignment: 1 - m_VerticalAlignment: 512 + m_VerticalAlignment: 256 m_textAlignment: 65535 m_characterSpacing: 0 m_wordSpacing: 0 @@ -1567,15 +1948,15 @@ MonoBehaviour: m_hasFontAssetChanged: 0 m_baseMaterial: {fileID: 0} m_maskOffset: {x: 0, y: 0, z: 0, w: 0} ---- !u!222 &1144814804 +--- !u!222 &1087987909 CanvasRenderer: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1144814801} + m_GameObject: {fileID: 1087987906} m_CullTransparentMesh: 1 ---- !u!1 &1270536908 +--- !u!1 &1144814801 GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -1583,23 +1964,23 @@ GameObject: m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - - component: {fileID: 1270536909} - - component: {fileID: 1270536911} - - component: {fileID: 1270536910} + - component: {fileID: 1144814802} + - component: {fileID: 1144814804} + - component: {fileID: 1144814803} m_Layer: 5 - m_Name: Server + m_Name: Label m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!224 &1270536909 +--- !u!224 &1144814802 RectTransform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1270536908} + m_GameObject: {fileID: 1144814801} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} @@ -1612,13 +1993,13 @@ RectTransform: m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 100} m_Pivot: {x: 0.5, y: 0.5} ---- !u!114 &1270536910 +--- !u!114 &1144814803 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1270536908} + m_GameObject: {fileID: 1144814801} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3} @@ -1632,7 +2013,7 @@ MonoBehaviour: m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] - m_text: 'ARF Server: -' + m_text: 'Response:' m_isRightToLeft: 0 m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} @@ -1665,7 +2046,7 @@ MonoBehaviour: m_enableAutoSizing: 0 m_fontSizeMin: 18 m_fontSizeMax: 72 - m_fontStyle: 1 + m_fontStyle: 4 m_HorizontalAlignment: 1 m_VerticalAlignment: 512 m_textAlignment: 65535 @@ -1701,15 +2082,15 @@ MonoBehaviour: m_hasFontAssetChanged: 0 m_baseMaterial: {fileID: 0} m_maskOffset: {x: 0, y: 0, z: 0, w: 0} ---- !u!222 &1270536911 +--- !u!222 &1144814804 CanvasRenderer: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1270536908} + m_GameObject: {fileID: 1144814801} m_CullTransparentMesh: 1 ---- !u!1 &1534925206 +--- !u!1 &1176403628 GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -1717,131 +2098,1167 @@ GameObject: m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - - component: {fileID: 1534925207} - - component: {fileID: 1534925210} - - component: {fileID: 1534925209} - - component: {fileID: 1534925208} + - component: {fileID: 1176403629} + - component: {fileID: 1176403631} + - component: {fileID: 1176403630} m_Layer: 5 - m_Name: Button Update trackable + m_Name: Headline m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!224 &1534925207 +--- !u!224 &1176403629 RectTransform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1534925206} + m_GameObject: {fileID: 1176403628} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0.001, y: 0.001, z: 0.001} + m_ConstrainProportionsScale: 1 + m_Children: [] + m_Father: {fileID: 1650656169} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 0, y: 0.02} + m_SizeDelta: {x: 250, y: 25} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1176403630 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1176403628} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_text: AR World Anchor + m_isRightToLeft: 0 + m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} + m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} + m_fontSharedMaterials: [] + m_fontMaterial: {fileID: 0} + m_fontMaterials: [] + m_fontColor32: + serializedVersion: 2 + rgba: 4294967295 + m_fontColor: {r: 1, g: 1, b: 1, a: 1} + m_enableVertexGradient: 0 + m_colorMode: 3 + m_fontColorGradient: + topLeft: {r: 1, g: 1, b: 1, a: 1} + topRight: {r: 1, g: 1, b: 1, a: 1} + bottomLeft: {r: 1, g: 1, b: 1, a: 1} + bottomRight: {r: 1, g: 1, b: 1, a: 1} + m_fontColorGradientPreset: {fileID: 0} + m_spriteAsset: {fileID: 0} + m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: -1183493901 + m_overrideHtmlColors: 0 + m_faceColor: + serializedVersion: 2 + rgba: 4294967295 + m_fontSize: 24 + m_fontSizeBase: 24 + m_fontWeight: 400 + m_enableAutoSizing: 0 + m_fontSizeMin: 18 + m_fontSizeMax: 72 + m_fontStyle: 1 + m_HorizontalAlignment: 1 + m_VerticalAlignment: 256 + m_textAlignment: 65535 + m_characterSpacing: 0 + m_wordSpacing: 0 + m_lineSpacing: 0 + m_lineSpacingMax: 0 + m_paragraphSpacing: 0 + m_charWidthMaxAdj: 0 + m_enableWordWrapping: 1 + m_wordWrappingRatios: 0.4 + m_overflowMode: 0 + m_linkedTextComponent: {fileID: 0} + parentLinkedComponent: {fileID: 0} + m_enableKerning: 1 + m_enableExtraPadding: 0 + checkPaddingRequired: 0 + m_isRichText: 1 + m_parseCtrlCharacters: 1 + m_isOrthographic: 1 + m_isCullingEnabled: 0 + m_horizontalMapping: 0 + m_verticalMapping: 0 + m_uvLineOffset: 0 + m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 + m_VertexBufferAutoSizeReduction: 0 + m_useMaxVisibleDescender: 1 + m_pageToDisplay: 1 + m_margin: {x: 0, y: 0, z: 0, w: 0} + m_isUsingLegacyAnimationComponent: 0 + m_isVolumetricText: 0 + m_hasFontAssetChanged: 0 + m_baseMaterial: {fileID: 0} + m_maskOffset: {x: 0, y: 0, z: 0, w: 0} +--- !u!222 &1176403631 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1176403628} + m_CullTransparentMesh: 1 +--- !u!1 &1270536908 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1270536909} + - component: {fileID: 1270536911} + - component: {fileID: 1270536910} + m_Layer: 5 + m_Name: Server + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1270536909 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1270536908} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 1 - m_Children: - - {fileID: 1864481863} + m_ConstrainProportionsScale: 0 + m_Children: [] m_Father: {fileID: 491226576} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 80} + m_SizeDelta: {x: 0, y: 100} m_Pivot: {x: 0.5, y: 0.5} ---- !u!114 &1534925208 +--- !u!114 &1270536910 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1534925206} + m_GameObject: {fileID: 1270536908} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3} + m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3} m_Name: m_EditorClassIdentifier: - m_Navigation: - m_Mode: 3 - m_WrapAround: 0 - m_SelectOnUp: {fileID: 0} - m_SelectOnDown: {fileID: 0} - m_SelectOnLeft: {fileID: 0} - m_SelectOnRight: {fileID: 0} - m_Transition: 1 - m_Colors: - m_NormalColor: {r: 1, g: 1, b: 1, a: 1} - m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} - m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} - m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} - m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} - m_ColorMultiplier: 1 - m_FadeDuration: 0.1 - m_SpriteState: - m_HighlightedSprite: {fileID: 0} - m_PressedSprite: {fileID: 0} - m_SelectedSprite: {fileID: 0} - m_DisabledSprite: {fileID: 0} - m_AnimationTriggers: - m_NormalTrigger: Normal - m_HighlightedTrigger: Highlighted - m_PressedTrigger: Pressed - m_SelectedTrigger: Selected - m_DisabledTrigger: Disabled - m_Interactable: 1 - m_TargetGraphic: {fileID: 1534925209} - m_OnClick: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: m_PersistentCalls: - m_Calls: - - m_Target: {fileID: 2123268211} - m_TargetAssemblyTypeName: OpenAPITest, Assembly-CSharp - m_MethodName: OnButtonClick_UpdateLastTrackable - m_Mode: 1 - m_Arguments: - m_ObjectArgument: {fileID: 0} - m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine - m_IntArgument: 0 - m_FloatArgument: 0 - m_StringArgument: - m_BoolArgument: 0 - m_CallState: 2 ---- !u!114 &1534925209 -MonoBehaviour: + m_Calls: [] + m_text: 'ARF Server: -' + m_isRightToLeft: 0 + m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} + m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} + m_fontSharedMaterials: [] + m_fontMaterial: {fileID: 0} + m_fontMaterials: [] + m_fontColor32: + serializedVersion: 2 + rgba: 4294967295 + m_fontColor: {r: 1, g: 1, b: 1, a: 1} + m_enableVertexGradient: 0 + m_colorMode: 3 + m_fontColorGradient: + topLeft: {r: 1, g: 1, b: 1, a: 1} + topRight: {r: 1, g: 1, b: 1, a: 1} + bottomLeft: {r: 1, g: 1, b: 1, a: 1} + bottomRight: {r: 1, g: 1, b: 1, a: 1} + m_fontColorGradientPreset: {fileID: 0} + m_spriteAsset: {fileID: 0} + m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: -1183493901 + m_overrideHtmlColors: 0 + m_faceColor: + serializedVersion: 2 + rgba: 4294967295 + m_fontSize: 36 + m_fontSizeBase: 36 + m_fontWeight: 400 + m_enableAutoSizing: 0 + m_fontSizeMin: 18 + m_fontSizeMax: 72 + m_fontStyle: 1 + m_HorizontalAlignment: 1 + m_VerticalAlignment: 512 + m_textAlignment: 65535 + m_characterSpacing: 0 + m_wordSpacing: 0 + m_lineSpacing: 0 + m_lineSpacingMax: 0 + m_paragraphSpacing: 0 + m_charWidthMaxAdj: 0 + m_enableWordWrapping: 1 + m_wordWrappingRatios: 0.4 + m_overflowMode: 0 + m_linkedTextComponent: {fileID: 0} + parentLinkedComponent: {fileID: 0} + m_enableKerning: 1 + m_enableExtraPadding: 0 + checkPaddingRequired: 0 + m_isRichText: 1 + m_parseCtrlCharacters: 1 + m_isOrthographic: 1 + m_isCullingEnabled: 0 + m_horizontalMapping: 0 + m_verticalMapping: 0 + m_uvLineOffset: 0 + m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 + m_VertexBufferAutoSizeReduction: 0 + m_useMaxVisibleDescender: 1 + m_pageToDisplay: 1 + m_margin: {x: 0, y: 0, z: 0, w: 0} + m_isUsingLegacyAnimationComponent: 0 + m_isVolumetricText: 0 + m_hasFontAssetChanged: 0 + m_baseMaterial: {fileID: 0} + m_maskOffset: {x: 0, y: 0, z: 0, w: 0} +--- !u!222 &1270536911 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1270536908} + m_CullTransparentMesh: 1 +--- !u!1 &1371016666 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1371016667} + - component: {fileID: 1371016669} + - component: {fileID: 1371016668} + m_Layer: 5 + m_Name: Headline + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1371016667 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1371016666} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0.001, y: 0.001, z: 0.001} + m_ConstrainProportionsScale: 1 + m_Children: [] + m_Father: {fileID: 1564988513} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 0, y: 0.02} + m_SizeDelta: {x: 250, y: 25} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1371016668 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1371016666} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_text: AR Trackable + m_isRightToLeft: 0 + m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} + m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} + m_fontSharedMaterials: [] + m_fontMaterial: {fileID: 0} + m_fontMaterials: [] + m_fontColor32: + serializedVersion: 2 + rgba: 4294967295 + m_fontColor: {r: 1, g: 1, b: 1, a: 1} + m_enableVertexGradient: 0 + m_colorMode: 3 + m_fontColorGradient: + topLeft: {r: 1, g: 1, b: 1, a: 1} + topRight: {r: 1, g: 1, b: 1, a: 1} + bottomLeft: {r: 1, g: 1, b: 1, a: 1} + bottomRight: {r: 1, g: 1, b: 1, a: 1} + m_fontColorGradientPreset: {fileID: 0} + m_spriteAsset: {fileID: 0} + m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: -1183493901 + m_overrideHtmlColors: 0 + m_faceColor: + serializedVersion: 2 + rgba: 4294967295 + m_fontSize: 24 + m_fontSizeBase: 24 + m_fontWeight: 400 + m_enableAutoSizing: 0 + m_fontSizeMin: 18 + m_fontSizeMax: 72 + m_fontStyle: 1 + m_HorizontalAlignment: 1 + m_VerticalAlignment: 256 + m_textAlignment: 65535 + m_characterSpacing: 0 + m_wordSpacing: 0 + m_lineSpacing: 0 + m_lineSpacingMax: 0 + m_paragraphSpacing: 0 + m_charWidthMaxAdj: 0 + m_enableWordWrapping: 1 + m_wordWrappingRatios: 0.4 + m_overflowMode: 0 + m_linkedTextComponent: {fileID: 0} + parentLinkedComponent: {fileID: 0} + m_enableKerning: 1 + m_enableExtraPadding: 0 + checkPaddingRequired: 0 + m_isRichText: 1 + m_parseCtrlCharacters: 1 + m_isOrthographic: 1 + m_isCullingEnabled: 0 + m_horizontalMapping: 0 + m_verticalMapping: 0 + m_uvLineOffset: 0 + m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 + m_VertexBufferAutoSizeReduction: 0 + m_useMaxVisibleDescender: 1 + m_pageToDisplay: 1 + m_margin: {x: 0, y: 0, z: 0, w: 0} + m_isUsingLegacyAnimationComponent: 0 + m_isVolumetricText: 0 + m_hasFontAssetChanged: 0 + m_baseMaterial: {fileID: 0} + m_maskOffset: {x: 0, y: 0, z: 0, w: 0} +--- !u!222 &1371016669 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1371016666} + m_CullTransparentMesh: 1 +--- !u!1 &1534925206 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1534925207} + - component: {fileID: 1534925210} + - component: {fileID: 1534925209} + - component: {fileID: 1534925208} + m_Layer: 5 + m_Name: Button Update trackable + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1534925207 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1534925206} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 1 + m_Children: + - {fileID: 1864481863} + m_Father: {fileID: 491226576} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 80} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1534925208 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1534925206} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_WrapAround: 0 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_SelectedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_SelectedTrigger: Selected + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 1534925209} + m_OnClick: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 2123268211} + m_TargetAssemblyTypeName: OpenAPITest, Assembly-CSharp + m_MethodName: OnButtonClick_UpdateLastTrackable + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 +--- !u!114 &1534925209 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1534925206} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 0.25 +--- !u!222 &1534925210 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1534925206} + m_CullTransparentMesh: 1 +--- !u!1 &1564988512 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1564988513} + - component: {fileID: 1564988516} + - component: {fileID: 1564988515} + - component: {fileID: 1564988514} + m_Layer: 5 + m_Name: Canvas + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1564988513 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1564988512} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 1371016667} + - {fileID: 2028750463} + m_Father: {fileID: 1035254689} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0.1263, y: -0.1} + m_SizeDelta: {x: 640, y: 480} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1564988514 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1564988512} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreReversedGraphics: 1 + m_BlockingObjects: 0 + m_BlockingMask: + serializedVersion: 2 + m_Bits: 4294967295 +--- !u!114 &1564988515 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1564988512} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UiScaleMode: 0 + m_ReferencePixelsPerUnit: 100 + m_ScaleFactor: 1 + m_ReferenceResolution: {x: 800, y: 600} + m_ScreenMatchMode: 0 + m_MatchWidthOrHeight: 0 + m_PhysicalUnit: 3 + m_FallbackScreenDPI: 96 + m_DefaultSpriteDPI: 96 + m_DynamicPixelsPerUnit: 1 + m_PresetInfoIsWorld: 1 +--- !u!223 &1564988516 +Canvas: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1564988512} + m_Enabled: 1 + serializedVersion: 3 + m_RenderMode: 2 + m_Camera: {fileID: 0} + m_PlaneDistance: 100 + m_PixelPerfect: 0 + m_ReceivesEvents: 1 + m_OverrideSorting: 0 + m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_VertexColorAlwaysGammaSpace: 0 + m_AdditionalShaderChannelsFlag: 25 + m_UpdateRectTransformForStandalone: 0 + m_SortingLayerID: 0 + m_SortingOrder: 0 + m_TargetDisplay: 0 +--- !u!1 &1580568509 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1580568510} + - component: {fileID: 1580568513} + - component: {fileID: 1580568512} + - component: {fileID: 1580568511} + m_Layer: 0 + m_Name: X + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1580568510 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1580568509} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: 0.7071068, w: 0.7071068} + m_LocalPosition: {x: 0.1, y: 0, z: 0} + m_LocalScale: {x: 0.019999998, y: 0.05000001, z: 0.020000001} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 976672958} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90} +--- !u!136 &1580568511 +CapsuleCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1580568509} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 0 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.5000001 + m_Height: 2 + m_Direction: 1 + m_Center: {x: 0.000000059604645, y: 0, z: -0.00000008940697} +--- !u!23 &1580568512 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1580568509} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 0c6a9f85031693343a9e37c4a08627e9, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!33 &1580568513 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1580568509} + m_Mesh: {fileID: 10206, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &1614791895 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1614791896} + - component: {fileID: 1614791899} + - component: {fileID: 1614791898} + - component: {fileID: 1614791897} + m_Layer: 0 + m_Name: Z + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1614791896 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1614791895} + serializedVersion: 2 + m_LocalRotation: {x: 0.7071068, y: -0, z: -0, w: 0.7071068} + m_LocalPosition: {x: 0, y: 0, z: 0.1} + m_LocalScale: {x: 0.020000001, y: 0.05000001, z: 0.019999998} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 976672958} + m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} +--- !u!136 &1614791897 +CapsuleCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1614791895} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 0 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.5000001 + m_Height: 2 + m_Direction: 1 + m_Center: {x: 0.000000059604645, y: 0, z: -0.00000008940697} +--- !u!23 &1614791898 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1614791895} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 1b6b868784cd25c46a90fe7b882fddb2, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!33 &1614791899 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1614791895} + m_Mesh: {fileID: 10206, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &1650656168 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1650656169} + - component: {fileID: 1650656172} + - component: {fileID: 1650656171} + - component: {fileID: 1650656170} + m_Layer: 5 + m_Name: Canvas + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1650656169 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1650656168} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 1176403629} + - {fileID: 1087987907} + m_Father: {fileID: 181827839} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0.1263, y: -0.1} + m_SizeDelta: {x: 640, y: 480} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1650656170 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1650656168} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreReversedGraphics: 1 + m_BlockingObjects: 0 + m_BlockingMask: + serializedVersion: 2 + m_Bits: 4294967295 +--- !u!114 &1650656171 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1650656168} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UiScaleMode: 0 + m_ReferencePixelsPerUnit: 100 + m_ScaleFactor: 1 + m_ReferenceResolution: {x: 800, y: 600} + m_ScreenMatchMode: 0 + m_MatchWidthOrHeight: 0 + m_PhysicalUnit: 3 + m_FallbackScreenDPI: 96 + m_DefaultSpriteDPI: 96 + m_DynamicPixelsPerUnit: 1 + m_PresetInfoIsWorld: 1 +--- !u!223 &1650656172 +Canvas: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1650656168} + m_Enabled: 1 + serializedVersion: 3 + m_RenderMode: 2 + m_Camera: {fileID: 0} + m_PlaneDistance: 100 + m_PixelPerfect: 0 + m_ReceivesEvents: 1 + m_OverrideSorting: 0 + m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_VertexColorAlwaysGammaSpace: 0 + m_AdditionalShaderChannelsFlag: 25 + m_UpdateRectTransformForStandalone: 0 + m_SortingLayerID: 0 + m_SortingOrder: 0 + m_TargetDisplay: 0 +--- !u!1 &1685018302 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1685018303} + - component: {fileID: 1685018306} + - component: {fileID: 1685018305} + - component: {fileID: 1685018304} + m_Layer: 0 + m_Name: Z + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1685018303 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1685018302} + serializedVersion: 2 + m_LocalRotation: {x: 0.7071068, y: -0, z: -0, w: 0.7071068} + m_LocalPosition: {x: 0, y: 0, z: 0.1} + m_LocalScale: {x: 0.020000001, y: 0.05000001, z: 0.019999998} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 313423862} + m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} +--- !u!136 &1685018304 +CapsuleCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1685018302} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 0 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.5000001 + m_Height: 2 + m_Direction: 1 + m_Center: {x: 0.000000059604645, y: 0, z: -0.00000008940697} +--- !u!23 &1685018305 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1685018302} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 1b6b868784cd25c46a90fe7b882fddb2, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!33 &1685018306 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1685018302} + m_Mesh: {fileID: 10206, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &1802205026 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1802205027} + - component: {fileID: 1802205030} + - component: {fileID: 1802205029} + - component: {fileID: 1802205028} + m_Layer: 0 + m_Name: Y + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1802205027 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1802205026} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0.1, z: 0} + m_LocalScale: {x: 0.020000001, y: 0.05, z: 0.020000001} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 976672958} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!136 &1802205028 +CapsuleCollider: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1534925206} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} - m_Name: - m_EditorClassIdentifier: + m_GameObject: {fileID: 1802205026} m_Material: {fileID: 0} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 1 - m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} - m_Maskable: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0} - m_Type: 1 - m_PreserveAspect: 0 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 0 - m_UseSpriteMesh: 0 - m_PixelsPerUnitMultiplier: 0.25 ---- !u!222 &1534925210 -CanvasRenderer: + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 0 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.5000001 + m_Height: 2 + m_Direction: 1 + m_Center: {x: 0.000000059604645, y: 0, z: -0.00000008940697} +--- !u!23 &1802205029 +MeshRenderer: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1534925206} - m_CullTransparentMesh: 1 + m_GameObject: {fileID: 1802205026} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 19de5bd9483daf448a5fab21d3eecba3, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!33 &1802205030 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1802205026} + m_Mesh: {fileID: 10206, guid: 0000000000000000e000000000000000, type: 0} --- !u!1 &1809658683 GameObject: m_ObjectHideFlags: 0 @@ -2042,8 +3459,8 @@ MonoBehaviour: m_fontMaterials: [] m_fontColor32: serializedVersion: 2 - rgba: 4281479730 - m_fontColor: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} + rgba: 4278190080 + m_fontColor: {r: 0, g: 0, b: 0, a: 1} m_enableVertexGradient: 0 m_colorMode: 3 m_fontColorGradient: @@ -2060,8 +3477,8 @@ MonoBehaviour: m_faceColor: serializedVersion: 2 rgba: 4294967295 - m_fontSize: 36 - m_fontSizeBase: 36 + m_fontSize: 32 + m_fontSizeBase: 32 m_fontWeight: 400 m_enableAutoSizing: 0 m_fontSizeMin: 0 @@ -2110,6 +3527,113 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1864481862} m_CullTransparentMesh: 1 +--- !u!1 &1877813049 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1877813050} + - component: {fileID: 1877813053} + - component: {fileID: 1877813052} + - component: {fileID: 1877813051} + m_Layer: 0 + m_Name: X + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1877813050 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1877813049} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: 0.7071068, w: 0.7071068} + m_LocalPosition: {x: 0.1, y: 0, z: 0} + m_LocalScale: {x: 0.019999998, y: 0.05000001, z: 0.020000001} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 313423862} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90} +--- !u!136 &1877813051 +CapsuleCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1877813049} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 0 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.5000001 + m_Height: 2 + m_Direction: 1 + m_Center: {x: 0.000000059604645, y: 0, z: -0.00000008940697} +--- !u!23 &1877813052 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1877813049} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 0c6a9f85031693343a9e37c4a08627e9, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!33 &1877813053 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1877813049} + m_Mesh: {fileID: 10206, guid: 0000000000000000e000000000000000, type: 0} --- !u!1 &1900725046 GameObject: m_ObjectHideFlags: 0 @@ -2145,7 +3669,7 @@ Camera: m_GameObject: {fileID: 1900725046} m_Enabled: 1 serializedVersion: 2 - m_ClearFlags: 1 + m_ClearFlags: 2 m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} m_projectionMatrixMode: 1 m_GateFitMode: 2 @@ -2380,8 +3904,8 @@ MonoBehaviour: m_faceColor: serializedVersion: 2 rgba: 4294967295 - m_fontSize: 36 - m_fontSizeBase: 36 + m_fontSize: 30 + m_fontSizeBase: 30 m_fontWeight: 400 m_enableAutoSizing: 0 m_fontSizeMin: 18 @@ -2563,6 +4087,142 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1996377110} m_CullTransparentMesh: 1 +--- !u!1 &2028750462 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2028750463} + - component: {fileID: 2028750465} + - component: {fileID: 2028750464} + m_Layer: 5 + m_Name: Text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &2028750463 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2028750462} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0.001, y: 0.001, z: 0.001} + m_ConstrainProportionsScale: 1 + m_Children: [] + m_Father: {fileID: 1564988513} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 0, y: -0.025} + m_SizeDelta: {x: 250, y: 50} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &2028750464 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2028750462} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_text: 'Name: Default Trackable 111 + + UUID: 80153adf-b32c-4f77-a374-b20a92c822d1' + m_isRightToLeft: 0 + m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} + m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} + m_fontSharedMaterials: [] + m_fontMaterial: {fileID: 0} + m_fontMaterials: [] + m_fontColor32: + serializedVersion: 2 + rgba: 4294967295 + m_fontColor: {r: 1, g: 1, b: 1, a: 1} + m_enableVertexGradient: 0 + m_colorMode: 3 + m_fontColorGradient: + topLeft: {r: 1, g: 1, b: 1, a: 1} + topRight: {r: 1, g: 1, b: 1, a: 1} + bottomLeft: {r: 1, g: 1, b: 1, a: 1} + bottomRight: {r: 1, g: 1, b: 1, a: 1} + m_fontColorGradientPreset: {fileID: 0} + m_spriteAsset: {fileID: 0} + m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: -1183493901 + m_overrideHtmlColors: 0 + m_faceColor: + serializedVersion: 2 + rgba: 4294967295 + m_fontSize: 16 + m_fontSizeBase: 16 + m_fontWeight: 400 + m_enableAutoSizing: 0 + m_fontSizeMin: 18 + m_fontSizeMax: 72 + m_fontStyle: 0 + m_HorizontalAlignment: 1 + m_VerticalAlignment: 256 + m_textAlignment: 65535 + m_characterSpacing: 0 + m_wordSpacing: 0 + m_lineSpacing: 0 + m_lineSpacingMax: 0 + m_paragraphSpacing: 0 + m_charWidthMaxAdj: 0 + m_enableWordWrapping: 1 + m_wordWrappingRatios: 0.4 + m_overflowMode: 0 + m_linkedTextComponent: {fileID: 0} + parentLinkedComponent: {fileID: 0} + m_enableKerning: 1 + m_enableExtraPadding: 0 + checkPaddingRequired: 0 + m_isRichText: 1 + m_parseCtrlCharacters: 1 + m_isOrthographic: 1 + m_isCullingEnabled: 0 + m_horizontalMapping: 0 + m_verticalMapping: 0 + m_uvLineOffset: 0 + m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 + m_VertexBufferAutoSizeReduction: 0 + m_useMaxVisibleDescender: 1 + m_pageToDisplay: 1 + m_margin: {x: 0, y: 0, z: 0, w: 0} + m_isUsingLegacyAnimationComponent: 0 + m_isVolumetricText: 0 + m_hasFontAssetChanged: 0 + m_baseMaterial: {fileID: 0} + m_maskOffset: {x: 0, y: 0, z: 0, w: 0} +--- !u!222 &2028750465 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2028750462} + m_CullTransparentMesh: 1 --- !u!1 &2040736466 GameObject: m_ObjectHideFlags: 0 @@ -2688,7 +4348,7 @@ MonoBehaviour: m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] - m_text: Ping + m_text: Get WS server state m_isRightToLeft: 0 m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} @@ -2697,8 +4357,8 @@ MonoBehaviour: m_fontMaterials: [] m_fontColor32: serializedVersion: 2 - rgba: 4281479730 - m_fontColor: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} + rgba: 4278190080 + m_fontColor: {r: 0, g: 0, b: 0, a: 1} m_enableVertexGradient: 0 m_colorMode: 3 m_fontColorGradient: @@ -2715,8 +4375,8 @@ MonoBehaviour: m_faceColor: serializedVersion: 2 rgba: 4294967295 - m_fontSize: 36 - m_fontSizeBase: 36 + m_fontSize: 32 + m_fontSizeBase: 32 m_fontWeight: 400 m_enableAutoSizing: 0 m_fontSizeMin: 0 @@ -2765,6 +4425,113 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 2095380537} m_CullTransparentMesh: 1 +--- !u!1 &2116690939 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2116690940} + - component: {fileID: 2116690943} + - component: {fileID: 2116690942} + - component: {fileID: 2116690941} + m_Layer: 0 + m_Name: Y + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &2116690940 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2116690939} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0.1, z: 0} + m_LocalScale: {x: 0.020000001, y: 0.05, z: 0.020000001} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 313423862} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!136 &2116690941 +CapsuleCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2116690939} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 0 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.5000001 + m_Height: 2 + m_Direction: 1 + m_Center: {x: 0.000000059604645, y: 0, z: -0.00000008940697} +--- !u!23 &2116690942 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2116690939} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 19de5bd9483daf448a5fab21d3eecba3, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!33 &2116690943 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2116690939} + m_Mesh: {fileID: 10206, guid: 0000000000000000e000000000000000, type: 0} --- !u!1 &2123268210 GameObject: m_ObjectHideFlags: 0 @@ -2794,7 +4561,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 8d8b78014fb03e94c90db2fa1a2fde7b, type: 3} m_Name: m_EditorClassIdentifier: - server: {fileID: 11400000, guid: e58ba3b536eb26a4d899273c538c88e7, type: 2} + server: {fileID: 11400000, guid: db0064cecabb1b244a4e158d43602781, type: 2} servername: {fileID: 1270536910} output: {fileID: 1973593797} --- !u!4 &2123268212 @@ -2821,3 +4588,4 @@ SceneRoots: - {fileID: 2040736469} - {fileID: 2123268212} - {fileID: 846631106} + - {fileID: 1006052647} diff --git a/Runtime/Scenes/User ETSI.asset b/Runtime/Scenes/User ETSI.asset new file mode 100644 index 0000000000000000000000000000000000000000..a88ab2ed91e13613b2bee90e5b03add81207b325 --- /dev/null +++ b/Runtime/Scenes/User ETSI.asset @@ -0,0 +1,17 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 8a1e3e7961eae84468e6ee20d5b09ffd, type: 3} + m_Name: User ETSI + m_EditorClassIdentifier: + userName: ARF User + company: ETSI Org + UUID: 5090fd9f-64bf-4e06-843f-26aaf2eb8e40 diff --git a/Runtime/Scenes/User ETSI.asset.meta b/Runtime/Scenes/User ETSI.asset.meta new file mode 100644 index 0000000000000000000000000000000000000000..08ca9e2d3c36b090cbfc41bcaee32ab41173ad70 --- /dev/null +++ b/Runtime/Scenes/User ETSI.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 748585a50399fd64883147cd731ae0b7 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/Scriptables/WorldStorageServer.cs b/Runtime/Scriptables/WorldStorageServer.cs index 8b09622c9f69c1303323b762b3f273b7badd7d00..01a2f1d42046d1650561590d1bf88a4d03569ead 100644 --- a/Runtime/Scriptables/WorldStorageServer.cs +++ b/Runtime/Scriptables/WorldStorageServer.cs @@ -1,7 +1,7 @@ // // ARF - Augmented Reality Framework (ETSI ISG ARF) // -// Copyright 2022 ETSI +// Copyright 2024 ETSI // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/Runtime/Scriptables/WorldStorageUser.cs b/Runtime/Scriptables/WorldStorageUser.cs index d00b20a52fcb1805a73e8da2924c23769608d87f..cce62479ed72be1c722ba133dd048f9de9001518 100644 --- a/Runtime/Scriptables/WorldStorageUser.cs +++ b/Runtime/Scriptables/WorldStorageUser.cs @@ -1,7 +1,7 @@ // // ARF - Augmented Reality Framework (ETSI ISG ARF) // -// Copyright 2022 ETSI +// Copyright 2024 ETSI // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/Runtime/Scripts/GraphEditor.meta b/Runtime/Scripts/GraphEditor.meta new file mode 100644 index 0000000000000000000000000000000000000000..de46d1dc3d987c63064953d062ff37c0847ccb9b --- /dev/null +++ b/Runtime/Scripts/GraphEditor.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b080491b321d38844bf995a06e92b5e0 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/Scripts/GraphEditor/AttachToWorldAnchor.cs b/Runtime/Scripts/GraphEditor/AttachToWorldAnchor.cs new file mode 100644 index 0000000000000000000000000000000000000000..852b8a70bad36898f89de6bbf8d8c2b13e282197 --- /dev/null +++ b/Runtime/Scripts/GraphEditor/AttachToWorldAnchor.cs @@ -0,0 +1,29 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace ETSI.ARF.WorldStorage.UI +{ + [ExecuteAlways] + public class AttachToWorldAnchor : MonoBehaviour + { + public GameObject worldAnchor; + public bool autoUpdate = true; + + private void Update() + { + if (autoUpdate && worldAnchor != null) + { + transform.position = worldAnchor.transform.position; + transform.rotation = worldAnchor.transform.rotation; + } + } + + void OnDrawGizmos() + { +#if UNITY_EDITOR + // do something... +#endif + } + } +} diff --git a/Runtime/Scripts/GraphEditor/AttachToWorldAnchor.cs.meta b/Runtime/Scripts/GraphEditor/AttachToWorldAnchor.cs.meta new file mode 100644 index 0000000000000000000000000000000000000000..b5689716424bf2feeab8ca414beedd05241f4b7c --- /dev/null +++ b/Runtime/Scripts/GraphEditor/AttachToWorldAnchor.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 53275cee00d69114f926dc2b69bb4e53 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/Scripts/GraphEditor/Data.cs b/Runtime/Scripts/GraphEditor/Data.cs new file mode 100644 index 0000000000000000000000000000000000000000..57da6033dbdfadb3fb32292f5bfa190ac5c25c72 --- /dev/null +++ b/Runtime/Scripts/GraphEditor/Data.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using ETSI.ARF.OpenAPI.WorldStorage; + +namespace ETSI.ARF.OpenAPI +{ + public struct Data + { + public Dictionary list; + + public int Count => list.Count; + public int PreCount { get; set; } + }; + +} diff --git a/Runtime/Scripts/GraphEditor/Data.cs.meta b/Runtime/Scripts/GraphEditor/Data.cs.meta new file mode 100644 index 0000000000000000000000000000000000000000..f62618b865aee4674e9641852369ff1ab976d4d4 --- /dev/null +++ b/Runtime/Scripts/GraphEditor/Data.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: eb8e8851570d3a14883c7798cbe1e1da +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/Scripts/GraphEditor/LinkVisual.cs b/Runtime/Scripts/GraphEditor/LinkVisual.cs new file mode 100644 index 0000000000000000000000000000000000000000..48515cbcbc2fe8f9848d3a826e6c77180035e220 --- /dev/null +++ b/Runtime/Scripts/GraphEditor/LinkVisual.cs @@ -0,0 +1,36 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace ETSI.ARF.WorldStorage.UI +{ + [ExecuteAlways] + public class LinkVisual : MonoBehaviour + { + public GameObject fromElement, toElement; + + + private void Update() + { +#if UNITY_EDITOR + if (fromElement != null && toElement != null) transform.position = (fromElement.transform.position + toElement.transform.position) / 2; +#endif + } + + void OnDrawGizmos() + { +#if UNITY_EDITOR + if (fromElement != null && toElement != null) + { + // Draws a blue line from this transform to the target + Gizmos.color = Color.blue; + Gizmos.DrawLine(fromElement.transform.position, toElement.transform.position); + } + else + { + Debug.Log("Rien à tracer"); + } +#endif + } + } +} diff --git a/Runtime/Scripts/GraphEditor/LinkVisual.cs.meta b/Runtime/Scripts/GraphEditor/LinkVisual.cs.meta new file mode 100644 index 0000000000000000000000000000000000000000..07696e60173b3a64dcd58a8938004f264be883b8 --- /dev/null +++ b/Runtime/Scripts/GraphEditor/LinkVisual.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 33fce8a1d8d349d47b8565dfe031b6b1 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/Scripts/GraphEditor/WorldStorageCollections.cs b/Runtime/Scripts/GraphEditor/WorldStorageCollections.cs new file mode 100644 index 0000000000000000000000000000000000000000..e144bd4fb10d8ad097ab363109dfbbc364ca7a8c --- /dev/null +++ b/Runtime/Scripts/GraphEditor/WorldStorageCollections.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using ETSI.ARF.OpenAPI.WorldStorage; +using UnityEngine; +using System.IO; +using ETSI.ARF.OpenAPI; + +namespace ETSI.ARF.WorldStorage +{ + public class WorldStorageCollections + { + // MongoDB collections + // Contains list after response from REST server + public Data trackables = new Data(); + public Data worldAnchors = new Data(); + public Data worldLinks = new Data(); + + public WorldStorageCollections() + { + trackables.list = new Dictionary(); + worldAnchors.list = new Dictionary(); + worldLinks.list = new Dictionary(); + } + } +} diff --git a/Runtime/Scripts/GraphEditor/WorldStorageCollections.cs.meta b/Runtime/Scripts/GraphEditor/WorldStorageCollections.cs.meta new file mode 100644 index 0000000000000000000000000000000000000000..c15e91143d1b7ec33f314deec6ac390a28469738 --- /dev/null +++ b/Runtime/Scripts/GraphEditor/WorldStorageCollections.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a5b322b539094934193f20b797fab02a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/Scripts/GraphEditor/WorldStorageRequest.cs b/Runtime/Scripts/GraphEditor/WorldStorageRequest.cs new file mode 100644 index 0000000000000000000000000000000000000000..4b6999f8f7da02353635f84e7fcbd64b4b7e47c0 --- /dev/null +++ b/Runtime/Scripts/GraphEditor/WorldStorageRequest.cs @@ -0,0 +1,167 @@ +// The Fraunhofer HHI Unity Framework +// ___________ .__ _____ ___ ___ ___ ___ .___ +// \_ _____/___________ __ __ ____ | |__ _____/ ____\___________ / | \ / | \| | +// | __) \_ __ \__ \ | | \/ \| | \ / _ \ __\/ __ \_ __ \ / ~ \/ ~ \ | +// | \ | | \// __ \| | / | \ Y ( <_> ) | \ ___/| | \/ \ Y /\ Y / | +// \___ / |__| (____ /____/|___| /___| /\____/|__| \___ >__| \___|_ / \___|_ /|___| +// \/ \/ \/ \/ \/ \/ \/ +// (C) Fraunhofer HHI, 2024 + +using System; +using System.IO; +using System.Net; +using System.Collections.Generic; +using System.Threading; +using System.Drawing; +using System.Threading.Tasks; +using UnityEngine; + +using ETSI.ARF.OpenAPI; +using ETSI.ARF.OpenAPI.WorldStorage; +using ETSI.ARF.WorldStorage.REST; + +namespace ETSI.ARF.WorldStorage +{ + /// + /// Manager class for OpenAPI REST calls. + /// This class insert create a response object with cancellation token for all call. + /// Also usefull for measuring the request-response time. + /// + public class WorldStorageRequest : WorldStorageCollections + { + private WorldStorageServer wsServer; + private WorldStorageClient apiClient; + private string serverUri; + + public string URI => serverUri; + public WorldStorageClient Client => apiClient; + + public WorldStorageRequest(WorldStorageServer server) : base() + { + wsServer = server; + serverUri = wsServer.URI; + var httpClient = new UnityWebRequestHttpClient(serverUri); + apiClient = new WorldStorageClient(httpClient); + } + + public WorldStorageRequest(string uri) : base() + { + wsServer = new WorldStorageServer(); + wsServer.basePath = uri; + wsServer.port = 0; + serverUri = uri; + var httpClient = new UnityWebRequestHttpClient(serverUri); + apiClient = new WorldStorageClient(httpClient); + } + + // + // Callback method + // Call the callback method defined by the calling class when the result is there. + // + #region Callbacks + private void ReceiveTextCallback(Task t, object id) + { + if (t.IsCompleted) + { + string res = t.Result; + + ResponseObject o = (ResponseObject)id; + o.responseTime = DateTime.Now; + o.result = res; + Debug.Log($"[REST] Server Response = {o.result} (#{o.transactionId}, {o.message})"); + + o.callback?.Invoke(o); + } + else Debug.Log("[REST] OpenAPI Timeout!"); + } + + private void ReceiveTrackableCallback(Task t, object id) + { + if (t.IsCompleted) + { + ResponseObject o = (ResponseObject)id; + o.responseTime = DateTime.Now; + o.result = t.Result; + Debug.Log($"[REST] Server Response = Got asset (#{o.transactionId}, {o.message})"); + + o.callback?.Invoke(o); + } + else Debug.Log("[REST] OpenAPI Timeout!"); + } + #endregion + + // + // Admin requests + // + #region Handle admin requests + public string Ping() => apiClient.GetPing(); + + public ResponseObject PingAsync(Action> func) + { + return AdminRequest.PingAsync(wsServer, func); + } + + public string Status() => apiClient.GetAdmin(); + + public ResponseObject StatusAsync(Action> func) + { + return AdminRequest.AdminAsync(wsServer, func); + } + + public string Version() => apiClient.GetVersion(); + public Task GetVersion() => apiClient.GetVersionAsync(); + + public ResponseObject VersionAsync(Action> func) + { + return AdminRequest.VersionAsync(wsServer, func); + } + #endregion + + // + // TRACKABLES + // + #region Trackables + + //public Task GetNumOfAssets() => apiClient.NumOfAssetsAsync(); + //public bool IsAssetExists(Guid id) => apiClient.IsAssetId(id); + public ResponseObject AddTrackableAsync(Action> func, Trackable trackable) + { + return TrackableRequest.CreateTrackableAsync(wsServer, trackable, func); + } + + public ResponseObject DeleteTrackableAsync(Action> func, Guid id) + { + return TrackableRequest.DeleteTrackableAsync(wsServer, id, func); + } + + public ResponseObject ModifyTrackableAsync(Action> func, Trackable trackable) + { + return TrackableRequest.UpdateTrackableAsync(wsServer, trackable, func); + } + + public ResponseObject GetTrackableByIdAsync(Action> func, Guid id) + { + return TrackableRequest.GetTrackableAsync(wsServer, id, func); + } + + public ResponseObject GetTrackableListAsync(Action> func, int? max = 1) + { + return TrackableRequest.GetTrackablesAsync(wsServer, func); + } + #endregion + + + // + // Tools + // + #region Tools + public static float FloatParse(string stValue) + { + float v = 0; + float.TryParse(stValue, System.Globalization.NumberStyles.AllowDecimalPoint | System.Globalization.NumberStyles.AllowLeadingSign, System.Globalization.CultureInfo.InvariantCulture, out v); + return v; + } + + #endregion + } +} diff --git a/Runtime/Scripts/GraphEditor/WorldStorageRequest.cs.meta b/Runtime/Scripts/GraphEditor/WorldStorageRequest.cs.meta new file mode 100644 index 0000000000000000000000000000000000000000..78ca79bd06d57eb53cbbc82f3320fd48674dee8f --- /dev/null +++ b/Runtime/Scripts/GraphEditor/WorldStorageRequest.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7dc0c152448d1cc41ade67c36e145ff2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/Scripts/OpenAPI/BaseClient.cs b/Runtime/Scripts/OpenAPI/BaseClient.cs new file mode 100644 index 0000000000000000000000000000000000000000..3bdc50bc76ec6ca0e77160020c7d1b558a5e58d1 --- /dev/null +++ b/Runtime/Scripts/OpenAPI/BaseClient.cs @@ -0,0 +1,38 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace ETSI.ARF.OpenAPI +{ + /// + /// Simple class to debug the requests + /// + public class BaseClient + { + static public bool EnableClientLog = false; + public string lastJsonText; + public long lastPayload; + + protected void _prepareRequest(ETSI.ARF.OpenAPI.WorldStorage.IHttpClient client, System.Net.Http.HttpRequestMessage request, string url) + { + if (EnableClientLog) + { + Debug.Log("[REST][URL] Send request: " + client.BaseAddress + url); + Debug.Log("[REST][URL] Send request: " + request); + } + } + + protected void _processResponse(ETSI.ARF.OpenAPI.WorldStorage.IHttpClient client, System.Net.Http.HttpResponseMessage response) + { + lastJsonText = response.Content.ReadAsStringAsync().Result.ToString(); + lastPayload = response.Content.Headers.ContentLength.Value; + + var status_ = (int)response.StatusCode; + + if (EnableClientLog) + { + Debug.Log("[REST][Data] Status: " + status_ + " Response: " + client.BaseAddress + " Len: " + lastPayload + " JSON: " + lastJsonText); + } + } + } +} \ No newline at end of file diff --git a/Runtime/Scripts/OpenAPI/BaseClient.cs.meta b/Runtime/Scripts/OpenAPI/BaseClient.cs.meta new file mode 100644 index 0000000000000000000000000000000000000000..d0fa65b74142f62c9658bf318199fef6d72addd7 --- /dev/null +++ b/Runtime/Scripts/OpenAPI/BaseClient.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2e0af995ecbb4654a9191f8157a1cf0e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/Scripts/OpenAPI/DataModels.cs b/Runtime/Scripts/OpenAPI/DataModels.cs index d017018f2a55c03d3380daaf4354d6c8d5d1a32e..c3f776ea4ccc0d67155c2b335575ddd27f7e17bf 100644 --- a/Runtime/Scripts/OpenAPI/DataModels.cs +++ b/Runtime/Scripts/OpenAPI/DataModels.cs @@ -8,6 +8,23 @@ namespace ETSI.ARF.OpenAPI.WorldStorage public interface IModel { public System.Guid UUID { get; set; } + + public string ToJson(); + } + + // Class to monitor the server + public class Server : IModel + { + public System.Guid UUID { get; set; } + public string Name { get; set; } + + public Server(string name) + { + UUID = Guid.Empty; + Name = name; + } + + public string ToJson() { return Newtonsoft.Json.JsonConvert.SerializeObject(this); } } // @@ -20,6 +37,8 @@ namespace ETSI.ARF.OpenAPI.WorldStorage UUID = Guid.NewGuid(); Name = name; } + + public string ToJson() { return Newtonsoft.Json.JsonConvert.SerializeObject(this); } } public partial class WorldAnchor : IModel @@ -29,6 +48,8 @@ namespace ETSI.ARF.OpenAPI.WorldStorage UUID = Guid.NewGuid(); Name = name; } + + public string ToJson() { return Newtonsoft.Json.JsonConvert.SerializeObject(this); } } public partial class WorldLink : IModel @@ -37,5 +58,7 @@ namespace ETSI.ARF.OpenAPI.WorldStorage { UUID = Guid.NewGuid(); } + + public string ToJson() { return Newtonsoft.Json.JsonConvert.SerializeObject(this); } } } \ No newline at end of file diff --git a/Runtime/Scripts/OpenAPI/Generated/WorldStorageOpenAPI.cs b/Runtime/Scripts/OpenAPI/Generated/WorldStorageOpenAPI.cs index a61b2ae2fe85ebdba436fac4c3dfb7cafaf0152a..df770434f5f429f67d4fe2850afcacb3fbbc1aa1 100644 --- a/Runtime/Scripts/OpenAPI/Generated/WorldStorageOpenAPI.cs +++ b/Runtime/Scripts/OpenAPI/Generated/WorldStorageOpenAPI.cs @@ -1,6 +1,6 @@ //---------------------- // -// Generated using the NSwag toolchain v14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0)) (http://NSwag.org) +// Generated using the NSwag toolchain v14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0)) (http://NSwag.org) // //---------------------- @@ -8,6 +8,7 @@ #pragma warning disable 114 // Disable "CS0114 '{derivedDto}.RaisePropertyChanged(String)' hides inherited member 'dtoBase.RaisePropertyChanged(String)'. To make the current member override that implementation, add the override keyword. Otherwise add the new keyword." #pragma warning disable 472 // Disable "CS0472 The result of the expression is always 'false' since a value of type 'Int32' is never equal to 'null' of type 'Int32?' #pragma warning disable 612 // Disable "CS0612 '...' is obsolete" +#pragma warning disable 649 // Disable "CS0649 Field is never assigned to, and will always have its default value null" #pragma warning disable 1573 // Disable "CS1573 Parameter '...' has no matching param tag in the XML comment for ... #pragma warning disable 1591 // Disable "CS1591 Missing XML comment for publicly visible type or member ..." #pragma warning disable 8073 // Disable "CS8073 The result of the expression is always 'false' since a value of type 'T' is never equal to 'null' of type 'T?'" @@ -15,23 +16,25 @@ #pragma warning disable 8603 // Disable "CS8603 Possible null reference return" #pragma warning disable 8604 // Disable "CS8604 Possible null reference argument for parameter" #pragma warning disable 8625 // Disable "CS8625 Cannot convert null literal to non-nullable reference type" -#pragma warning disable CS8765 // Nullability of type of parameter doesn't match overridden member (possibly because of nullability attributes). +#pragma warning disable 8765 // Disable "CS8765 Nullability of type of parameter doesn't match overridden member (possibly because of nullability attributes)." namespace ETSI.ARF.OpenAPI.WorldStorage { using System = global::System; - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial class WorldStorageClient { - private ETSI.ARF.OpenAPI.IHttpClient _httpClient; + private ETSI.ARF.OpenAPI.WorldStorage.IHttpClient _httpClient; private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); + private Newtonsoft.Json.JsonSerializerSettings _instanceSettings; #pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable. - public WorldStorageClient(ETSI.ARF.OpenAPI.IHttpClient httpClient) + public WorldStorageClient(ETSI.ARF.OpenAPI.WorldStorage.IHttpClient httpClient) #pragma warning restore CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable. { _httpClient = httpClient; + Initialize(); } private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() @@ -41,13 +44,15 @@ namespace ETSI.ARF.OpenAPI.WorldStorage return settings; } - protected Newtonsoft.Json.JsonSerializerSettings JsonSerializerSettings { get { return _settings.Value; } } + protected Newtonsoft.Json.JsonSerializerSettings JsonSerializerSettings { get { return _instanceSettings ?? _settings.Value; } } static partial void UpdateJsonSerializerSettings(Newtonsoft.Json.JsonSerializerSettings settings); - partial void PrepareRequest(ETSI.ARF.OpenAPI.IHttpClient client, System.Net.Http.HttpRequestMessage request, string url); - partial void PrepareRequest(ETSI.ARF.OpenAPI.IHttpClient client, System.Net.Http.HttpRequestMessage request, System.Text.StringBuilder urlBuilder); - partial void ProcessResponse(ETSI.ARF.OpenAPI.IHttpClient client, System.Net.Http.HttpResponseMessage response); + partial void Initialize(); + + partial void PrepareRequest(ETSI.ARF.OpenAPI.WorldStorage.IHttpClient client, System.Net.Http.HttpRequestMessage request, string url); + partial void PrepareRequest(ETSI.ARF.OpenAPI.WorldStorage.IHttpClient client, System.Net.Http.HttpRequestMessage request, System.Text.StringBuilder urlBuilder); + partial void ProcessResponse(ETSI.ARF.OpenAPI.WorldStorage.IHttpClient client, System.Net.Http.HttpResponseMessage response); /// /// Test the server availability. @@ -329,7 +334,7 @@ namespace ETSI.ARF.OpenAPI.WorldStorage /// the list of all trackables and his encoding structure associated representing the supported data of the User /// Successful operation. /// A server side error occurred. - public virtual System.Threading.Tasks.Task GetRelocalizationInformationAsync(string token, System.Collections.Generic.IEnumerable uuids, System.Collections.Generic.IEnumerable capabilities) + public virtual System.Threading.Tasks.Task GetRelocalizationInformationAsync(string token, System.Collections.Generic.IEnumerable uuids, System.Collections.Generic.IEnumerable capabilities) { return GetRelocalizationInformationAsync(token, uuids, capabilities, System.Threading.CancellationToken.None); } @@ -341,7 +346,7 @@ namespace ETSI.ARF.OpenAPI.WorldStorage /// the list of all trackables and his encoding structure associated representing the supported data of the User /// Successful operation. /// A server side error occurred. - public virtual Response GetRelocalizationInformation(string token, System.Collections.Generic.IEnumerable uuids, System.Collections.Generic.IEnumerable capabilities) + public virtual RelocalizationInformations GetRelocalizationInformation(string token, System.Collections.Generic.IEnumerable uuids, System.Collections.Generic.IEnumerable capabilities) { return System.Threading.Tasks.Task.Run(async () => await GetRelocalizationInformationAsync(token, uuids, capabilities, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); } @@ -354,7 +359,7 @@ namespace ETSI.ARF.OpenAPI.WorldStorage /// the list of all trackables and his encoding structure associated representing the supported data of the User /// Successful operation. /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetRelocalizationInformationAsync(string token, System.Collections.Generic.IEnumerable uuids, System.Collections.Generic.IEnumerable capabilities, System.Threading.CancellationToken cancellationToken) + public virtual async System.Threading.Tasks.Task GetRelocalizationInformationAsync(string token, System.Collections.Generic.IEnumerable uuids, System.Collections.Generic.IEnumerable capabilities, System.Threading.CancellationToken cancellationToken) { if (uuids == null) throw new System.ArgumentNullException("uuids"); @@ -408,7 +413,7 @@ namespace ETSI.ARF.OpenAPI.WorldStorage var status_ = (int)response_.StatusCode; if (status_ == 200) { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) { throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); @@ -418,16 +423,32 @@ namespace ETSI.ARF.OpenAPI.WorldStorage else if (status_ == 400) { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = (string)System.Convert.ChangeType(responseData_, typeof(string)); - throw new ApiException("Invalid UUID supplied.", status_, responseData_, headers_, result_, null); + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("Invalid UUID supplied.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else if (status_ == 404) { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = (string)System.Convert.ChangeType(responseData_, typeof(string)); - throw new ApiException("Not found, could not find UUID in database.", status_, responseData_, headers_, result_, null); + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("Not found, could not find UUID in database.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 511) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("The secret token is not valid. Please ask an ISG ARF team member for a valid token.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else { @@ -462,7 +483,7 @@ namespace ETSI.ARF.OpenAPI.WorldStorage /// The Trackable to be added to the world storage. /// OK, return the UUID of the Trackable defined by the world storage. /// A server side error occurred. - public virtual System.Threading.Tasks.Task AddTrackableAsync(string token, Trackable body) + public virtual System.Threading.Tasks.Task AddTrackableAsync(string token, Trackable body) { return AddTrackableAsync(token, body, System.Threading.CancellationToken.None); } @@ -476,7 +497,7 @@ namespace ETSI.ARF.OpenAPI.WorldStorage /// The Trackable to be added to the world storage. /// OK, return the UUID of the Trackable defined by the world storage. /// A server side error occurred. - public virtual string AddTrackable(string token, Trackable body) + public virtual Success AddTrackable(string token, Trackable body) { return System.Threading.Tasks.Task.Run(async () => await AddTrackableAsync(token, body, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); } @@ -491,7 +512,7 @@ namespace ETSI.ARF.OpenAPI.WorldStorage /// The Trackable to be added to the world storage. /// OK, return the UUID of the Trackable defined by the world storage. /// A server side error occurred. - public virtual async System.Threading.Tasks.Task AddTrackableAsync(string token, Trackable body, System.Threading.CancellationToken cancellationToken) + public virtual async System.Threading.Tasks.Task AddTrackableAsync(string token, Trackable body, System.Threading.CancellationToken cancellationToken) { if (body == null) throw new System.ArgumentNullException("body"); @@ -505,12 +526,12 @@ namespace ETSI.ARF.OpenAPI.WorldStorage if (token != null) request_.Headers.TryAddWithoutValidation("token", ConvertToString(token, System.Globalization.CultureInfo.InvariantCulture)); - var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value); + var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, JsonSerializerSettings); var content_ = new System.Net.Http.StringContent(json_); content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); request_.Content = content_; request_.Method = new System.Net.Http.HttpMethod("POST"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain")); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); var urlBuilder_ = new System.Text.StringBuilder(); @@ -542,30 +563,42 @@ namespace ETSI.ARF.OpenAPI.WorldStorage var status_ = (int)response_.StatusCode; if (status_ == 200) { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = (string)System.Convert.ChangeType(responseData_, typeof(string)); - return result_; + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + return objectResponse_.Object; } else - if (status_ == 201) + if (status_ == 400) { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = (string)System.Convert.ChangeType(responseData_, typeof(string)); - return result_; + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("Bad request.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else - if (status_ == 400) + if (status_ == 409) { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = (string)System.Convert.ChangeType(responseData_, typeof(string)); - throw new ApiException("Bad request.", status_, responseData_, headers_, result_, null); + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("Invalid UUID, id must be a Nil value.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else - if (status_ == 409) + if (status_ == 511) { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = (string)System.Convert.ChangeType(responseData_, typeof(string)); - throw new ApiException("Invalid UUID, id must be a Nil value.", status_, responseData_, headers_, result_, null); + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("The secret token is not valid. Please ask an ISG ARF team member for a valid token.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else { @@ -598,9 +631,9 @@ namespace ETSI.ARF.OpenAPI.WorldStorage /// Modify an existing Trackable given a json object containing all the required information. <br> **Please note that ID of the object is required in the JSON** /// /// The Trackable to be modified in the world storage. - /// OK, return the UUID of the modified Trackable. + /// OK, return the UUID of the Trackable defined by the world storage. /// A server side error occurred. - public virtual System.Threading.Tasks.Task ModifyTrackableAsync(string token, Trackable body) + public virtual System.Threading.Tasks.Task ModifyTrackableAsync(string token, Trackable body) { return ModifyTrackableAsync(token, body, System.Threading.CancellationToken.None); } @@ -612,9 +645,9 @@ namespace ETSI.ARF.OpenAPI.WorldStorage /// Modify an existing Trackable given a json object containing all the required information. <br> **Please note that ID of the object is required in the JSON** /// /// The Trackable to be modified in the world storage. - /// OK, return the UUID of the modified Trackable. + /// OK, return the UUID of the Trackable defined by the world storage. /// A server side error occurred. - public virtual string ModifyTrackable(string token, Trackable body) + public virtual Success ModifyTrackable(string token, Trackable body) { return System.Threading.Tasks.Task.Run(async () => await ModifyTrackableAsync(token, body, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); } @@ -627,9 +660,9 @@ namespace ETSI.ARF.OpenAPI.WorldStorage /// Modify an existing Trackable given a json object containing all the required information. <br> **Please note that ID of the object is required in the JSON** /// /// The Trackable to be modified in the world storage. - /// OK, return the UUID of the modified Trackable. + /// OK, return the UUID of the Trackable defined by the world storage. /// A server side error occurred. - public virtual async System.Threading.Tasks.Task ModifyTrackableAsync(string token, Trackable body, System.Threading.CancellationToken cancellationToken) + public virtual async System.Threading.Tasks.Task ModifyTrackableAsync(string token, Trackable body, System.Threading.CancellationToken cancellationToken) { if (body == null) throw new System.ArgumentNullException("body"); @@ -643,12 +676,12 @@ namespace ETSI.ARF.OpenAPI.WorldStorage if (token != null) request_.Headers.TryAddWithoutValidation("token", ConvertToString(token, System.Globalization.CultureInfo.InvariantCulture)); - var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value); + var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, JsonSerializerSettings); var content_ = new System.Net.Http.StringContent(json_); content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); request_.Content = content_; request_.Method = new System.Net.Http.HttpMethod("PUT"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain")); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); var urlBuilder_ = new System.Text.StringBuilder(); @@ -680,23 +713,42 @@ namespace ETSI.ARF.OpenAPI.WorldStorage var status_ = (int)response_.StatusCode; if (status_ == 200) { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = (string)System.Convert.ChangeType(responseData_, typeof(string)); - return result_; + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + return objectResponse_.Object; } else if (status_ == 400) { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = (string)System.Convert.ChangeType(responseData_, typeof(string)); - throw new ApiException("Bad request.", status_, responseData_, headers_, result_, null); + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("Bad request.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else if (status_ == 404) { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = (string)System.Convert.ChangeType(responseData_, typeof(string)); - throw new ApiException("Not found, could not find UUID in database.", status_, responseData_, headers_, result_, null); + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("Not found, could not find UUID in database.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 511) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("The secret token is not valid. Please ask an ISG ARF team member for a valid token.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else { @@ -730,7 +782,7 @@ namespace ETSI.ARF.OpenAPI.WorldStorage /// /// OK, return all the Trackables defined by the world storage. /// A server side error occurred. - public virtual System.Threading.Tasks.Task> GetTrackablesAsync(string token) + public virtual System.Threading.Tasks.Task GetTrackablesAsync(string token) { return GetTrackablesAsync(token, System.Threading.CancellationToken.None); } @@ -743,7 +795,7 @@ namespace ETSI.ARF.OpenAPI.WorldStorage /// /// OK, return all the Trackables defined by the world storage. /// A server side error occurred. - public virtual System.Collections.Generic.List GetTrackables(string token) + public virtual TrackablesResponse GetTrackables(string token) { return System.Threading.Tasks.Task.Run(async () => await GetTrackablesAsync(token, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); } @@ -757,7 +809,7 @@ namespace ETSI.ARF.OpenAPI.WorldStorage /// /// OK, return all the Trackables defined by the world storage. /// A server side error occurred. - public virtual async System.Threading.Tasks.Task> GetTrackablesAsync(string token, System.Threading.CancellationToken cancellationToken) + public virtual async System.Threading.Tasks.Task GetTrackablesAsync(string token, System.Threading.CancellationToken cancellationToken) { var client_ = _httpClient; var disposeClient_ = false; @@ -801,7 +853,7 @@ namespace ETSI.ARF.OpenAPI.WorldStorage var status_ = (int)response_.StatusCode; if (status_ == 200) { - var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) { throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); @@ -809,11 +861,24 @@ namespace ETSI.ARF.OpenAPI.WorldStorage return objectResponse_.Object; } else - if (status_ == 201) + if (status_ == 401) { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = (string)System.Convert.ChangeType(responseData_, typeof(string)); - throw new ApiException("Null response.", status_, responseData_, headers_, result_, null); + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("Null response.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 511) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("The secret token is not valid. Please ask an ISG ARF team member for a valid token.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else { @@ -935,16 +1000,42 @@ namespace ETSI.ARF.OpenAPI.WorldStorage else if (status_ == 400) { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = (string)System.Convert.ChangeType(responseData_, typeof(string)); - throw new ApiException("Invalid UUID supplied.", status_, responseData_, headers_, result_, null); + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("Invalid UUID supplied.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 401) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("Null response.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else if (status_ == 404) { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = (string)System.Convert.ChangeType(responseData_, typeof(string)); - throw new ApiException("Not found, could not find UUID in database.", status_, responseData_, headers_, result_, null); + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("Not found, could not find UUID in database.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 511) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("The secret token is not valid. Please ask an ISG ARF team member for a valid token.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else { @@ -973,9 +1064,9 @@ namespace ETSI.ARF.OpenAPI.WorldStorage /// Delete a single Trackable stored in the world storage from its ID. /// /// Trackable UUID to delete. - /// OK, delete successful. + /// Success request. /// A server side error occurred. - public virtual System.Threading.Tasks.Task DeleteTrackableAsync(string token, System.Guid trackableUUID) + public virtual System.Threading.Tasks.Task DeleteTrackableAsync(string token, System.Guid trackableUUID) { return DeleteTrackableAsync(token, trackableUUID, System.Threading.CancellationToken.None); } @@ -987,9 +1078,9 @@ namespace ETSI.ARF.OpenAPI.WorldStorage /// Delete a single Trackable stored in the world storage from its ID. /// /// Trackable UUID to delete. - /// OK, delete successful. + /// Success request. /// A server side error occurred. - public virtual string DeleteTrackable(string token, System.Guid trackableUUID) + public virtual Success DeleteTrackable(string token, System.Guid trackableUUID) { return System.Threading.Tasks.Task.Run(async () => await DeleteTrackableAsync(token, trackableUUID, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); } @@ -1002,9 +1093,9 @@ namespace ETSI.ARF.OpenAPI.WorldStorage /// Delete a single Trackable stored in the world storage from its ID. /// /// Trackable UUID to delete. - /// OK, delete successful. + /// Success request. /// A server side error occurred. - public virtual async System.Threading.Tasks.Task DeleteTrackableAsync(string token, System.Guid trackableUUID, System.Threading.CancellationToken cancellationToken) + public virtual async System.Threading.Tasks.Task DeleteTrackableAsync(string token, System.Guid trackableUUID, System.Threading.CancellationToken cancellationToken) { if (trackableUUID == null) throw new System.ArgumentNullException("trackableUUID"); @@ -1019,7 +1110,7 @@ namespace ETSI.ARF.OpenAPI.WorldStorage if (token != null) request_.Headers.TryAddWithoutValidation("token", ConvertToString(token, System.Globalization.CultureInfo.InvariantCulture)); request_.Method = new System.Net.Http.HttpMethod("DELETE"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain")); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); var urlBuilder_ = new System.Text.StringBuilder(); @@ -1052,23 +1143,42 @@ namespace ETSI.ARF.OpenAPI.WorldStorage var status_ = (int)response_.StatusCode; if (status_ == 200) { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = (string)System.Convert.ChangeType(responseData_, typeof(string)); - return result_; + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + return objectResponse_.Object; } else if (status_ == 400) { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = (string)System.Convert.ChangeType(responseData_, typeof(string)); - throw new ApiException("Invalid UUID supplied.", status_, responseData_, headers_, result_, null); + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("Invalid UUID supplied.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else if (status_ == 404) { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = (string)System.Convert.ChangeType(responseData_, typeof(string)); - throw new ApiException("Not found, could not find UUID in database.", status_, responseData_, headers_, result_, null); + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("Not found, could not find UUID in database.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 511) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("The secret token is not valid. Please ask an ISG ARF team member for a valid token.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else { @@ -1097,9 +1207,9 @@ namespace ETSI.ARF.OpenAPI.WorldStorage /// Create a new World Anchor from a json object containing all the required information and add it to the world storage. <br>As a result you will get the ID of the newly created World Anchor. /// /// The World Anchor to be added to the world storage. - /// OK, return the UUID of the World Anchor defined by the world storage. + /// OK, return the UUID of the Trackable defined by the world storage. /// A server side error occurred. - public virtual System.Threading.Tasks.Task AddWorldAnchorAsync(string token, WorldAnchor body) + public virtual System.Threading.Tasks.Task AddWorldAnchorAsync(string token, WorldAnchor body) { return AddWorldAnchorAsync(token, body, System.Threading.CancellationToken.None); } @@ -1111,9 +1221,9 @@ namespace ETSI.ARF.OpenAPI.WorldStorage /// Create a new World Anchor from a json object containing all the required information and add it to the world storage. <br>As a result you will get the ID of the newly created World Anchor. /// /// The World Anchor to be added to the world storage. - /// OK, return the UUID of the World Anchor defined by the world storage. + /// OK, return the UUID of the Trackable defined by the world storage. /// A server side error occurred. - public virtual string AddWorldAnchor(string token, WorldAnchor body) + public virtual Success AddWorldAnchor(string token, WorldAnchor body) { return System.Threading.Tasks.Task.Run(async () => await AddWorldAnchorAsync(token, body, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); } @@ -1126,9 +1236,9 @@ namespace ETSI.ARF.OpenAPI.WorldStorage /// Create a new World Anchor from a json object containing all the required information and add it to the world storage. <br>As a result you will get the ID of the newly created World Anchor. /// /// The World Anchor to be added to the world storage. - /// OK, return the UUID of the World Anchor defined by the world storage. + /// OK, return the UUID of the Trackable defined by the world storage. /// A server side error occurred. - public virtual async System.Threading.Tasks.Task AddWorldAnchorAsync(string token, WorldAnchor body, System.Threading.CancellationToken cancellationToken) + public virtual async System.Threading.Tasks.Task AddWorldAnchorAsync(string token, WorldAnchor body, System.Threading.CancellationToken cancellationToken) { if (body == null) throw new System.ArgumentNullException("body"); @@ -1142,12 +1252,12 @@ namespace ETSI.ARF.OpenAPI.WorldStorage if (token != null) request_.Headers.TryAddWithoutValidation("token", ConvertToString(token, System.Globalization.CultureInfo.InvariantCulture)); - var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value); + var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, JsonSerializerSettings); var content_ = new System.Net.Http.StringContent(json_); content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); request_.Content = content_; request_.Method = new System.Net.Http.HttpMethod("POST"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain")); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); var urlBuilder_ = new System.Text.StringBuilder(); @@ -1179,30 +1289,42 @@ namespace ETSI.ARF.OpenAPI.WorldStorage var status_ = (int)response_.StatusCode; if (status_ == 200) { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = (string)System.Convert.ChangeType(responseData_, typeof(string)); - return result_; + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + return objectResponse_.Object; } else - if (status_ == 201) + if (status_ == 400) { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = (string)System.Convert.ChangeType(responseData_, typeof(string)); - return result_; + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("Bad request.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else - if (status_ == 400) + if (status_ == 409) { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = (string)System.Convert.ChangeType(responseData_, typeof(string)); - throw new ApiException("Bad request.", status_, responseData_, headers_, result_, null); + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("Invalid UUID, id must be a Nil value.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else - if (status_ == 409) + if (status_ == 511) { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = (string)System.Convert.ChangeType(responseData_, typeof(string)); - throw new ApiException("Invalid UUID, id must be a Nil value.", status_, responseData_, headers_, result_, null); + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("The secret token is not valid. Please ask an ISG ARF team member for a valid token.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else { @@ -1235,9 +1357,9 @@ namespace ETSI.ARF.OpenAPI.WorldStorage /// Modify an existing World Anchor given a json object containing all the required information. <br> **Please note that ID of the object is required in the JSON** /// /// The World Anchor to be modified in the world storage. - /// OK, return the UUID of the modified World Anchor. + /// OK, return the UUID of the Trackable defined by the world storage. /// A server side error occurred. - public virtual System.Threading.Tasks.Task ModifyWorldAnchorAsync(string token, WorldAnchor body) + public virtual System.Threading.Tasks.Task ModifyWorldAnchorAsync(string token, WorldAnchor body) { return ModifyWorldAnchorAsync(token, body, System.Threading.CancellationToken.None); } @@ -1249,9 +1371,9 @@ namespace ETSI.ARF.OpenAPI.WorldStorage /// Modify an existing World Anchor given a json object containing all the required information. <br> **Please note that ID of the object is required in the JSON** /// /// The World Anchor to be modified in the world storage. - /// OK, return the UUID of the modified World Anchor. + /// OK, return the UUID of the Trackable defined by the world storage. /// A server side error occurred. - public virtual string ModifyWorldAnchor(string token, WorldAnchor body) + public virtual Success ModifyWorldAnchor(string token, WorldAnchor body) { return System.Threading.Tasks.Task.Run(async () => await ModifyWorldAnchorAsync(token, body, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); } @@ -1264,9 +1386,9 @@ namespace ETSI.ARF.OpenAPI.WorldStorage /// Modify an existing World Anchor given a json object containing all the required information. <br> **Please note that ID of the object is required in the JSON** /// /// The World Anchor to be modified in the world storage. - /// OK, return the UUID of the modified World Anchor. + /// OK, return the UUID of the Trackable defined by the world storage. /// A server side error occurred. - public virtual async System.Threading.Tasks.Task ModifyWorldAnchorAsync(string token, WorldAnchor body, System.Threading.CancellationToken cancellationToken) + public virtual async System.Threading.Tasks.Task ModifyWorldAnchorAsync(string token, WorldAnchor body, System.Threading.CancellationToken cancellationToken) { if (body == null) throw new System.ArgumentNullException("body"); @@ -1280,12 +1402,12 @@ namespace ETSI.ARF.OpenAPI.WorldStorage if (token != null) request_.Headers.TryAddWithoutValidation("token", ConvertToString(token, System.Globalization.CultureInfo.InvariantCulture)); - var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value); + var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, JsonSerializerSettings); var content_ = new System.Net.Http.StringContent(json_); content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); request_.Content = content_; request_.Method = new System.Net.Http.HttpMethod("PUT"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain")); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); var urlBuilder_ = new System.Text.StringBuilder(); @@ -1317,23 +1439,42 @@ namespace ETSI.ARF.OpenAPI.WorldStorage var status_ = (int)response_.StatusCode; if (status_ == 200) { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = (string)System.Convert.ChangeType(responseData_, typeof(string)); - return result_; + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + return objectResponse_.Object; } else if (status_ == 400) { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = (string)System.Convert.ChangeType(responseData_, typeof(string)); - throw new ApiException("Bad request.", status_, responseData_, headers_, result_, null); + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("Bad request.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else if (status_ == 404) { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = (string)System.Convert.ChangeType(responseData_, typeof(string)); - throw new ApiException("Not found, could not find UUID in database.", status_, responseData_, headers_, result_, null); + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("Not found, could not find UUID in database.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 511) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("The secret token is not valid. Please ask an ISG ARF team member for a valid token.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else { @@ -1367,7 +1508,7 @@ namespace ETSI.ARF.OpenAPI.WorldStorage /// /// OK, return all the World Anchors defined by the world storage. /// A server side error occurred. - public virtual System.Threading.Tasks.Task> GetWorldAnchorsAsync(string token) + public virtual System.Threading.Tasks.Task GetWorldAnchorsAsync(string token) { return GetWorldAnchorsAsync(token, System.Threading.CancellationToken.None); } @@ -1380,7 +1521,7 @@ namespace ETSI.ARF.OpenAPI.WorldStorage /// /// OK, return all the World Anchors defined by the world storage. /// A server side error occurred. - public virtual System.Collections.Generic.List GetWorldAnchors(string token) + public virtual WorldAnchorsResponse GetWorldAnchors(string token) { return System.Threading.Tasks.Task.Run(async () => await GetWorldAnchorsAsync(token, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); } @@ -1394,7 +1535,7 @@ namespace ETSI.ARF.OpenAPI.WorldStorage /// /// OK, return all the World Anchors defined by the world storage. /// A server side error occurred. - public virtual async System.Threading.Tasks.Task> GetWorldAnchorsAsync(string token, System.Threading.CancellationToken cancellationToken) + public virtual async System.Threading.Tasks.Task GetWorldAnchorsAsync(string token, System.Threading.CancellationToken cancellationToken) { var client_ = _httpClient; var disposeClient_ = false; @@ -1438,7 +1579,7 @@ namespace ETSI.ARF.OpenAPI.WorldStorage var status_ = (int)response_.StatusCode; if (status_ == 200) { - var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) { throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); @@ -1446,24 +1587,37 @@ namespace ETSI.ARF.OpenAPI.WorldStorage return objectResponse_.Object; } else - if (status_ == 201) + if (status_ == 401) { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = (string)System.Convert.ChangeType(responseData_, typeof(string)); - throw new ApiException("Null response.", status_, responseData_, headers_, result_, null); + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("Null response.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else + if (status_ == 511) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) { throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); } - throw new ApiException("Unexpected error.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + throw new ApiException("The secret token is not valid. Please ask an ISG ARF team member for a valid token.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } - } - finally - { + else + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("Unexpected error.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + } + finally + { if (disposeResponse_) response_.Dispose(); } @@ -1572,16 +1726,42 @@ namespace ETSI.ARF.OpenAPI.WorldStorage else if (status_ == 400) { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = (string)System.Convert.ChangeType(responseData_, typeof(string)); - throw new ApiException("Invalid UUID supplied.", status_, responseData_, headers_, result_, null); + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("Invalid UUID supplied.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 401) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("Null response.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else if (status_ == 404) { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = (string)System.Convert.ChangeType(responseData_, typeof(string)); - throw new ApiException("Not found, could not find UUID in database.", status_, responseData_, headers_, result_, null); + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("Not found, could not find UUID in database.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 511) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("The secret token is not valid. Please ask an ISG ARF team member for a valid token.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else { @@ -1610,9 +1790,9 @@ namespace ETSI.ARF.OpenAPI.WorldStorage /// Delete a single World Anchor stored in the world storage from its ID. /// /// World Anchor UUID to delete. - /// OK, delete successful. + /// Success request. /// A server side error occurred. - public virtual System.Threading.Tasks.Task DeleteWorldAnchorAsync(string token, System.Guid worldAnchorUUID) + public virtual System.Threading.Tasks.Task DeleteWorldAnchorAsync(string token, System.Guid worldAnchorUUID) { return DeleteWorldAnchorAsync(token, worldAnchorUUID, System.Threading.CancellationToken.None); } @@ -1624,9 +1804,9 @@ namespace ETSI.ARF.OpenAPI.WorldStorage /// Delete a single World Anchor stored in the world storage from its ID. /// /// World Anchor UUID to delete. - /// OK, delete successful. + /// Success request. /// A server side error occurred. - public virtual string DeleteWorldAnchor(string token, System.Guid worldAnchorUUID) + public virtual Success DeleteWorldAnchor(string token, System.Guid worldAnchorUUID) { return System.Threading.Tasks.Task.Run(async () => await DeleteWorldAnchorAsync(token, worldAnchorUUID, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); } @@ -1639,9 +1819,9 @@ namespace ETSI.ARF.OpenAPI.WorldStorage /// Delete a single World Anchor stored in the world storage from its ID. /// /// World Anchor UUID to delete. - /// OK, delete successful. + /// Success request. /// A server side error occurred. - public virtual async System.Threading.Tasks.Task DeleteWorldAnchorAsync(string token, System.Guid worldAnchorUUID, System.Threading.CancellationToken cancellationToken) + public virtual async System.Threading.Tasks.Task DeleteWorldAnchorAsync(string token, System.Guid worldAnchorUUID, System.Threading.CancellationToken cancellationToken) { if (worldAnchorUUID == null) throw new System.ArgumentNullException("worldAnchorUUID"); @@ -1656,7 +1836,7 @@ namespace ETSI.ARF.OpenAPI.WorldStorage if (token != null) request_.Headers.TryAddWithoutValidation("token", ConvertToString(token, System.Globalization.CultureInfo.InvariantCulture)); request_.Method = new System.Net.Http.HttpMethod("DELETE"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain")); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); var urlBuilder_ = new System.Text.StringBuilder(); @@ -1689,23 +1869,42 @@ namespace ETSI.ARF.OpenAPI.WorldStorage var status_ = (int)response_.StatusCode; if (status_ == 200) { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = (string)System.Convert.ChangeType(responseData_, typeof(string)); - return result_; + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + return objectResponse_.Object; } else if (status_ == 400) { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = (string)System.Convert.ChangeType(responseData_, typeof(string)); - throw new ApiException("Invalid UUID supplied.", status_, responseData_, headers_, result_, null); + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("Invalid UUID supplied.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else if (status_ == 404) { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = (string)System.Convert.ChangeType(responseData_, typeof(string)); - throw new ApiException("Not found, could not find UUID in database.", status_, responseData_, headers_, result_, null); + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("Not found, could not find UUID in database.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 511) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("The secret token is not valid. Please ask an ISG ARF team member for a valid token.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else { @@ -1734,9 +1933,9 @@ namespace ETSI.ARF.OpenAPI.WorldStorage /// Create a new World Link from a json object containing all the required information and add it to the world storage. <br>As a result you will get the ID of the newly created World Link. /// /// The link to be added to the world storage. - /// OK, return the UUID of the World Link defined by the world storage. + /// OK, return the UUID of the Trackable defined by the world storage. /// A server side error occurred. - public virtual System.Threading.Tasks.Task AddWorldLinkAsync(string token, WorldLink body) + public virtual System.Threading.Tasks.Task AddWorldLinkAsync(string token, WorldLink body) { return AddWorldLinkAsync(token, body, System.Threading.CancellationToken.None); } @@ -1748,9 +1947,9 @@ namespace ETSI.ARF.OpenAPI.WorldStorage /// Create a new World Link from a json object containing all the required information and add it to the world storage. <br>As a result you will get the ID of the newly created World Link. /// /// The link to be added to the world storage. - /// OK, return the UUID of the World Link defined by the world storage. + /// OK, return the UUID of the Trackable defined by the world storage. /// A server side error occurred. - public virtual string AddWorldLink(string token, WorldLink body) + public virtual Success AddWorldLink(string token, WorldLink body) { return System.Threading.Tasks.Task.Run(async () => await AddWorldLinkAsync(token, body, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); } @@ -1763,9 +1962,9 @@ namespace ETSI.ARF.OpenAPI.WorldStorage /// Create a new World Link from a json object containing all the required information and add it to the world storage. <br>As a result you will get the ID of the newly created World Link. /// /// The link to be added to the world storage. - /// OK, return the UUID of the World Link defined by the world storage. + /// OK, return the UUID of the Trackable defined by the world storage. /// A server side error occurred. - public virtual async System.Threading.Tasks.Task AddWorldLinkAsync(string token, WorldLink body, System.Threading.CancellationToken cancellationToken) + public virtual async System.Threading.Tasks.Task AddWorldLinkAsync(string token, WorldLink body, System.Threading.CancellationToken cancellationToken) { if (body == null) throw new System.ArgumentNullException("body"); @@ -1779,12 +1978,12 @@ namespace ETSI.ARF.OpenAPI.WorldStorage if (token != null) request_.Headers.TryAddWithoutValidation("token", ConvertToString(token, System.Globalization.CultureInfo.InvariantCulture)); - var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value); + var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, JsonSerializerSettings); var content_ = new System.Net.Http.StringContent(json_); content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); request_.Content = content_; request_.Method = new System.Net.Http.HttpMethod("POST"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain")); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); var urlBuilder_ = new System.Text.StringBuilder(); @@ -1816,30 +2015,42 @@ namespace ETSI.ARF.OpenAPI.WorldStorage var status_ = (int)response_.StatusCode; if (status_ == 200) { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = (string)System.Convert.ChangeType(responseData_, typeof(string)); - return result_; + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + return objectResponse_.Object; } else - if (status_ == 201) + if (status_ == 400) { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = (string)System.Convert.ChangeType(responseData_, typeof(string)); - return result_; + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("Bad request.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else - if (status_ == 400) + if (status_ == 409) { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = (string)System.Convert.ChangeType(responseData_, typeof(string)); - throw new ApiException("Bad request.", status_, responseData_, headers_, result_, null); + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("Invalid UUID, id must be a Nil value.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else - if (status_ == 409) + if (status_ == 511) { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = (string)System.Convert.ChangeType(responseData_, typeof(string)); - throw new ApiException("Invalid UUID, id must be a Nil value.", status_, responseData_, headers_, result_, null); + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("The secret token is not valid. Please ask an ISG ARF team member for a valid token.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else { @@ -1872,9 +2083,9 @@ namespace ETSI.ARF.OpenAPI.WorldStorage /// Modify an existing World Link given a json object containing all the required information. <br> **Please note that ID of the object is required in the JSON** /// /// The World Link to be modified in the world storage. - /// OK, return the UUID of the modified World Link. + /// OK, return the UUID of the Trackable defined by the world storage. /// A server side error occurred. - public virtual System.Threading.Tasks.Task ModifyWorldLinkAsync(string token, WorldLink body) + public virtual System.Threading.Tasks.Task ModifyWorldLinkAsync(string token, WorldLink body) { return ModifyWorldLinkAsync(token, body, System.Threading.CancellationToken.None); } @@ -1886,9 +2097,9 @@ namespace ETSI.ARF.OpenAPI.WorldStorage /// Modify an existing World Link given a json object containing all the required information. <br> **Please note that ID of the object is required in the JSON** /// /// The World Link to be modified in the world storage. - /// OK, return the UUID of the modified World Link. + /// OK, return the UUID of the Trackable defined by the world storage. /// A server side error occurred. - public virtual string ModifyWorldLink(string token, WorldLink body) + public virtual Success ModifyWorldLink(string token, WorldLink body) { return System.Threading.Tasks.Task.Run(async () => await ModifyWorldLinkAsync(token, body, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); } @@ -1901,9 +2112,9 @@ namespace ETSI.ARF.OpenAPI.WorldStorage /// Modify an existing World Link given a json object containing all the required information. <br> **Please note that ID of the object is required in the JSON** /// /// The World Link to be modified in the world storage. - /// OK, return the UUID of the modified World Link. + /// OK, return the UUID of the Trackable defined by the world storage. /// A server side error occurred. - public virtual async System.Threading.Tasks.Task ModifyWorldLinkAsync(string token, WorldLink body, System.Threading.CancellationToken cancellationToken) + public virtual async System.Threading.Tasks.Task ModifyWorldLinkAsync(string token, WorldLink body, System.Threading.CancellationToken cancellationToken) { if (body == null) throw new System.ArgumentNullException("body"); @@ -1917,12 +2128,12 @@ namespace ETSI.ARF.OpenAPI.WorldStorage if (token != null) request_.Headers.TryAddWithoutValidation("token", ConvertToString(token, System.Globalization.CultureInfo.InvariantCulture)); - var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value); + var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, JsonSerializerSettings); var content_ = new System.Net.Http.StringContent(json_); content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); request_.Content = content_; request_.Method = new System.Net.Http.HttpMethod("PUT"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain")); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); var urlBuilder_ = new System.Text.StringBuilder(); @@ -1954,23 +2165,42 @@ namespace ETSI.ARF.OpenAPI.WorldStorage var status_ = (int)response_.StatusCode; if (status_ == 200) { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = (string)System.Convert.ChangeType(responseData_, typeof(string)); - return result_; + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + return objectResponse_.Object; } else if (status_ == 400) { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = (string)System.Convert.ChangeType(responseData_, typeof(string)); - throw new ApiException("Bad request.", status_, responseData_, headers_, result_, null); + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("Bad request.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else if (status_ == 404) { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = (string)System.Convert.ChangeType(responseData_, typeof(string)); - throw new ApiException("Not found, could not find UUID in database.", status_, responseData_, headers_, result_, null); + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("Not found, could not find UUID in database.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 511) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("The secret token is not valid. Please ask an ISG ARF team member for a valid token.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else { @@ -2004,7 +2234,7 @@ namespace ETSI.ARF.OpenAPI.WorldStorage /// /// OK return all the World Links defined by the world storage. /// A server side error occurred. - public virtual System.Threading.Tasks.Task> GetWorldLinksAsync(string token) + public virtual System.Threading.Tasks.Task GetWorldLinksAsync(string token) { return GetWorldLinksAsync(token, System.Threading.CancellationToken.None); } @@ -2017,7 +2247,7 @@ namespace ETSI.ARF.OpenAPI.WorldStorage /// /// OK return all the World Links defined by the world storage. /// A server side error occurred. - public virtual System.Collections.Generic.List GetWorldLinks(string token) + public virtual WorldLinksResponse GetWorldLinks(string token) { return System.Threading.Tasks.Task.Run(async () => await GetWorldLinksAsync(token, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); } @@ -2031,7 +2261,7 @@ namespace ETSI.ARF.OpenAPI.WorldStorage /// /// OK return all the World Links defined by the world storage. /// A server side error occurred. - public virtual async System.Threading.Tasks.Task> GetWorldLinksAsync(string token, System.Threading.CancellationToken cancellationToken) + public virtual async System.Threading.Tasks.Task GetWorldLinksAsync(string token, System.Threading.CancellationToken cancellationToken) { var client_ = _httpClient; var disposeClient_ = false; @@ -2075,7 +2305,7 @@ namespace ETSI.ARF.OpenAPI.WorldStorage var status_ = (int)response_.StatusCode; if (status_ == 200) { - var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) { throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); @@ -2083,11 +2313,24 @@ namespace ETSI.ARF.OpenAPI.WorldStorage return objectResponse_.Object; } else - if (status_ == 201) + if (status_ == 401) { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = (string)System.Convert.ChangeType(responseData_, typeof(string)); - throw new ApiException("Null response.", status_, responseData_, headers_, result_, null); + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("Null response.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 511) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("The secret token is not valid. Please ask an ISG ARF team member for a valid token.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else { @@ -2209,16 +2452,42 @@ namespace ETSI.ARF.OpenAPI.WorldStorage else if (status_ == 400) { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = (string)System.Convert.ChangeType(responseData_, typeof(string)); - throw new ApiException("Invalid UUID supplied.", status_, responseData_, headers_, result_, null); + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("Invalid UUID supplied.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 401) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("Null response.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else if (status_ == 404) { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = (string)System.Convert.ChangeType(responseData_, typeof(string)); - throw new ApiException("Not found, could not find UUID in database.", status_, responseData_, headers_, result_, null); + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("Not found, could not find UUID in database.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 511) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("The secret token is not valid. Please ask an ISG ARF team member for a valid token.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else { @@ -2247,9 +2516,9 @@ namespace ETSI.ARF.OpenAPI.WorldStorage /// Delete a single World Link stored in the world storage from its ID. /// /// World Link id to delete. - /// OK, delete successful. + /// Success request. /// A server side error occurred. - public virtual System.Threading.Tasks.Task DeleteWorldLinkAsync(string token, System.Guid worldLinkUUID) + public virtual System.Threading.Tasks.Task DeleteWorldLinkAsync(string token, System.Guid worldLinkUUID) { return DeleteWorldLinkAsync(token, worldLinkUUID, System.Threading.CancellationToken.None); } @@ -2261,9 +2530,9 @@ namespace ETSI.ARF.OpenAPI.WorldStorage /// Delete a single World Link stored in the world storage from its ID. /// /// World Link id to delete. - /// OK, delete successful. + /// Success request. /// A server side error occurred. - public virtual string DeleteWorldLink(string token, System.Guid worldLinkUUID) + public virtual Success DeleteWorldLink(string token, System.Guid worldLinkUUID) { return System.Threading.Tasks.Task.Run(async () => await DeleteWorldLinkAsync(token, worldLinkUUID, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); } @@ -2276,9 +2545,9 @@ namespace ETSI.ARF.OpenAPI.WorldStorage /// Delete a single World Link stored in the world storage from its ID. /// /// World Link id to delete. - /// OK, delete successful. + /// Success request. /// A server side error occurred. - public virtual async System.Threading.Tasks.Task DeleteWorldLinkAsync(string token, System.Guid worldLinkUUID, System.Threading.CancellationToken cancellationToken) + public virtual async System.Threading.Tasks.Task DeleteWorldLinkAsync(string token, System.Guid worldLinkUUID, System.Threading.CancellationToken cancellationToken) { if (worldLinkUUID == null) throw new System.ArgumentNullException("worldLinkUUID"); @@ -2293,7 +2562,7 @@ namespace ETSI.ARF.OpenAPI.WorldStorage if (token != null) request_.Headers.TryAddWithoutValidation("token", ConvertToString(token, System.Globalization.CultureInfo.InvariantCulture)); request_.Method = new System.Net.Http.HttpMethod("DELETE"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain")); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); var urlBuilder_ = new System.Text.StringBuilder(); @@ -2326,23 +2595,32 @@ namespace ETSI.ARF.OpenAPI.WorldStorage var status_ = (int)response_.StatusCode; if (status_ == 200) { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = (string)System.Convert.ChangeType(responseData_, typeof(string)); - return result_; + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + return objectResponse_.Object; } else if (status_ == 400) { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = (string)System.Convert.ChangeType(responseData_, typeof(string)); - throw new ApiException("Invalid UUID supplied.", status_, responseData_, headers_, result_, null); + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("Invalid UUID supplied.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else if (status_ == 404) { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = (string)System.Convert.ChangeType(responseData_, typeof(string)); - throw new ApiException("Not found, could not find UUID in database.", status_, responseData_, headers_, result_, null); + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("Not found, could not find UUID in database.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else { @@ -2479,7 +2757,7 @@ namespace ETSI.ARF.OpenAPI.WorldStorage /// /// An element representing all information needed in relation with a Trackable or a WorldAnchor. /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial class RelocalizationInformation { /// @@ -2512,7 +2790,7 @@ namespace ETSI.ARF.OpenAPI.WorldStorage /// /// An element representing a Trackable object in the real world. /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial class Trackable { /// @@ -2576,7 +2854,7 @@ namespace ETSI.ARF.OpenAPI.WorldStorage /// /// An element describing a pose in the world graph. /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial class WorldAnchor { /// @@ -2624,7 +2902,7 @@ namespace ETSI.ARF.OpenAPI.WorldStorage /// /// An object holding the info of a transform between two elements. /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial class WorldLink { /// @@ -2683,7 +2961,7 @@ namespace ETSI.ARF.OpenAPI.WorldStorage /// /// List of additional parameters to be stored with the object. /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial class KeyvalueTagList : System.Collections.Generic.Dictionary> { @@ -2692,7 +2970,7 @@ namespace ETSI.ARF.OpenAPI.WorldStorage /// /// An object representing a supported capability of the World Analysis and its associated metadata /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial class Capability { [Newtonsoft.Json.JsonProperty("trackableType", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] @@ -2734,7 +3012,7 @@ namespace ETSI.ARF.OpenAPI.WorldStorage /// /// An object holding the info of a Trackable`'`s encoding information `:` the data format and the version. /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial class EncodingInformationStructure { /// @@ -2761,13 +3039,10 @@ namespace ETSI.ARF.OpenAPI.WorldStorage } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial class Error { - [Newtonsoft.Json.JsonProperty("code", Required = Newtonsoft.Json.Required.Always)] - public int Code { get; set; } - - [Newtonsoft.Json.JsonProperty("message", Required = Newtonsoft.Json.Required.Always)] + [Newtonsoft.Json.JsonProperty("message", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] public string Message { get; set; } private System.Collections.Generic.IDictionary _additionalProperties; @@ -2784,7 +3059,7 @@ namespace ETSI.ARF.OpenAPI.WorldStorage /// /// Mode representing the context of the relocalization information (AR device to WorldAnchor/Trackable or WorldAnchor/Trackable to AR device) /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")] public enum Mode_WorldStorage { @@ -2799,16 +3074,33 @@ namespace ETSI.ARF.OpenAPI.WorldStorage /// /// Size object in format {width, length, depth}. /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial class Size : System.Collections.ObjectModel.Collection { } + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")] + public partial class Success + { + [Newtonsoft.Json.JsonProperty("message", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Message { get; set; } + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + /// /// Type for trackable /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")] public enum TrackableType { @@ -2835,7 +3127,7 @@ namespace ETSI.ARF.OpenAPI.WorldStorage /// /// Coordinate reference system of the world anchor, a 4*4 matrix (rowmajor) represented by a float vector. /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial class Transform3D : System.Collections.ObjectModel.Collection { @@ -2844,7 +3136,7 @@ namespace ETSI.ARF.OpenAPI.WorldStorage /// /// Trackable or Anchor /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")] public enum TypeWorldStorage { @@ -2862,7 +3154,7 @@ namespace ETSI.ARF.OpenAPI.WorldStorage /// /// Unit of length. /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")] public enum UnitSystem { @@ -2901,8 +3193,8 @@ namespace ETSI.ARF.OpenAPI.WorldStorage } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class Anonymous + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")] + public partial class UuidAndMode { [Newtonsoft.Json.JsonProperty("uuid", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] public System.Guid Uuid { get; set; } @@ -2922,8 +3214,8 @@ namespace ETSI.ARF.OpenAPI.WorldStorage } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class Response + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")] + public partial class RelocalizationInformations { [Newtonsoft.Json.JsonProperty("RelocInfo", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] public System.Collections.Generic.ICollection RelocInfo { get; set; } @@ -2939,7 +3231,58 @@ namespace ETSI.ARF.OpenAPI.WorldStorage } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")] + public partial class TrackablesResponse + { + [Newtonsoft.Json.JsonProperty("trackables", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public System.Collections.Generic.ICollection Trackables { get; set; } + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")] + public partial class WorldAnchorsResponse + { + [Newtonsoft.Json.JsonProperty("worldAnchors", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public System.Collections.Generic.ICollection WorldAnchors { get; set; } + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")] + public partial class WorldLinksResponse + { + [Newtonsoft.Json.JsonProperty("worldLinks", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public System.Collections.Generic.ICollection WorldLinks { get; set; } + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial class RelocObjects { [Newtonsoft.Json.JsonProperty("trackable", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] @@ -2963,7 +3306,7 @@ namespace ETSI.ARF.OpenAPI.WorldStorage } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")] public enum EncodingInformationStructureDataFormat { @@ -2989,7 +3332,7 @@ namespace ETSI.ARF.OpenAPI.WorldStorage - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial class ApiException : System.Exception { public int StatusCode { get; private set; } @@ -3012,7 +3355,7 @@ namespace ETSI.ARF.OpenAPI.WorldStorage } } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial class ApiException : ApiException { public TResult Result { get; private set; } diff --git a/Runtime/Scripts/OpenAPI/ResponseObject.cs b/Runtime/Scripts/OpenAPI/ResponseObject.cs index 4e6ffb7795ceea595d3262d53080a6b6a10ef7aa..6a37f194b0475409347e1b207da05ab3b9cf432b 100644 --- a/Runtime/Scripts/OpenAPI/ResponseObject.cs +++ b/Runtime/Scripts/OpenAPI/ResponseObject.cs @@ -13,15 +13,28 @@ using System.Collections.Generic; using System.Threading; using UnityEngine; -namespace ETSI.ARF.OpenAPI +namespace ETSI.ARF.OpenAPI.WorldStorage { - public class ResponseObject + public class CancelToken + { + protected CancellationTokenSource tokenSource; + protected CancellationToken ct; + + public CancellationToken cancellationToken { get => ct; } + + public void Cancel() + { + tokenSource.Cancel(); + } + } + + public class ResponseObject : CancelToken { // Management stuffs static int ID = 0; public int transactionId = 0; public string message = ""; // custom message, type of data... - + // Time monitoring public TimeSpan DeltaTime { get => responseTime - requestTime; } public DateTime requestTime; @@ -30,34 +43,23 @@ namespace ETSI.ARF.OpenAPI // Incoming data public T result; public int payload; // size of data - + //public string result = ""; // text result //public object data = null; // custom result // Callback public Action> callback; - // Task cancelllation - public CancellationToken cancellationToken { get => ct; } - private CancellationTokenSource tokenSource; - private CancellationToken ct; - public ResponseObject(string msg, Action> func = null) { requestTime = DateTime.Now; - transactionId = ++ID; message = msg; - callback = func; + transactionId = ++ID; tokenSource = new CancellationTokenSource(); ct = tokenSource.Token; } - - public void Cancel() - { - tokenSource.Cancel(); - } } } \ No newline at end of file diff --git a/Runtime/Scripts/OpenAPI/UnityWebRequestHttpClient.cs b/Runtime/Scripts/OpenAPI/UnityWebRequestHttpClient.cs index 94466cec553cae872c2b684a5ec167c2ad00445c..43fd7f0d1fdcb5fa8ebd46b7ef7cec46463e618c 100644 --- a/Runtime/Scripts/OpenAPI/UnityWebRequestHttpClient.cs +++ b/Runtime/Scripts/OpenAPI/UnityWebRequestHttpClient.cs @@ -1,3 +1,23 @@ +// +// ARF - Augmented Reality Framework (ETSI ISG ARF) +// +// Copyright 2024 ETSI +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Last change: September 2024 +// + // Depends on UniTask to support cancellation token and GetAwaiter: https://github.com/Cysharp/UniTask // Otherwise, the code can be adapted using https://gist.github.com/krzys-h/9062552e33dd7bd7fe4a6c12db109a1a @@ -14,7 +34,7 @@ using System.Threading.Tasks; using UnityEngine; using UnityEngine.Networking; -namespace ETSI.ARF.OpenAPI +namespace ETSI.ARF.OpenAPI.WorldStorage { public interface IHttpClient { @@ -35,10 +55,10 @@ namespace ETSI.ARF.OpenAPI public BasicHTTPClient(string baseUri) { BaseAddress = new Uri(baseUri); - _httpClient.BaseAddress = BaseAddress; + _httpClient.BaseAddress = BaseAddress; } - public BasicHTTPClient (Uri baseUri) + public BasicHTTPClient(Uri baseUri) { BaseAddress = baseUri; _httpClient.BaseAddress = BaseAddress; @@ -51,10 +71,10 @@ namespace ETSI.ARF.OpenAPI public async Task SendAsync(HttpRequestMessage message, HttpCompletionOption option, CancellationToken token) { - return await _httpClient.SendAsync(message, option, token); + return await _httpClient.SendAsync(message, option, token); } - public void Dispose() + public void Dispose() { _httpClient.Dispose(); DefaultRequestHeaders.Clear(); @@ -81,6 +101,21 @@ namespace ETSI.ARF.OpenAPI private readonly HttpClient _httpClient = new HttpClient(); + private void AppendARFHeaders(HttpRequestMessage message, UnityWebRequest webRequest) + { + // Add some ARF headers + foreach (var item in message.Headers) + { + try + { + List li = item.Value as List; + if (item.Key == "token") webRequest.SetRequestHeader(item.Key, li[0].ToString()); // add it + if (item.Key == "sessionID") webRequest.SetRequestHeader(item.Key, li[0].ToString()); // add it + } + catch { } // ignore it + } + } + public async Task SendAsync(HttpRequestMessage message, HttpCompletionOption option, CancellationToken token) { var content = await (message.Content?.ReadAsStringAsync() ?? Task.FromResult("")); @@ -88,6 +123,9 @@ namespace ETSI.ARF.OpenAPI AppendHeaders(webRequest); + // Add the ARF API headers + AppendARFHeaders(message, webRequest); + Debug.Log("[HTTP] Request " + webRequest.uri.ToString()); try { @@ -158,6 +196,7 @@ namespace ETSI.ARF.OpenAPI var (key, value) = enumerator.Current; webRequest.SetRequestHeader(key, value.First()); } + } private HttpResponseMessage CreateHttpResponseMessage(UnityWebRequest webRequest) diff --git a/Runtime/Scripts/OpenAPI/WorldStorageClient.cs b/Runtime/Scripts/OpenAPI/WorldStorageClient.cs index fd665702cc48024042328416b67a8bc5fec99adf..d75cc6a0550c0181bccf932bbec7cf90155dd282 100644 --- a/Runtime/Scripts/OpenAPI/WorldStorageClient.cs +++ b/Runtime/Scripts/OpenAPI/WorldStorageClient.cs @@ -1,23 +1,3 @@ -// -// ARF - Augmented Reality Framework (ETSI ISG ARF) -// -// Copyright 2024 ETSI -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Last change: March 2024 -// - using System.Collections; using System.Collections.Generic; using UnityEngine; @@ -25,28 +5,24 @@ using UnityEngine.Networking; namespace ETSI.ARF.OpenAPI.WorldStorage { - // SylR - public partial class WorldStorageClient + /// + /// Catch the pre/pos request methods from the autogenerated classes + /// + public partial class WorldStorageClient : BaseClient { - public string lastJsonText; - public long lastPayload; - - partial void PrepareRequest(IHttpClient client, System.Net.Http.HttpRequestMessage request, string url) + partial void PrepareRequest(ETSI.ARF.OpenAPI.WorldStorage.IHttpClient client, System.Net.Http.HttpRequestMessage request, string url) { - // If needed to make some special things !!! + _prepareRequest(client, request, url); } - partial void PrepareRequest(IHttpClient client, System.Net.Http.HttpRequestMessage request, System.Text.StringBuilder urlBuilder) + partial void PrepareRequest(ETSI.ARF.OpenAPI.WorldStorage.IHttpClient client, System.Net.Http.HttpRequestMessage request, System.Text.StringBuilder urlBuilder) { // do something... } - partial void ProcessResponse(IHttpClient client, System.Net.Http.HttpResponseMessage response) + partial void ProcessResponse(ETSI.ARF.OpenAPI.WorldStorage.IHttpClient client, System.Net.Http.HttpResponseMessage response) { - lastJsonText = response.Content.ReadAsStringAsync().Result.ToString(); - lastPayload = response.Content.Headers.ContentLength.Value; - - // If needed to make some special things !!! + _processResponse(client, response); } } } \ No newline at end of file diff --git a/Runtime/Scripts/REST/AdminRequest.cs b/Runtime/Scripts/REST/AdminRequest.cs index 36492dcd1f18b91f0058778820b38febd2bb8747..a7bbac6181b6659504243689c884cdf58774a31d 100644 --- a/Runtime/Scripts/REST/AdminRequest.cs +++ b/Runtime/Scripts/REST/AdminRequest.cs @@ -29,13 +29,25 @@ namespace ETSI.ARF.WorldStorage.REST { public class AdminRequest : RequestBase { + #region Test methods + static public void CheckServer(WorldStorageServer ws) + { + string ping = AdminRequest.PingSync(ws); + string state = AdminRequest.AdminSync(ws); + string ver = AdminRequest.VersionSync(ws); + Debug.Log("[REST] WA Ping: " + ping); + Debug.Log("[REST] WA State: " + state); + Debug.Log("[REST] WA Version: " + ver); + } + #endregion + // // Wrapper for the endpoints // - static private string Ping(WorldStorageServer ws) + static public string PingSync(WorldStorageServer ws) { wsServer = ws; - var httpClient = new UnityWebRequestHttpClient(ws.URI); + var httpClient = new BasicHTTPClient(ws.URI); apiClient = new WorldStorageClient(httpClient); string response = apiClient.GetPing(); @@ -48,33 +60,53 @@ namespace ETSI.ARF.WorldStorage.REST var httpClient = new UnityWebRequestHttpClient(ws.URI); apiClient = new WorldStorageClient(httpClient); - Debug.Log("Request Ping..."); + Debug.Log("[REST] Request Ping..."); ResponseObject ro = new ResponseObject("Request Ping", func); - apiClient.GetPingAsync().ContinueWith(OnReceiveObject, ro); + apiClient.GetPingAsync(ro.cancellationToken).ContinueWith(OnReceiveObject, ro); return ro; } + static public string AdminSync(WorldStorageServer ws) + { + wsServer = ws; + var httpClient = new BasicHTTPClient(ws.URI); + apiClient = new WorldStorageClient(httpClient); + + string response = apiClient.GetAdmin(); + return response; + } + static public ResponseObject AdminAsync(WorldStorageServer ws, Action> func) { wsServer = ws; var httpClient = new UnityWebRequestHttpClient(ws.URI); apiClient = new WorldStorageClient(httpClient); - Debug.Log("Request Admin..."); + Debug.Log("[REST] Request Admin..."); ResponseObject ro = new ResponseObject("Request Admin", func); - apiClient.GetAdminAsync().ContinueWith(OnReceiveObject, ro); + apiClient.GetAdminAsync(ro.cancellationToken).ContinueWith(OnReceiveObject, ro); return ro; } + static public string VersionSync(WorldStorageServer ws) + { + wsServer = ws; + var httpClient = new BasicHTTPClient(ws.URI); + apiClient = new WorldStorageClient(httpClient); + + string response = apiClient.GetVersion(); + return response; + } + static public ResponseObject VersionAsync(WorldStorageServer ws, Action> func) { wsServer = ws; var httpClient = new UnityWebRequestHttpClient(ws.URI); apiClient = new WorldStorageClient(httpClient); - Debug.Log("Request Version..."); + Debug.Log("[REST] Request Version..."); ResponseObject ro = new ResponseObject("Request Version", func); - apiClient.GetVersionAsync().ContinueWith(OnReceiveObject, ro); + apiClient.GetVersionAsync(ro.cancellationToken).ContinueWith(OnReceiveObject, ro); return ro; } } diff --git a/Runtime/Scripts/REST/RelocalizationInformationRequest.cs b/Runtime/Scripts/REST/RelocalizationInformationRequest.cs index 309618c9459d89ebd8bc4eda267727d2c9660624..1113d6a8307730aa71b485ec9747f93402504735 100644 --- a/Runtime/Scripts/REST/RelocalizationInformationRequest.cs +++ b/Runtime/Scripts/REST/RelocalizationInformationRequest.cs @@ -15,7 +15,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -// Last change: May 2024 +// Last change: September 2024 // using System; using System.Collections.Generic; @@ -25,49 +25,53 @@ using Newtonsoft.Json; namespace ETSI.ARF.WorldStorage.REST { - public class RelocalizationInformationRequest : RequestBase + public class RelocalizationInformationRequest : RequestBase { - static public ResponseObject GetRelocalizationInformationAsync(WorldStorageServer ws, List uuids, List modes, List capabilities, Action> func) + static public ResponseObject GetRelocalizationInformationAsync(WorldStorageServer ws, List uuids, List modes, List capabilities, Action> func) { wsServer = ws; var httpClient = new UnityWebRequestHttpClient(ws.URI); - apiClient = new WorldStorageClient(httpClient); + apiClient = new MyWorldStorageClient(httpClient); - ResponseObject ro = new ResponseObject("Request Reloc Information ", func); + ResponseObject ro = new ResponseObject("Request Reloc Information ", func); - List anonymous = new List(); + List anonymous = new List(); for (int i = 0; i< uuids.Count; i++) { // Check same size or give anonymous as parameter? - Anonymous newOne = new Anonymous(); + UuidAndMode newOne = new UuidAndMode(); newOne.Uuid = uuids[i]; newOne.Mode = modes[i]; anonymous.Add(newOne); } - apiClient.GetRelocalizationInformationAsync(token, anonymous, capabilities).ContinueWith(OnReceiveObject, ro); + apiClient.GetRelocalizationInformationAsync(token, anonymous, capabilities, ro.cancellationToken).ContinueWith(OnReceiveObject, ro); return ro; } + static public RelocalizationInformations GetRelocalizationInformation(WorldStorageServer ws, List uuids, List modes, List capabilities) + { + return GetRelocalizationInformationSync(ws, uuids, modes, capabilities); + } - static public Response GetRelocalizationInformation(WorldStorageServer ws, List uuids, List modes, List capabilities) + static public RelocalizationInformations GetRelocalizationInformationSync(WorldStorageServer ws, List uuids, List modes, List capabilities) { wsServer = ws; var httpClient = new BasicHTTPClient(ws.URI); apiClient = new MyWorldStorageClient(httpClient); - List anonymous = new List(); + List anonymous = new List(); for (int i = 0; i < uuids.Count; i++) { // Check same size or give anonymous as parameter? - Anonymous newOne = new Anonymous(); + UuidAndMode newOne = new UuidAndMode(); newOne.Uuid = uuids[i]; newOne.Mode = modes[i]; anonymous.Add(newOne); } - Response ro = apiClient.GetRelocalizationInformation(token, anonymous, capabilities); + RelocalizationInformations ro = apiClient.GetRelocalizationInformation(token, anonymous, capabilities); return ro; } } @@ -77,7 +81,7 @@ namespace ETSI.ARF.OpenAPI.WorldStorage { public partial class WorldStorageClient { - public ETSI.ARF.OpenAPI.IHttpClient GetHttpClient() + public ETSI.ARF.OpenAPI.WorldStorage.IHttpClient GetHttpClient() { return _httpClient; } @@ -88,20 +92,21 @@ namespace ETSI.ARF.OpenAPI.WorldStorage } - public void PrepareRequest_(ETSI.ARF.OpenAPI.IHttpClient client, System.Net.Http.HttpRequestMessage request, string url) + public void PrepareRequest_(ETSI.ARF.OpenAPI.WorldStorage.IHttpClient client, System.Net.Http.HttpRequestMessage request, string url) { PrepareRequest(client, request, url); } - public void PrepareRequest_(ETSI.ARF.OpenAPI.IHttpClient client, System.Net.Http.HttpRequestMessage request, System.Text.StringBuilder urlBuilder) + public void PrepareRequest_(ETSI.ARF.OpenAPI.WorldStorage.IHttpClient client, System.Net.Http.HttpRequestMessage request, System.Text.StringBuilder urlBuilder) { PrepareRequest(client, request, urlBuilder); } - public void ProcessResponse_(ETSI.ARF.OpenAPI.IHttpClient client, System.Net.Http.HttpResponseMessage response) + public void ProcessResponse_(ETSI.ARF.OpenAPI.WorldStorage.IHttpClient client, System.Net.Http.HttpResponseMessage response) { ProcessResponse(client, response); } } + // Custom client to be able to properly serialize objects in the query string public partial class MyWorldStorageClient : WorldStorageClient { public MyWorldStorageClient(IHttpClient httpClient) : base(httpClient) @@ -120,7 +125,7 @@ namespace ETSI.ARF.OpenAPI.WorldStorage /// /// /// - public override async System.Threading.Tasks.Task GetRelocalizationInformationAsync(string token, System.Collections.Generic.IEnumerable uuids, System.Collections.Generic.IEnumerable capabilities, System.Threading.CancellationToken cancellationToken) + public override async System.Threading.Tasks.Task GetRelocalizationInformationAsync(string token, System.Collections.Generic.IEnumerable uuids, System.Collections.Generic.IEnumerable capabilities, System.Threading.CancellationToken cancellationToken) { if (uuids == null) throw new System.ArgumentNullException("uuids"); @@ -173,7 +178,7 @@ namespace ETSI.ARF.OpenAPI.WorldStorage var status_ = (int)response_.StatusCode; if (status_ == 200) { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) { throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); diff --git a/Runtime/Scripts/REST/RequestBase.cs b/Runtime/Scripts/REST/RequestBase.cs index 4d98fb29ac916fd877b8915987b978d791ce1e95..f06a66837f23e68a8f63897d00b884058a8ff3d8 100644 --- a/Runtime/Scripts/REST/RequestBase.cs +++ b/Runtime/Scripts/REST/RequestBase.cs @@ -15,7 +15,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -// Last change: March 2024 +// Last change: September 2024 // using System; @@ -33,7 +33,7 @@ namespace ETSI.ARF.WorldStorage.REST static protected WorldStorageServer wsServer; static protected WorldStorageClient apiClient; - static protected string token = "ARF_Permission"; + static protected string token = "dev"; // only for development // Cache the current list static public Dictionary listOfObjects = new Dictionary(); @@ -49,14 +49,65 @@ namespace ETSI.ARF.WorldStorage.REST ResponseObject o = (ResponseObject)id; o.responseTime = DateTime.Now; o.result = t.Result; - Debug.Log($"Server Response = {o.result} (ID={o.transactionId}, Msg={o.message})"); + Debug.Log($"[REST] Server Response = {o.result.ToString()} (ID={o.transactionId}, Msg={o.message})"); o.callback?.Invoke(o); } - else Debug.Log("OpenAPI Timeout!"); + else Debug.Log("[REST] OpenAPI Timeout!"); + } + + static protected void OnReceiveListOfObjects(Task t, object id) // where TObj : IModel + { + if (t.IsCompleted) + { + ResponseObject o = (ResponseObject)id; + o.responseTime = DateTime.Now; + o.result = t.Result; + Debug.Log($"[REST] " + o.result.GetType()); + + // Adapation for new API, SylR + int cnt = 0; + + // Remember the new list + listOfObjects.Clear(); + + // Get the new list + if (o.result.GetType() == typeof(TrackablesResponse)) + { + Debug.Log($"[REST] TR"); + TrackablesResponse res = o.result as TrackablesResponse; + foreach (var item in res.Trackables) + { + listOfObjects.Add(item.UUID, item); + cnt++; + } + } + else if (o.result.GetType() == typeof(WorldAnchorsResponse)) + { + WorldAnchorsResponse res = o.result as WorldAnchorsResponse; + foreach (var item in res.WorldAnchors) + { + listOfObjects.Add(item.UUID, item); + cnt++; + } + } + else if (o.result.GetType() == typeof(WorldLinksResponse)) + { + WorldLinksResponse res = o.result as WorldLinksResponse; + foreach (var item in res.WorldLinks) + { + listOfObjects.Add(item.UUID, item); + cnt++; + } + } + + Debug.Log($"[REST] Server Response = Got {cnt} entrie(s) (ID={o.transactionId}, Msg={o.message})"); + o.callback?.Invoke(o); + } + else Debug.Log("[REST] OpenAPI Timeout!"); } - static protected void OnReceiveListOfObjects(Task> t, object id) where TObj : IModel + static protected void old_OnReceiveListOfObjects(Task> t, object id) where TObj : IModel { if (t.IsCompleted) { diff --git a/Runtime/Scripts/REST/TrackableRequest.cs b/Runtime/Scripts/REST/TrackableRequest.cs index 4712c422fbefb9bafb4f4a33e11ff06674fc13c6..ec208b3512f3f4cb31774074dff207ba4b704762 100644 --- a/Runtime/Scripts/REST/TrackableRequest.cs +++ b/Runtime/Scripts/REST/TrackableRequest.cs @@ -15,18 +15,16 @@ // See the License for the specific language governing permissions and // limitations under the License. // -// Last change: March 2024 +// Last change: June 2024 // -#define USING_OPENAPI_GENERATOR // alt. is Swagger - using System; using System.Collections.Generic; using System.Threading.Tasks; using UnityEngine; -using ETSI.ARF.OpenAPI.WorldStorage; using ETSI.ARF.OpenAPI; +using ETSI.ARF.OpenAPI.WorldStorage; namespace ETSI.ARF.WorldStorage.REST { @@ -35,67 +33,122 @@ namespace ETSI.ARF.WorldStorage.REST // // Wrapper for the endpoints // + static public Trackable GetTrackableSync(WorldStorageServer ws, Guid UUID) + { + wsServer = ws; + var httpClient = new BasicHTTPClient(ws.URI); + apiClient = new WorldStorageClient(httpClient); + + Debug.Log($"[REST] Request Trackable {UUID}..."); + return apiClient.GetTrackableById(token, UUID); + } + static public ResponseObject GetTrackableAsync(WorldStorageServer ws, Guid UUID, Action> func) { wsServer = ws; var httpClient = new UnityWebRequestHttpClient(ws.URI); apiClient = new WorldStorageClient(httpClient); - Debug.Log("Request 1 Trackable..."); + Debug.Log($"[REST] Request Trackable {UUID}..."); ResponseObject ro = new ResponseObject("Request Trackable " + UUID.ToString(), func); apiClient.GetTrackableByIdAsync(token, UUID, ro.cancellationToken).ContinueWith(OnReceiveObject, ro); return ro; } - static public ResponseObject> GetTrackablesAsync(WorldStorageServer ws, Action>> func) + static public List GetTrackablesSync(WorldStorageServer ws) + { + wsServer = ws; + var httpClient = new BasicHTTPClient(ws.URI); + apiClient = new WorldStorageClient(httpClient); + + Debug.Log("[REST] Request Trackables..."); + return apiClient.GetTrackables(token).Trackables as List; + } + + static public ResponseObject GetTrackablesAsync(WorldStorageServer ws, Action> func) { wsServer = ws; var httpClient = new UnityWebRequestHttpClient(ws.URI); apiClient = new WorldStorageClient(httpClient); - Debug.Log("Request Trackables..."); - ResponseObject> ro = new ResponseObject>("Request Trackables", func); - apiClient.GetTrackablesAsync(token, ro.cancellationToken).ContinueWith(OnReceiveListOfObjects, ro); + Debug.Log("[REST] Request Trackables..."); + ResponseObject ro = new ResponseObject("Request Trackables", func); + apiClient.GetTrackablesAsync(token, ro.cancellationToken).ContinueWith(OnReceiveListOfObjects, ro); return ro; } - static public ResponseObject CreateTrackableAsync(WorldStorageServer ws, Trackable trackable, Action> func) + static public string CreateTrackableSync(WorldStorageServer ws, Trackable trackable) { wsServer = ws; - var httpClient = new UnityWebRequestHttpClient(ws.URI); + var httpClient = new BasicHTTPClient(ws.URI); apiClient = new WorldStorageClient(httpClient); - Debug.Log("Create 1 Trackable..."); + // Add some management stuffs + if (trackable.UUID == Guid.Empty) trackable.UUID = Guid.NewGuid(); + if (trackable.CreatorUUID == Guid.Empty) trackable.CreatorUUID = System.Guid.Parse("8fb169e2-8910-4cd5-a8f9-b7abff38d013"); + + Debug.Log($"[REST] Create Trackable {trackable.UUID}..."); + return apiClient.AddTrackable(token, trackable).Message; + } + + static public ResponseObject CreateTrackableAsync(WorldStorageServer ws, Trackable trackable, Action> func) + { + wsServer = ws; + var httpClient = new UnityWebRequestHttpClient(ws.URI); + apiClient = new WorldStorageClient(httpClient); // Add some management stuffs - trackable.UUID = Guid.NewGuid(); - trackable.CreatorUUID = Guid.Empty; - - ResponseObject ro = new ResponseObject("Create Trackable " + trackable.Name + " (no UUID)", func); - apiClient.AddTrackableAsync(token, trackable, ro.cancellationToken).ContinueWith(OnReceiveObject, ro); + if (trackable.UUID == Guid.Empty) trackable.UUID = Guid.NewGuid(); + if (trackable.CreatorUUID == Guid.Empty) trackable.CreatorUUID = System.Guid.Parse("8fb169e2-8910-4cd5-a8f9-b7abff38d013"); + + Debug.Log($"[REST] Create Trackable {trackable.UUID}..."); + + ResponseObject ro = new ResponseObject("Create Trackable " + trackable.Name + " (no UUID)", func); + apiClient.AddTrackableAsync(token, trackable, ro.cancellationToken).ContinueWith(OnReceiveObject, ro); return ro; } - static public ResponseObject UpdateTrackableAsync(WorldStorageServer ws, Trackable trackable, Action> func) + static public string UpdateTrackableSync(WorldStorageServer ws, Trackable trackable) + { + wsServer = ws; + var httpClient = new BasicHTTPClient(ws.URI); + apiClient = new WorldStorageClient(httpClient); + + Debug.Log($"[REST] Update Trackable {trackable.UUID}..."); + return apiClient.ModifyTrackable(token, trackable).Message; + } + + static public ResponseObject UpdateTrackableAsync(WorldStorageServer ws, Trackable trackable, Action> func) { wsServer = ws; var httpClient = new UnityWebRequestHttpClient(ws.URI); apiClient = new WorldStorageClient(httpClient); - Debug.Log("Update Trackable..."); - ResponseObject ro = new ResponseObject("Update Trackable " + trackable.UUID.ToString(), func); - apiClient.ModifyTrackableAsync(token, trackable,ro.cancellationToken).ContinueWith(OnReceiveObject, ro); + Debug.Log($"[REST] Update Trackable {trackable.UUID}..."); + ResponseObject ro = new ResponseObject("Update Trackable " + trackable.UUID.ToString(), func); + apiClient.ModifyTrackableAsync(token, trackable,ro.cancellationToken).ContinueWith(OnReceiveObject, ro); return ro; } - static public ResponseObject DeleteTrackableAsync(WorldStorageServer ws, Guid UUID, Action> func) + + static public string DeleteTrackableSync(WorldStorageServer ws, Guid UUID) + { + wsServer = ws; + var httpClient = new BasicHTTPClient(ws.URI); + apiClient = new WorldStorageClient(httpClient); + + Debug.Log($"[REST] Delete Trackable {UUID}..."); + return apiClient.DeleteTrackable(token, UUID).Message; + } + + static public ResponseObject DeleteTrackableAsync(WorldStorageServer ws, Guid UUID, Action> func) { wsServer = ws; var httpClient = new UnityWebRequestHttpClient(ws.URI); apiClient = new WorldStorageClient(httpClient); - Debug.Log("Delete 1 Trackable..."); - ResponseObject ro = new ResponseObject("Delete Trackable " + UUID.ToString(), func); - apiClient.DeleteTrackableAsync(token, UUID, ro.cancellationToken).ContinueWith(OnReceiveObject, ro); + Debug.Log($"[REST] Delete Trackable {UUID}..."); + ResponseObject ro = new ResponseObject("Delete Trackable " + UUID.ToString(), func); + apiClient.DeleteTrackableAsync(token, UUID, ro.cancellationToken).ContinueWith(OnReceiveObject, ro); return ro; } } diff --git a/Runtime/Scripts/REST/WorldAnchorRequest.cs b/Runtime/Scripts/REST/WorldAnchorRequest.cs index db10a3856062fc4789370725cd0f1bb9a8c754d6..07495de6871eba1663260427d7de94c229198b20 100644 --- a/Runtime/Scripts/REST/WorldAnchorRequest.cs +++ b/Runtime/Scripts/REST/WorldAnchorRequest.cs @@ -18,55 +18,139 @@ // Last change: March 2024 // +using System; using System.Collections.Generic; +using System.Threading.Tasks; using UnityEngine; +using ETSI.ARF.OpenAPI; using ETSI.ARF.OpenAPI.WorldStorage; //#if UNITY_EDITOR namespace ETSI.ARF.WorldStorage.REST { - public class WorldAnchorRequest + public class WorldAnchorRequest : RequestBase { - //static public string AddWorldAnchor(WorldStorageServer ws, WorldAnchor anchor) - //{ - // Debug.Log("Posting Add World Anchor to Server"); - // WorldAnchorsApi api = new WorldAnchorsApi(ws.URI); - // string result = api.AddWorldAnchor(anchor); - // Debug.Log(result); - // return result; - //} - - //static public string UpdateWorldAnchor(WorldStorageServer ws, WorldAnchor anchor) - //{ - // Debug.Log("Posting Add World Anchor to Server"); - // WorldAnchorsApi api = new WorldAnchorsApi(ws.URI); - // string result = api.ModifyWorldAnchor(anchor); - // Debug.Log(result); - // return result; - //} - - //static public List GetAllWorldAnchors(WorldStorageServer ws) - //{ - // WorldAnchorsApi api = new WorldAnchorsApi(ws.URI); - // List result = api.GetWorldAnchors(); - // return result; - //} - - //static public WorldAnchor GetWorldAnchor(WorldStorageServer ws, string uuid) - //{ - // System.Guid _uuid = System.Guid.Parse(uuid); - // WorldAnchorsApi api = new WorldAnchorsApi(ws.URI); - // WorldAnchor result = api.GetWorldAnchorById(_uuid); - // return result; - //} - - //static public void DeleteWorldAnchor(WorldStorageServer ws, string uuid) - //{ - // System.Guid _uuid = System.Guid.Parse(uuid); - // WorldAnchorsApi api = new WorldAnchorsApi(ws.URI); - // api.DeleteWorldAnchor(_uuid); - //} + // + // Wrapper for the endpoints + // + static public WorldAnchor GetWorldAnchorSync(WorldStorageServer ws, Guid UUID) + { + wsServer = ws; + var httpClient = new BasicHTTPClient(ws.URI); + apiClient = new WorldStorageClient(httpClient); + + Debug.Log($"[REST] Request WorldAnchor {UUID}..."); + return apiClient.GetWorldAnchorById(token, UUID); + } + + static public ResponseObject GetWorldAnchorAsync(WorldStorageServer ws, Guid UUID, Action> func) + { + wsServer = ws; + var httpClient = new UnityWebRequestHttpClient(ws.URI); + apiClient = new WorldStorageClient(httpClient); + + Debug.Log($"[REST] Request WorldAnchor {UUID}..."); + ResponseObject ro = new ResponseObject("Request WorldAnchor " + UUID.ToString(), func); + apiClient.GetWorldAnchorByIdAsync(token, UUID, ro.cancellationToken).ContinueWith(OnReceiveObject, ro); + return ro; + } + + static public List GetWorldAnchorsSync(WorldStorageServer ws) + { + wsServer = ws; + var httpClient = new BasicHTTPClient(ws.URI); + apiClient = new WorldStorageClient(httpClient); + + Debug.Log("[REST] Request WorldAnchors..."); + return apiClient.GetWorldAnchors(token).WorldAnchors as List; + } + + static public ResponseObject GetWorldAnchorsAsync(WorldStorageServer ws, Action> func) + { + wsServer = ws; + var httpClient = new UnityWebRequestHttpClient(ws.URI); + apiClient = new WorldStorageClient(httpClient); + + Debug.Log("[REST] Request WorldAnchors..."); + ResponseObject ro = new ResponseObject("Request WorldAnchors", func); + apiClient.GetWorldAnchorsAsync(token, ro.cancellationToken).ContinueWith(OnReceiveListOfObjects, ro); + return ro; + } + + static public string CreateWorldAnchorSync(WorldStorageServer ws, WorldAnchor worldAnchor) + { + wsServer = ws; + var httpClient = new BasicHTTPClient(ws.URI); + apiClient = new WorldStorageClient(httpClient); + + // Add some management stuffs + if (worldAnchor.UUID == Guid.Empty) worldAnchor.UUID = Guid.NewGuid(); + if (worldAnchor.CreatorUUID == Guid.Empty) worldAnchor.CreatorUUID = System.Guid.Parse("8fb169e2-8910-4cd5-a8f9-b7abff38d013"); + + Debug.Log($"[REST] Create WorldAnchor {worldAnchor.UUID}..."); + return apiClient.AddWorldAnchor(token, worldAnchor).Message; + } + + static public ResponseObject CreateWorldAnchorAsync(WorldStorageServer ws, WorldAnchor worldAnchor, Action> func) + { + wsServer = ws; + var httpClient = new UnityWebRequestHttpClient(ws.URI); + apiClient = new WorldStorageClient(httpClient); + + // Add some management stuffs + if (worldAnchor.UUID == Guid.Empty) worldAnchor.UUID = Guid.NewGuid(); + if (worldAnchor.CreatorUUID == Guid.Empty) worldAnchor.CreatorUUID = System.Guid.Parse("8fb169e2-8910-4cd5-a8f9-b7abff38d013"); + + Debug.Log($"[REST] Create WorldAnchor {worldAnchor.UUID}..."); + ResponseObject ro = new ResponseObject("Create WorldAnchor " + worldAnchor.Name + " (no UUID)", func); + apiClient.AddWorldAnchorAsync(token, worldAnchor, ro.cancellationToken).ContinueWith(OnReceiveObject, ro); + return ro; + } + + static public string UpdateWorldAnchorSync(WorldStorageServer ws, WorldAnchor worldAnchor) + { + wsServer = ws; + var httpClient = new BasicHTTPClient(ws.URI); + apiClient = new WorldStorageClient(httpClient); + + Debug.Log($"[REST] Update WorldAnchor {worldAnchor.UUID}..."); + return apiClient.ModifyWorldAnchor(token, worldAnchor).Message; + } + + static public ResponseObject UpdateWorldAnchorAsync(WorldStorageServer ws, WorldAnchor worldAnchor, Action> func) + { + wsServer = ws; + var httpClient = new UnityWebRequestHttpClient(ws.URI); + apiClient = new WorldStorageClient(httpClient); + + Debug.Log($"[REST] Update WorldAnchor {worldAnchor.UUID}..."); + ResponseObject ro = new ResponseObject("Update WorldAnchor " + worldAnchor.UUID.ToString(), func); + apiClient.ModifyWorldAnchorAsync(token, worldAnchor, ro.cancellationToken).ContinueWith(OnReceiveObject, ro); + return ro; + } + + static public string DeleteWorldAnchorSync(WorldStorageServer ws, Guid UUID) + { + wsServer = ws; + var httpClient = new BasicHTTPClient(ws.URI); + apiClient = new WorldStorageClient(httpClient); + + Debug.Log($"[REST] Delete WorldAnchor {UUID}..."); + return apiClient.DeleteWorldAnchor(token, UUID).Message; + } + + static public ResponseObject DeleteWorldAnchorAsync(WorldStorageServer ws, Guid UUID, Action> func) + { + wsServer = ws; + var httpClient = new UnityWebRequestHttpClient(ws.URI); + apiClient = new WorldStorageClient(httpClient); + + Debug.Log($"[REST] Delete WorldAnchor {UUID}..."); + ResponseObject ro = new ResponseObject("Delete WorldAnchor " + UUID.ToString(), func); + apiClient.DeleteWorldAnchorAsync(token, UUID, ro.cancellationToken).ContinueWith(OnReceiveObject, ro); + return ro; + } } } //#endif \ No newline at end of file diff --git a/Runtime/Scripts/REST/WorldLinkRequest.cs b/Runtime/Scripts/REST/WorldLinkRequest.cs index 07a6c3fabd361c810a591138de64ddeb85b4b69c..d38e1d56f88760eba9468bcae2f834969d496f24 100644 --- a/Runtime/Scripts/REST/WorldLinkRequest.cs +++ b/Runtime/Scripts/REST/WorldLinkRequest.cs @@ -15,58 +15,141 @@ // See the License for the specific language governing permissions and // limitations under the License. // -// Last change: March 2024 +// Last change: June 2024 // +using System; using System.Collections.Generic; +using System.Threading.Tasks; using UnityEngine; +using ETSI.ARF.OpenAPI; using ETSI.ARF.OpenAPI.WorldStorage; -//#if UNITY_EDITOR namespace ETSI.ARF.WorldStorage.REST { - public class WorldLinkRequest + public class WorldLinkRequest : RequestBase { - //static public string AddWorldLink(WorldStorageServer ws, WorldLink link) - //{ - // Debug.Log("Posting Add Trackable to Server"); - // WorldLinksApi api = new WorldLinksApi(ws.URI); - // string result = api.AddWorldLink(link); - // Debug.Log(result); - // return result; - //} - - //static public string UpdateWorldLink(WorldStorageServer ws, WorldLink link) - //{ - // Debug.Log("Posting Add Trackable to Server"); - // WorldLinksApi api = new WorldLinksApi(ws.URI); - // string result = api.ModifyWorldLink(link); - // Debug.Log(result); - // return result; - //} - - //static public List GetAllWorldLinks(WorldStorageServer ws) - //{ - // WorldLinksApi api = new WorldLinksApi(ws.URI); - // List result = api.GetWorldLinks(); - // return result; - //} - - //static public WorldLink GetWorldLink(WorldStorageServer ws, string uuid) - //{ - // System.Guid _uuid = System.Guid.Parse(uuid); - // WorldLinksApi api = new WorldLinksApi(ws.URI); - // WorldLink result = api.GetWorldLinkById(_uuid); - // return result; - //} - - //static public void DeleteWorldLink(WorldStorageServer ws, string uuid) - //{ - // System.Guid _uuid = System.Guid.Parse(uuid); - // WorldLinksApi api = new WorldLinksApi(ws.URI); - // api.DeleteWorldLink(_uuid); - //} + // + // Wrapper for the endpoints + // + static public WorldLink GetWorldLinkSync(WorldStorageServer ws, Guid UUID) + { + wsServer = ws; + var httpClient = new BasicHTTPClient(ws.URI); + apiClient = new WorldStorageClient(httpClient); + + Debug.Log($"[REST] Request WorldLink {UUID}..."); + return apiClient.GetWorldLinkById(token, UUID); + } + + static public ResponseObject GetWorldLinkAsync(WorldStorageServer ws, Guid UUID, Action> func) + { + wsServer = ws; + var httpClient = new UnityWebRequestHttpClient(ws.URI); + apiClient = new WorldStorageClient(httpClient); + + Debug.Log($"[REST] Request WorldLink {UUID}..."); + ResponseObject ro = new ResponseObject("Request WorldLink " + UUID.ToString(), func); + apiClient.GetWorldLinkByIdAsync(token, UUID, ro.cancellationToken).ContinueWith(OnReceiveObject, ro); + return ro; + } + + static public List GetWorldLinksSync(WorldStorageServer ws) + { + wsServer = ws; + var httpClient = new BasicHTTPClient(ws.URI); + apiClient = new WorldStorageClient(httpClient); + + Debug.Log("[REST] Request WorldLinks..."); + return apiClient.GetWorldLinks(token).WorldLinks as List; + } + + static public ResponseObject GetWorldLinksAsync(WorldStorageServer ws, Action> func) + { + wsServer = ws; + var httpClient = new UnityWebRequestHttpClient(ws.URI); + apiClient = new WorldStorageClient(httpClient); + + Debug.Log("[REST] Request WorldLinks..."); + ResponseObject ro = new ResponseObject("Request WorldLinks", func); + apiClient.GetWorldLinksAsync(token, ro.cancellationToken).ContinueWith(OnReceiveListOfObjects, ro); + return ro; + } + + static public string CreateWorldLinkSync(WorldStorageServer ws, WorldLink worldLink) + { + wsServer = ws; + var httpClient = new BasicHTTPClient(ws.URI); + apiClient = new WorldStorageClient(httpClient); + + // Add some management stuffs + if (worldLink.UUID == Guid.Empty) worldLink.UUID = Guid.NewGuid(); + if (worldLink.CreatorUUID == Guid.Empty) worldLink.CreatorUUID = System.Guid.Parse("8fb169e2-8910-4cd5-a8f9-b7abff38d013"); + + Debug.Log($"[REST] Create WorldLink {worldLink.UUID}..."); + return apiClient.AddWorldLink(token, worldLink).Message; + } + + static public ResponseObject CreateWorldLinkAsync(WorldStorageServer ws, WorldLink worldLink, Action> func) + { + wsServer = ws; + var httpClient = new UnityWebRequestHttpClient(ws.URI); + apiClient = new WorldStorageClient(httpClient); + + // Add some management stuffs + if (worldLink.UUID == Guid.Empty) worldLink.UUID = Guid.NewGuid(); + if (worldLink.CreatorUUID == Guid.Empty) worldLink.CreatorUUID = System.Guid.Parse("8fb169e2-8910-4cd5-a8f9-b7abff38d013"); + + Debug.Log($"[REST] Create WorldLink {worldLink.UUID}..."); + ResponseObject ro = new ResponseObject("Create WorldLink (no UUID)", func); + apiClient.AddWorldLinkAsync(token, worldLink, ro.cancellationToken).ContinueWith(OnReceiveObject, ro); + return ro; + } + + static public string UpdateWorldLinkSync(WorldStorageServer ws, WorldLink worldLink) + { + wsServer = ws; + var httpClient = new BasicHTTPClient(ws.URI); + apiClient = new WorldStorageClient(httpClient); + + Debug.Log($"[REST] Update WorldLink {worldLink.UUID}..."); + return apiClient.ModifyWorldLink(token, worldLink).Message; + } + + static public ResponseObject UpdateWorldLinkAsync(WorldStorageServer ws, WorldLink worldLink, Action> func) + { + wsServer = ws; + var httpClient = new UnityWebRequestHttpClient(ws.URI); + apiClient = new WorldStorageClient(httpClient); + + Debug.Log($"[REST] Update WorldLink {worldLink.UUID}..."); + ResponseObject ro = new ResponseObject("Update WorldLink " + worldLink.UUID.ToString(), func); + apiClient.ModifyWorldLinkAsync(token, worldLink, ro.cancellationToken).ContinueWith(OnReceiveObject, ro); + return ro; + } + + static public string DeleteWorldLinkSync(WorldStorageServer ws, Guid UUID) + { + wsServer = ws; + var httpClient = new BasicHTTPClient(ws.URI); + apiClient = new WorldStorageClient(httpClient); + + Debug.Log($"[REST] Delete WorldLink {UUID}..."); + return apiClient.DeleteWorldLink(token, UUID).Message; + } + + static public ResponseObject DeleteWorldLinkAsync(WorldStorageServer ws, Guid UUID, Action> func) + { + wsServer = ws; + var httpClient = new UnityWebRequestHttpClient(ws.URI); + apiClient = new WorldStorageClient(httpClient); + + Debug.Log($"[REST] Delete WorldLink {UUID}..."); + ResponseObject ro = new ResponseObject("Delete WorldLink " + UUID.ToString(), func); + apiClient.DeleteWorldLinkAsync(token, UUID, ro.cancellationToken).ContinueWith(OnReceiveObject, ro); + return ro; + } } } //#endif \ No newline at end of file diff --git a/Runtime/Scripts/WorldStorageInfo.cs b/Runtime/Scripts/WorldStorageInfo.cs index 83421b56e3a4d9647016f8b7ea28383a8c1de5ea..ad815822d3f4bf30e0823d6221196c515dde424c 100644 --- a/Runtime/Scripts/WorldStorageInfo.cs +++ b/Runtime/Scripts/WorldStorageInfo.cs @@ -1,7 +1,7 @@ // // ARF - Augmented Reality Framework (ETSI ISG ARF) // -// Copyright 2022 ETSI +// Copyright 2024 ETSI // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/Runtime/Scripts/WorldStorageUnityHelper.cs b/Runtime/Scripts/WorldStorageUnityHelper.cs new file mode 100644 index 0000000000000000000000000000000000000000..30cc44bf6f191df13c4091b4b34dbe123cca07d4 --- /dev/null +++ b/Runtime/Scripts/WorldStorageUnityHelper.cs @@ -0,0 +1,73 @@ +using ETSI.ARF.OpenAPI.WorldStorage; +using System; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class WorldStorageUnityHelper +{ + /// + /// Convert a float array of length 16 to a Matrix + /// + /// the values to convert + /// Converted Unity Matrix + public static ETSI.ARF.OpenAPI.WorldStorage.Transform3D ConvertUnityToETSIARFTransform3D(Matrix4x4 value) + { + Transform3D result = new Transform3D + { + value.m00, value.m01, value.m02, value.m03, + value.m10, value.m11, value.m12, value.m13, + value.m20, value.m21, value.m22, value.m23, + value.m30, value.m31, value.m32, value.m33, + }; + return result; + } + + /// + /// Convert a float array of length 16 to a Matrix + /// + /// the values to convert + /// Converted Unity Matrix + public static Matrix4x4 ConvertETSIARFTransform3DToUnity(ETSI.ARF.OpenAPI.WorldStorage.Transform3D value) + { + if (value.Count == 16) + { + Matrix4x4 resul = new Matrix4x4(); + resul[0, 0] = value[0]; + resul[0, 1] = value[1]; + resul[0, 2] = value[2]; + resul[0, 3] = value[3]; + + resul[1, 0] = value[4]; + resul[1, 1] = value[5]; + resul[1, 2] = value[6]; + resul[1, 3] = value[7]; + + resul[2, 0] = value[8]; + resul[2, 1] = value[9]; + resul[2, 2] = value[10]; + resul[2, 3] = value[11]; + + resul[3, 0] = value[12]; + resul[3, 1] = value[13]; + resul[3, 2] = value[14]; + resul[3, 3] = value[15]; + + return resul; + } + else + { + throw new ArgumentException("The numer of floats in the value parameter must be 16!"); + } + } + + static public Matrix4x4 MatrixFromLocalCRS(List value) + { + Matrix4x4 result = new Matrix4x4(); + result.m00 = value[0]; result.m01 = value[1]; result.m02 = value[2]; result.m03 = value[3]; + result.m10 = value[4]; result.m11 = value[5]; result.m12 = value[6]; result.m13 = value[7]; + result.m20 = value[8]; result.m21 = value[9]; result.m22 = value[10]; result.m23 = value[11]; + result.m30 = value[12]; result.m31 = value[13]; result.m32 = value[14]; result.m33 = value[15]; + return result; + } +} diff --git a/Runtime/Scripts/WorldStorageUnityHelper.cs.meta b/Runtime/Scripts/WorldStorageUnityHelper.cs.meta new file mode 100644 index 0000000000000000000000000000000000000000..8ef5dba1b9d7eb2c186384cf6445b6a4cbfea7af --- /dev/null +++ b/Runtime/Scripts/WorldStorageUnityHelper.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: dc92958843a03644e8524fd2312c3f42 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/Scripts/csc.rsp.meta b/Runtime/Scripts/csc.rsp.meta index 8c857945de052080f02c7f65a50f031fd8bea918..773242b67e96c56d5e6a23bbe2a1add2b20a775f 100644 --- a/Runtime/Scripts/csc.rsp.meta +++ b/Runtime/Scripts/csc.rsp.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: a94d6effd437d7842907e9a5cfd2732f +guid: 7cf3a1fe1b3964e41afa78147db793b0 DefaultImporter: externalObjects: {} userData: