clean project
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 188aa8d1a0e72644faeab939bb702929
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,77 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!21 &2100000
|
||||
Material:
|
||||
serializedVersion: 6
|
||||
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_ShaderKeywords: _EMISSION
|
||||
m_LightmapFlags: 0
|
||||
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_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.14357352, b: 1, a: 1}
|
||||
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1b68ffca77c4c6344af03830dbeca2ca
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,78 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!21 &2100000
|
||||
Material:
|
||||
serializedVersion: 6
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: Clear
|
||||
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_ShaderKeywords: _ALPHAPREMULTIPLY_ON _EMISSION _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A
|
||||
m_LightmapFlags: 0
|
||||
m_EnableInstancingVariants: 0
|
||||
m_DoubleSidedGI: 0
|
||||
m_CustomRenderQueue: 3000
|
||||
stringTagMap:
|
||||
RenderType: Transparent
|
||||
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_Floats:
|
||||
- _BumpScale: 1
|
||||
- _Cutoff: 0.5
|
||||
- _DetailNormalMapScale: 1
|
||||
- _DstBlend: 10
|
||||
- _GlossMapScale: 0
|
||||
- _Glossiness: 0
|
||||
- _GlossyReflections: 1
|
||||
- _Metallic: 0
|
||||
- _Mode: 3
|
||||
- _OcclusionStrength: 1
|
||||
- _Parallax: 0.02
|
||||
- _SmoothnessTextureChannel: 1
|
||||
- _SpecularHighlights: 1
|
||||
- _SrcBlend: 1
|
||||
- _UVSec: 0
|
||||
- _ZWrite: 0
|
||||
m_Colors:
|
||||
- _Color: {r: 1, g: 0.995283, b: 0.995283, a: 0}
|
||||
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 15d1a592c297987428ced42437287bdd
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,77 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!21 &2100000
|
||||
Material:
|
||||
serializedVersion: 6
|
||||
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_ShaderKeywords: _EMISSION
|
||||
m_LightmapFlags: 0
|
||||
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_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.029469624, g: 1, b: 0.023584902, a: 1}
|
||||
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2512827267cc0da4a90ecb92fd35043b
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,87 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!21 &2100000
|
||||
Material:
|
||||
serializedVersion: 6
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: LineMat
|
||||
m_Shader: {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_ShaderKeywords: _EMISSION
|
||||
m_LightmapFlags: 2
|
||||
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_Floats:
|
||||
- _BumpScale: 1
|
||||
- _ColorMask: 15
|
||||
- _Cutoff: 0.5
|
||||
- _DetailNormalMapScale: 1
|
||||
- _DstBlend: 0
|
||||
- _GlossMapScale: 1
|
||||
- _Glossiness: 0
|
||||
- _GlossyReflections: 1
|
||||
- _InvFade: 1
|
||||
- _Metallic: 0
|
||||
- _Mode: 0
|
||||
- _OcclusionStrength: 1
|
||||
- _Parallax: 0.02
|
||||
- _SmoothnessTextureChannel: 0
|
||||
- _SpecularHighlights: 1
|
||||
- _SrcBlend: 1
|
||||
- _Stencil: 0
|
||||
- _StencilComp: 8
|
||||
- _StencilOp: 0
|
||||
- _StencilReadMask: 255
|
||||
- _StencilWriteMask: 255
|
||||
- _UVSec: 0
|
||||
- _UseUIAlphaClip: 0
|
||||
- _ZWrite: 1
|
||||
m_Colors:
|
||||
- _Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
- _EmissionColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
- _TintColor: {r: 0.5, g: 0.5, b: 0.5, a: 0.5}
|
||||
m_BuildTextureStacks: []
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0cbffc4fb1a293742bc1585db8956773
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 2100000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,81 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!21 &2100000
|
||||
Material:
|
||||
serializedVersion: 6
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: Passthrough
|
||||
m_Shader: {fileID: 4800000, guid: 27773a146fd29844e82256d3724c6100, type: 3}
|
||||
m_ShaderKeywords: _ZWRITE_ON
|
||||
m_LightmapFlags: 4
|
||||
m_EnableInstancingVariants: 0
|
||||
m_DoubleSidedGI: 0
|
||||
m_CustomRenderQueue: 1998
|
||||
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_Floats:
|
||||
- _Alpha: 1
|
||||
- _BumpScale: 1
|
||||
- _Cutoff: 0.5
|
||||
- _DetailNormalMapScale: 1
|
||||
- _DstBlend: 0
|
||||
- _EnableStereo: 1
|
||||
- _Gamma: 1
|
||||
- _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}
|
||||
- _TintColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e5462914f0e0ad646bd4fdabf728279c
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,77 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!21 &2100000
|
||||
Material:
|
||||
serializedVersion: 6
|
||||
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_ShaderKeywords: _EMISSION
|
||||
m_LightmapFlags: 0
|
||||
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_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.033018887, b: 0.033018887, a: 1}
|
||||
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0066bacc1d5fc4644948eaee1f667052
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,78 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!21 &2100000
|
||||
Material:
|
||||
serializedVersion: 6
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: UIPanelMat
|
||||
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_ShaderKeywords:
|
||||
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_Floats:
|
||||
- _BumpScale: 1
|
||||
- _Cutoff: 0.5
|
||||
- _DetailNormalMapScale: 1
|
||||
- _DstBlend: 0
|
||||
- _GlossMapScale: 1
|
||||
- _Glossiness: 0
|
||||
- _GlossyReflections: 1
|
||||
- _Metallic: 0.659
|
||||
- _Mode: 0
|
||||
- _OcclusionStrength: 1
|
||||
- _Parallax: 0.02
|
||||
- _SmoothnessTextureChannel: 0
|
||||
- _SpecularHighlights: 1
|
||||
- _SrcBlend: 1
|
||||
- _UVSec: 0
|
||||
- _ZWrite: 1
|
||||
m_Colors:
|
||||
- _Color: {r: 0.11764707, g: 0.1254902, b: 0.13333334, a: 1}
|
||||
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
m_BuildTextureStacks: []
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3252edf2caa714746bfd24cc09c37a6a
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 2100000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 38433a3a0a02b054ba5252c8fbfc578f
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,691 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &789684486510353890
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 789684486510353798}
|
||||
m_Layer: 0
|
||||
m_Name: DemoAnchorPlacement
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 0
|
||||
--- !u!4 &789684486510353798
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 789684486510353890}
|
||||
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_Children:
|
||||
- {fileID: 5437877546670600563}
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &1635158904406088745
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 8512930253762707705}
|
||||
- component: {fileID: 4727891907612775661}
|
||||
- component: {fileID: 3441199392180580756}
|
||||
- component: {fileID: 5460655717906273177}
|
||||
m_Layer: 0
|
||||
m_Name: Canvas
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &8512930253762707705
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1635158904406088745}
|
||||
m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071068}
|
||||
m_LocalPosition: {x: 0, y: 0, z: -0.1199}
|
||||
m_LocalScale: {x: 0.0002945197, y: 0.0002945197, z: 0.0002945197}
|
||||
m_Children:
|
||||
- {fileID: 4389028582801061948}
|
||||
m_Father: {fileID: 5437877546670600563}
|
||||
m_RootOrder: 4
|
||||
m_LocalEulerAnglesHint: {x: 90, 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: 400, y: 50}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!223 &4727891907612775661
|
||||
Canvas:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1635158904406088745}
|
||||
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 &3441199392180580756
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1635158904406088745}
|
||||
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
|
||||
--- !u!114 &5460655717906273177
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1635158904406088745}
|
||||
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 &3248597666487992957
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 5437877546670600563}
|
||||
m_Layer: 0
|
||||
m_Name: Anchor Placement Transform
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &5437877546670600563
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3248597666487992957}
|
||||
m_LocalRotation: {x: -0.3420201, y: 0, z: 0, w: 0.9396927}
|
||||
m_LocalPosition: {x: 0, y: 0.0985, z: 0.1157}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children:
|
||||
- {fileID: 7385209481863432126}
|
||||
- {fileID: 8208824031824876697}
|
||||
- {fileID: 2581141925924456888}
|
||||
- {fileID: 5746455440449849712}
|
||||
- {fileID: 8512930253762707705}
|
||||
m_Father: {fileID: 789684486510353798}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: -40, y: 0, z: 0}
|
||||
--- !u!1 &3279740216453087761
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 9102816175310323949}
|
||||
- component: {fileID: 1976559787179131025}
|
||||
- component: {fileID: 1948545280488222271}
|
||||
m_Layer: 0
|
||||
m_Name: Text (TMP)
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &9102816175310323949
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3279740216453087761}
|
||||
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_Children: []
|
||||
m_Father: {fileID: 4389028582801061948}
|
||||
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}
|
||||
m_SizeDelta: {x: 400, y: 50}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &1976559787179131025
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3279740216453087761}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &1948545280488222271
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3279740216453087761}
|
||||
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_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_text: Press A to place 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: 36
|
||||
m_fontSizeBase: 36
|
||||
m_fontWeight: 400
|
||||
m_enableAutoSizing: 0
|
||||
m_fontSizeMin: 18
|
||||
m_fontSizeMax: 72
|
||||
m_fontStyle: 0
|
||||
m_HorizontalAlignment: 2
|
||||
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!1 &3921778342117577572
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 4389028582801061948}
|
||||
- component: {fileID: 2557308963026265035}
|
||||
- component: {fileID: 1817264758056441576}
|
||||
m_Layer: 0
|
||||
m_Name: Panel
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &4389028582801061948
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3921778342117577572}
|
||||
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_Children:
|
||||
- {fileID: 9102816175310323949}
|
||||
m_Father: {fileID: 8512930253762707705}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &2557308963026265035
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3921778342117577572}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &1817264758056441576
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3921778342117577572}
|
||||
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: 0.14117648, g: 0.14901961, b: 0.15686275, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Sprite: {fileID: 10907, 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: 1
|
||||
--- !u!1 &5062237711827999106
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 2581141925924456888}
|
||||
- component: {fileID: 4244866149167792531}
|
||||
- component: {fileID: 1093395891584423953}
|
||||
m_Layer: 0
|
||||
m_Name: Forward
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &2581141925924456888
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 5062237711827999106}
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 0.01, y: 0.01, z: 0.2}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 5437877546670600563}
|
||||
m_RootOrder: 2
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!33 &4244866149167792531
|
||||
MeshFilter:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 5062237711827999106}
|
||||
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
|
||||
--- !u!23 &1093395891584423953
|
||||
MeshRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 5062237711827999106}
|
||||
m_Enabled: 1
|
||||
m_CastShadows: 1
|
||||
m_ReceiveShadows: 1
|
||||
m_DynamicOccludee: 1
|
||||
m_MotionVectors: 1
|
||||
m_LightProbeUsage: 1
|
||||
m_ReflectionProbeUsage: 1
|
||||
m_RayTracingMode: 2
|
||||
m_RenderingLayerMask: 1
|
||||
m_RendererPriority: 0
|
||||
m_Materials:
|
||||
- {fileID: 2100000, guid: 1b68ffca77c4c6344af03830dbeca2ca, 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
|
||||
--- !u!1 &5227710702262040884
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 5746455440449849712}
|
||||
- component: {fileID: 4739711070729164942}
|
||||
- component: {fileID: 7446219725409999024}
|
||||
m_Layer: 0
|
||||
m_Name: Sphere
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &5746455440449849712
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 5227710702262040884}
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 0.025, y: 0.025, z: 0.025}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 5437877546670600563}
|
||||
m_RootOrder: 3
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!33 &4739711070729164942
|
||||
MeshFilter:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 5227710702262040884}
|
||||
m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0}
|
||||
--- !u!23 &7446219725409999024
|
||||
MeshRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 5227710702262040884}
|
||||
m_Enabled: 1
|
||||
m_CastShadows: 1
|
||||
m_ReceiveShadows: 1
|
||||
m_DynamicOccludee: 1
|
||||
m_MotionVectors: 1
|
||||
m_LightProbeUsage: 1
|
||||
m_ReflectionProbeUsage: 1
|
||||
m_RayTracingMode: 2
|
||||
m_RenderingLayerMask: 1
|
||||
m_RendererPriority: 0
|
||||
m_Materials:
|
||||
- {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0}
|
||||
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
|
||||
--- !u!1 &7014476205482876288
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 7385209481863432126}
|
||||
- component: {fileID: 922351037445670373}
|
||||
- component: {fileID: 3681983538041947567}
|
||||
m_Layer: 0
|
||||
m_Name: Left
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &7385209481863432126
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7014476205482876288}
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 0.2, y: 0.01, z: 0.01}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 5437877546670600563}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!33 &922351037445670373
|
||||
MeshFilter:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7014476205482876288}
|
||||
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
|
||||
--- !u!23 &3681983538041947567
|
||||
MeshRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7014476205482876288}
|
||||
m_Enabled: 1
|
||||
m_CastShadows: 1
|
||||
m_ReceiveShadows: 1
|
||||
m_DynamicOccludee: 1
|
||||
m_MotionVectors: 1
|
||||
m_LightProbeUsage: 1
|
||||
m_ReflectionProbeUsage: 1
|
||||
m_RayTracingMode: 2
|
||||
m_RenderingLayerMask: 1
|
||||
m_RendererPriority: 0
|
||||
m_Materials:
|
||||
- {fileID: 2100000, guid: 0066bacc1d5fc4644948eaee1f667052, 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
|
||||
--- !u!1 &9168855660665627914
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 8208824031824876697}
|
||||
- component: {fileID: 8440380491695263565}
|
||||
- component: {fileID: 4443663627753317366}
|
||||
m_Layer: 0
|
||||
m_Name: Up
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &8208824031824876697
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 9168855660665627914}
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 0.01, y: 0.2, z: 0.01}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 5437877546670600563}
|
||||
m_RootOrder: 1
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!33 &8440380491695263565
|
||||
MeshFilter:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 9168855660665627914}
|
||||
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
|
||||
--- !u!23 &4443663627753317366
|
||||
MeshRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 9168855660665627914}
|
||||
m_Enabled: 1
|
||||
m_CastShadows: 1
|
||||
m_ReceiveShadows: 1
|
||||
m_DynamicOccludee: 1
|
||||
m_MotionVectors: 1
|
||||
m_LightProbeUsage: 1
|
||||
m_ReflectionProbeUsage: 1
|
||||
m_RayTracingMode: 2
|
||||
m_RenderingLayerMask: 1
|
||||
m_RendererPriority: 0
|
||||
m_Materials:
|
||||
- {fileID: 2100000, guid: 2512827267cc0da4a90ecb92fd35043b, 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
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bfee9d7faddbe8d40b04d370732cdb52
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cbd6efbdc5102a044bf11631bfccb0c1
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 02e9a487018db0844a1995bc65a47c27
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,267 @@
|
||||
// Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
|
||||
|
||||
using UnityEngine;
|
||||
using TMPro;
|
||||
using UnityEngine.UI;
|
||||
using System.Collections.Generic;
|
||||
|
||||
/// <summary>
|
||||
/// Specific functionality for spawned anchors
|
||||
/// </summary>
|
||||
public class Anchor : MonoBehaviour
|
||||
{
|
||||
/// <summary>
|
||||
/// Anchor handle, gives the id of the anchor
|
||||
/// </summary>
|
||||
public ulong anchorHandle { get { return anchorHandle_; } }
|
||||
|
||||
private ulong anchorHandle_;
|
||||
|
||||
[SerializeField]
|
||||
private Canvas canvas_;
|
||||
[SerializeField]
|
||||
private Transform pivot_;
|
||||
[SerializeField]
|
||||
private GameObject anchorMenu_;
|
||||
private bool isSelected_;
|
||||
private bool isHovered_;
|
||||
[SerializeField]
|
||||
private TextMeshProUGUI anchorName_;
|
||||
[SerializeField]
|
||||
private GameObject saveIcon_;
|
||||
|
||||
[SerializeField]
|
||||
private Image labelImage_;
|
||||
[SerializeField]
|
||||
private Color labelBaseColor_;
|
||||
[SerializeField]
|
||||
private Color labelHighlightColor_;
|
||||
[SerializeField]
|
||||
private Color labelSelectedColor_;
|
||||
|
||||
[SerializeField]
|
||||
private AnchorUIManager uiManager_;
|
||||
|
||||
[SerializeField]
|
||||
private MeshRenderer[] renderers_;
|
||||
|
||||
private int menuIndex_ = 0;
|
||||
[SerializeField]
|
||||
private List<Button> buttonList_;
|
||||
private Button selectedButton_;
|
||||
|
||||
|
||||
#region Monobehaviour Methods
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
anchorMenu_.SetActive(false);
|
||||
renderers_ = GetComponentsInChildren<MeshRenderer>();
|
||||
canvas_.worldCamera = Camera.main;
|
||||
selectedButton_ = buttonList_[0];
|
||||
selectedButton_.OnSelect(null);
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
// Billboard the boundary
|
||||
BillboardPanel(canvas_.transform);
|
||||
// Billboard the menu
|
||||
BillboardPanel(pivot_);
|
||||
|
||||
HandleMenuNavigation();
|
||||
}
|
||||
|
||||
#endregion // Monobehaviour Methods
|
||||
|
||||
|
||||
#region UI Event Listeners
|
||||
|
||||
/// <summary>
|
||||
/// UI callback for the anchor menu's Save button
|
||||
/// </summary>
|
||||
public void OnSaveLocalButtonPressed()
|
||||
{
|
||||
AnchorSession.Instance.SaveAnchor(anchorHandle, AnchorSession.StorageLocation.LOCAL);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// UI callback for the anchor menu's Hide button
|
||||
/// </summary>
|
||||
public void OnHideButtonPressed()
|
||||
{
|
||||
AnchorSession.Instance.DestroyAnchor(anchorHandle);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// UI callback for the anchor menu's Erase button
|
||||
/// </summary>
|
||||
public void OnEraseButtonPressed()
|
||||
{
|
||||
AnchorSession.Instance.EraseAnchor(anchorHandle);
|
||||
}
|
||||
|
||||
#endregion // UI Event Listeners
|
||||
|
||||
|
||||
#region Public Methods
|
||||
|
||||
/// <summary>
|
||||
/// Handles interaction when anchor is hovered
|
||||
/// </summary>
|
||||
public void OnHoverStart()
|
||||
{
|
||||
if (isHovered_)
|
||||
{
|
||||
return;
|
||||
}
|
||||
isHovered_ = true;
|
||||
|
||||
// Yellow highlight
|
||||
foreach (MeshRenderer renderer in renderers_)
|
||||
{
|
||||
renderer.material.SetColor("_EmissionColor", Color.yellow);
|
||||
}
|
||||
labelImage_.color = labelHighlightColor_;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Handles interaction when anchor is no longer hovered
|
||||
/// </summary>
|
||||
public void OnHoverEnd()
|
||||
{
|
||||
if (!isHovered_)
|
||||
{
|
||||
return;
|
||||
}
|
||||
isHovered_ = false;
|
||||
|
||||
// Go back to normal
|
||||
foreach (MeshRenderer renderer in renderers_)
|
||||
{
|
||||
renderer.material.SetColor("_EmissionColor", Color.clear);
|
||||
}
|
||||
|
||||
if (isSelected_)
|
||||
{
|
||||
labelImage_.color = labelSelectedColor_;
|
||||
}
|
||||
else
|
||||
{
|
||||
labelImage_.color = labelBaseColor_;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Handles interaction when anchor is selected
|
||||
/// </summary>
|
||||
public void OnSelect()
|
||||
{
|
||||
if (isSelected_)
|
||||
{
|
||||
// Hide Anchor menu on deselect
|
||||
anchorMenu_.SetActive(false);
|
||||
isSelected_ = false;
|
||||
selectedButton_ = null;
|
||||
if (isHovered_)
|
||||
{
|
||||
labelImage_.color = labelHighlightColor_;
|
||||
}
|
||||
else
|
||||
{
|
||||
labelImage_.color = labelBaseColor_;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Show Anchor Menu on select
|
||||
anchorMenu_.SetActive(true);
|
||||
isSelected_ = true;
|
||||
selectedButton_ = buttonList_[0];
|
||||
selectedButton_.OnSelect(null);
|
||||
if (isHovered_)
|
||||
{
|
||||
labelImage_.color = labelHighlightColor_;
|
||||
}
|
||||
else
|
||||
{
|
||||
labelImage_.color = labelSelectedColor_;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets this anchor's handle
|
||||
/// </summary>
|
||||
/// <param name="handle"></param>
|
||||
public void SetAnchorHandle(ulong handle)
|
||||
{
|
||||
anchorHandle_ = handle;
|
||||
anchorName_.text = "ID: " + anchorHandle_;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Enables the save icon on the anchor menu
|
||||
/// </summary>
|
||||
public void ShowSaveIcon()
|
||||
{
|
||||
saveIcon_.SetActive(true);
|
||||
}
|
||||
|
||||
#endregion // Public Methods
|
||||
|
||||
|
||||
#region Private Methods
|
||||
|
||||
private void BillboardPanel(Transform panel)
|
||||
{
|
||||
// The z axis of the panel faces away from the side that is rendered, therefore this code is actually looking away from the camera
|
||||
panel.LookAt(new Vector3(panel.position.x * 2 - Camera.main.transform.position.x, panel.position.y * 2 - Camera.main.transform.position.y, panel.position.z * 2 - Camera.main.transform.position.z), Vector3.up);
|
||||
}
|
||||
|
||||
private void HandleMenuNavigation()
|
||||
{
|
||||
if (!isSelected_)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (OVRInput.GetDown(OVRInput.RawButton.RThumbstickUp))
|
||||
{
|
||||
NavigateToIndexInMenu(false);
|
||||
}
|
||||
if (OVRInput.GetDown(OVRInput.RawButton.RThumbstickDown))
|
||||
{
|
||||
NavigateToIndexInMenu(true);
|
||||
}
|
||||
if (OVRInput.GetDown(OVRInput.RawButton.RIndexTrigger))
|
||||
{
|
||||
selectedButton_.OnSubmit(null);
|
||||
}
|
||||
}
|
||||
|
||||
private void NavigateToIndexInMenu(bool moveNext)
|
||||
{
|
||||
if (moveNext)
|
||||
{
|
||||
menuIndex_++;
|
||||
if (menuIndex_ > buttonList_.Count - 1)
|
||||
{
|
||||
menuIndex_ = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
menuIndex_--;
|
||||
if (menuIndex_ < 0)
|
||||
{
|
||||
menuIndex_ = buttonList_.Count - 1;
|
||||
}
|
||||
}
|
||||
selectedButton_.OnDeselect(null);
|
||||
selectedButton_ = buttonList_[menuIndex_];
|
||||
selectedButton_.OnSelect(null);
|
||||
}
|
||||
|
||||
#endregion // Private Methods
|
||||
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 41d1cb331bd351f4d967860f51af129e
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,121 @@
|
||||
// Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
|
||||
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using UnityEngine;
|
||||
|
||||
public class AnchorHelpers
|
||||
{
|
||||
private static Camera camera;
|
||||
|
||||
// Caching main camera for performance
|
||||
private static Camera MainCamera
|
||||
{
|
||||
get
|
||||
{
|
||||
if (camera == null)
|
||||
{
|
||||
camera = Camera.main;
|
||||
}
|
||||
return camera;
|
||||
}
|
||||
}
|
||||
|
||||
// Pose Helper Functions
|
||||
public static OVRPlugin.Posef UnityWorldSpacePoseToTrackingSpacePose(Transform pose)
|
||||
{
|
||||
OVRPose trackingPose = OVRExtensions.ToTrackingSpacePose(pose, MainCamera);
|
||||
return trackingPose.ToPosef();
|
||||
}
|
||||
|
||||
public static OVRPose TrackingSpacePoseToUnityWorldSpacePose(OVRPlugin.Posef pose)
|
||||
{
|
||||
OVRPose worldPose = OVRExtensions.ToWorldSpacePose(pose.ToOVRPose());
|
||||
return worldPose;
|
||||
}
|
||||
|
||||
public static OVRPose getTransformUnityWorldFromDevice()
|
||||
{
|
||||
OVRPose T_UnityWorld_Device = MainCamera.transform.ToOVRPose();
|
||||
return T_UnityWorld_Device;
|
||||
}
|
||||
|
||||
// Used to cast byte arrays into structs for the SPS event queue
|
||||
public static T ByteArrayToStruct<T>(byte[] bytes) where T : struct
|
||||
{
|
||||
T val;
|
||||
GCHandle handle = GCHandle.Alloc(bytes, GCHandleType.Pinned);
|
||||
try
|
||||
{
|
||||
val = (T)Marshal.PtrToStructure(handle.AddrOfPinnedObject(), typeof(T));
|
||||
}
|
||||
finally
|
||||
{
|
||||
handle.Free();
|
||||
}
|
||||
return val;
|
||||
}
|
||||
|
||||
// Converts Byte array to string with Uuid format "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"
|
||||
public static string UuidToString(byte[] encodedMessage)
|
||||
{
|
||||
if (encodedMessage.Length != 16)
|
||||
{
|
||||
AnchorSession.Log("UuidToString failed because uuid byte array was incorrect length: " + encodedMessage.Length);
|
||||
return "";
|
||||
}
|
||||
|
||||
StringBuilder message = new StringBuilder("", 36);
|
||||
var messageWithNoDashes = BitConverter.ToString(encodedMessage).ToLower().Replace('-'.ToString(), String.Empty);
|
||||
for (int iter = 0; iter < 32; iter++)
|
||||
{
|
||||
if (iter == 8 || iter == 12 || iter == 16 || iter == 20)
|
||||
{
|
||||
message.Append("-");
|
||||
}
|
||||
message.Append(messageWithNoDashes[iter]);
|
||||
}
|
||||
return message.ToString();
|
||||
}
|
||||
|
||||
// Converts hex string with Uuid format "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX" to Byte array Uuid
|
||||
public static byte[] StringToUuid(string str)
|
||||
{
|
||||
byte[] uuid = new byte[16];
|
||||
str = str.Replace("-", "");
|
||||
if (str.Length != 32)
|
||||
{
|
||||
AnchorSession.Log("StringToUuid failed because string was incorrect length: " + str.Length);
|
||||
return uuid;
|
||||
}
|
||||
|
||||
for (int i = 0; i < 16; ++i)
|
||||
{
|
||||
uuid[i] = (byte)(GetHexVal(str[2 * i]) * 16 + GetHexVal(str[(2 * i) + 1]));
|
||||
}
|
||||
return uuid;
|
||||
}
|
||||
|
||||
private static int GetHexVal(char hex)
|
||||
{
|
||||
int val = (int)hex;
|
||||
if (val >= '0' && val <= '9')
|
||||
{
|
||||
return val - 48;
|
||||
}
|
||||
else if (val >= 'a' && val <= 'f')
|
||||
{
|
||||
return val - 87;
|
||||
}
|
||||
else if (val >= 'A' && val <= 'F')
|
||||
{
|
||||
return val - 55;
|
||||
}
|
||||
else
|
||||
{
|
||||
AnchorSession.Log("GetHexVal failed because of invalid hex character: " + hex);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0add13ce028c7d94c9a6ef8369573e0b
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,59 @@
|
||||
// Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
|
||||
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public abstract class AnchorSession : MonoBehaviour
|
||||
{
|
||||
public static AnchorSession Instance;
|
||||
|
||||
public const ulong kInvalidHandle = ulong.MaxValue;
|
||||
|
||||
public enum StorageLocation
|
||||
{
|
||||
LOCAL = 0
|
||||
}
|
||||
|
||||
public Dictionary<ulong, Anchor> handleToAnchor = new Dictionary<ulong, Anchor>();
|
||||
|
||||
protected const int maxEvents = 5;
|
||||
protected const float eventPollingRate = 0.1f;
|
||||
|
||||
protected GameObject anchorPrefab_ = null;
|
||||
|
||||
protected virtual void Awake()
|
||||
{
|
||||
if (Instance == null)
|
||||
{
|
||||
Instance = this;
|
||||
}
|
||||
else
|
||||
{
|
||||
Destroy(this);
|
||||
}
|
||||
|
||||
anchorPrefab_ = AnchorSpawner.Instance.AnchorPrefab;
|
||||
}
|
||||
|
||||
public static void Log(string message)
|
||||
{
|
||||
const string tag = "SpatialAnchorsUnity: ";
|
||||
Debug.Log(tag + message);
|
||||
}
|
||||
|
||||
protected static bool isFlagSet(uint bitset, uint flag)
|
||||
{
|
||||
return (bitset & flag) != 0;
|
||||
}
|
||||
|
||||
public abstract ulong CreateSpatialAnchor(Transform T_UnityWorld_Anchor);
|
||||
|
||||
public abstract void DestroyAnchor(ulong anchorHandle);
|
||||
|
||||
public abstract void SaveAnchor(ulong anchorHandle, StorageLocation location);
|
||||
|
||||
public abstract void EraseAnchor(ulong anchorHandle);
|
||||
|
||||
public abstract void QueryAllLocalAnchors();
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 41eaaa4b02ccec843a6585b66e32ff1c
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,67 @@
|
||||
// Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
|
||||
|
||||
using UnityEngine;
|
||||
|
||||
/// <summary>
|
||||
/// Spawns anchors at a specific transform.
|
||||
/// </summary>
|
||||
public class AnchorSpawner : MonoBehaviour
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Anchor Spawner singleton instance
|
||||
/// </summary>
|
||||
public static AnchorSpawner Instance;
|
||||
|
||||
/// <summary>
|
||||
/// Anchor Prefab, used for spawning an anchor
|
||||
/// </summary>
|
||||
public GameObject AnchorPrefab { get { return anchorPrefab_; } }
|
||||
|
||||
[SerializeField]
|
||||
private GameObject anchorPrefab_ = null;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
if (Instance == null)
|
||||
{
|
||||
Instance = this;
|
||||
}
|
||||
else
|
||||
{
|
||||
Destroy(this);
|
||||
}
|
||||
gameObject.AddComponent<SpatialAnchorSession>();
|
||||
}
|
||||
|
||||
|
||||
#region Anchor Management
|
||||
|
||||
/// <summary>
|
||||
/// Spawns an anchor and parents it under the given transform
|
||||
/// </summary>
|
||||
/// <param name="transform"></param>
|
||||
public void PlaceAnchorAtTransform(Transform transform)
|
||||
{
|
||||
AnchorSession.Log("Placing anchor at pose: " + transform.ToOVRPose().ToPosef().ToString());
|
||||
|
||||
var anchorHandle = AnchorSession.Instance.CreateSpatialAnchor(transform);
|
||||
if (anchorHandle == AnchorSession.kInvalidHandle)
|
||||
{
|
||||
AnchorSession.Log("Failed to create spatial anchor");
|
||||
return;
|
||||
}
|
||||
|
||||
GameObject anchorObject = Instantiate(anchorPrefab_);
|
||||
Anchor anchor = anchorObject.GetComponent<Anchor>();
|
||||
if (anchor == null)
|
||||
{
|
||||
anchor = anchorObject.AddComponent<Anchor>();
|
||||
}
|
||||
anchor.SetAnchorHandle(anchorHandle);
|
||||
|
||||
AnchorSession.Instance.handleToAnchor.Add(anchorHandle, anchor);
|
||||
}
|
||||
|
||||
#endregion // Anchor Management
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: eb5a075e3decb0d49a881c4b110ec41b
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,324 @@
|
||||
// Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
|
||||
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
/// <summary>
|
||||
/// Manages UI of anchor sample.
|
||||
/// </summary>
|
||||
public class AnchorUIManager : MonoBehaviour
|
||||
{
|
||||
/// <summary>
|
||||
/// Anchor UI manager singleton instance
|
||||
/// </summary>
|
||||
public static AnchorUIManager Instance;
|
||||
|
||||
/// <summary>
|
||||
/// Anchor Mode switches between create and select
|
||||
/// </summary>
|
||||
public enum AnchorMode { Create, Select };
|
||||
|
||||
[SerializeField]
|
||||
private GameObject mainMenu_ = null;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject createModeButton_;
|
||||
[SerializeField]
|
||||
private GameObject selectModeButton_;
|
||||
|
||||
[SerializeField]
|
||||
private Transform trackedDevice_;
|
||||
private Transform raycastOrigin_;
|
||||
private bool drawRaycast_ = false;
|
||||
[SerializeField]
|
||||
private LineRenderer lineRenderer_;
|
||||
|
||||
private Anchor hoveredAnchor_;
|
||||
private Anchor selectedAnchor_;
|
||||
|
||||
private AnchorMode mode_ = AnchorMode.Create;
|
||||
|
||||
[SerializeField]
|
||||
private List<Button> buttonList_;
|
||||
|
||||
private int menuIndex_ = 0;
|
||||
private Button selectedButton_;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject placementPreview_;
|
||||
|
||||
[SerializeField]
|
||||
private Transform anchorPlacementTransform_;
|
||||
|
||||
private delegate void PrimaryPressDelegate();
|
||||
private PrimaryPressDelegate primaryPressDelegate_;
|
||||
|
||||
private bool isFocused_ = true;
|
||||
|
||||
#region Monobehaviour Methods
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
if (Instance == null)
|
||||
{
|
||||
Instance = this;
|
||||
}
|
||||
else
|
||||
{
|
||||
Destroy(this);
|
||||
}
|
||||
}
|
||||
|
||||
private void Start()
|
||||
{
|
||||
raycastOrigin_ = trackedDevice_;
|
||||
|
||||
selectedButton_ = buttonList_[0];
|
||||
buttonList_[0].OnSelect(null);
|
||||
|
||||
lineRenderer_.startWidth = 0.005f;
|
||||
lineRenderer_.endWidth = 0.005f;
|
||||
|
||||
ToggleCreateMode();
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (drawRaycast_)
|
||||
{
|
||||
ControllerRaycast();
|
||||
}
|
||||
|
||||
if (selectedAnchor_ == null)
|
||||
{
|
||||
// Refocus menu
|
||||
selectedButton_.OnSelect(null);
|
||||
isFocused_ = true;
|
||||
}
|
||||
|
||||
HandleMenuNavigation();
|
||||
|
||||
if (OVRInput.GetDown(OVRInput.RawButton.A))
|
||||
{
|
||||
primaryPressDelegate_?.Invoke();
|
||||
}
|
||||
}
|
||||
|
||||
#endregion // Monobehaviour Methods
|
||||
|
||||
|
||||
#region Menu UI Callbacks
|
||||
|
||||
/// <summary>
|
||||
/// Create mode button pressed UI callback. Referenced by the Create button in the menu.
|
||||
/// </summary>
|
||||
public void OnCreateModeButtonPressed()
|
||||
{
|
||||
ToggleCreateMode();
|
||||
createModeButton_.SetActive(!createModeButton_.activeSelf);
|
||||
selectModeButton_.SetActive(!selectModeButton_.activeSelf);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Load anchors button pressed UI callback. Referenced by the Load Anchors button in the menu.
|
||||
/// </summary>
|
||||
public void OnLoadAnchorsButtonPressed()
|
||||
{
|
||||
AnchorSession.Instance.QueryAllLocalAnchors();
|
||||
}
|
||||
|
||||
#endregion // Menu UI Callbacks
|
||||
|
||||
|
||||
#region Mode Handling
|
||||
|
||||
private void ToggleCreateMode()
|
||||
{
|
||||
if (mode_ == AnchorMode.Select)
|
||||
{
|
||||
mode_ = AnchorMode.Create;
|
||||
EndSelectMode();
|
||||
StartPlacementMode();
|
||||
}
|
||||
else
|
||||
{
|
||||
mode_ = AnchorMode.Select;
|
||||
EndPlacementMode();
|
||||
StartSelectMode();
|
||||
}
|
||||
}
|
||||
|
||||
private void StartPlacementMode()
|
||||
{
|
||||
ShowAnchorPreview();
|
||||
primaryPressDelegate_ = PlaceAnchor;
|
||||
}
|
||||
|
||||
private void EndPlacementMode()
|
||||
{
|
||||
HideAnchorPreview();
|
||||
primaryPressDelegate_ = null;
|
||||
}
|
||||
|
||||
private void StartSelectMode()
|
||||
{
|
||||
ShowRaycastLine();
|
||||
primaryPressDelegate_ = SelectAnchor;
|
||||
}
|
||||
|
||||
private void EndSelectMode()
|
||||
{
|
||||
HideRaycastLine();
|
||||
primaryPressDelegate_ = null;
|
||||
}
|
||||
|
||||
#endregion // Mode Handling
|
||||
|
||||
|
||||
#region Private Methods
|
||||
|
||||
private void HandleMenuNavigation()
|
||||
{
|
||||
if (!isFocused_)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (OVRInput.GetDown(OVRInput.RawButton.RThumbstickUp))
|
||||
{
|
||||
NavigateToIndexInMenu(false);
|
||||
}
|
||||
if (OVRInput.GetDown(OVRInput.RawButton.RThumbstickDown))
|
||||
{
|
||||
NavigateToIndexInMenu(true);
|
||||
}
|
||||
if (OVRInput.GetDown(OVRInput.RawButton.RIndexTrigger))
|
||||
{
|
||||
selectedButton_.OnSubmit(null);
|
||||
}
|
||||
}
|
||||
|
||||
private void NavigateToIndexInMenu(bool moveNext)
|
||||
{
|
||||
if (moveNext)
|
||||
{
|
||||
menuIndex_++;
|
||||
if (menuIndex_ > buttonList_.Count - 1)
|
||||
{
|
||||
menuIndex_ = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
menuIndex_--;
|
||||
if (menuIndex_ < 0)
|
||||
{
|
||||
menuIndex_ = buttonList_.Count - 1;
|
||||
}
|
||||
}
|
||||
selectedButton_.OnDeselect(null);
|
||||
selectedButton_ = buttonList_[menuIndex_];
|
||||
selectedButton_.OnSelect(null);
|
||||
}
|
||||
|
||||
private void ShowAnchorPreview()
|
||||
{
|
||||
placementPreview_.SetActive(true);
|
||||
}
|
||||
|
||||
private void HideAnchorPreview()
|
||||
{
|
||||
placementPreview_.SetActive(false);
|
||||
}
|
||||
|
||||
private void PlaceAnchor()
|
||||
{
|
||||
AnchorSpawner.Instance.PlaceAnchorAtTransform(anchorPlacementTransform_);
|
||||
}
|
||||
|
||||
private void ShowRaycastLine()
|
||||
{
|
||||
drawRaycast_ = true;
|
||||
lineRenderer_.gameObject.SetActive(true);
|
||||
}
|
||||
|
||||
private void HideRaycastLine()
|
||||
{
|
||||
drawRaycast_ = false;
|
||||
lineRenderer_.gameObject.SetActive(false);
|
||||
}
|
||||
|
||||
private void ControllerRaycast()
|
||||
{
|
||||
Ray ray = new Ray(raycastOrigin_.position, raycastOrigin_.TransformDirection(Vector3.forward));
|
||||
lineRenderer_.SetPosition(0, raycastOrigin_.position);
|
||||
lineRenderer_.SetPosition(1, raycastOrigin_.position + raycastOrigin_.TransformDirection(Vector3.forward) * 10f);
|
||||
|
||||
RaycastHit hit;
|
||||
if (Physics.Raycast(ray, out hit, Mathf.Infinity))
|
||||
{
|
||||
Anchor anchorObject = hit.collider.GetComponent<Anchor>();
|
||||
if (anchorObject != null)
|
||||
{
|
||||
lineRenderer_.SetPosition(1, hit.point);
|
||||
|
||||
HoverAnchor(anchorObject);
|
||||
return;
|
||||
}
|
||||
}
|
||||
UnhoverAnchor();
|
||||
}
|
||||
|
||||
private void HoverAnchor(Anchor anchor)
|
||||
{
|
||||
hoveredAnchor_ = anchor;
|
||||
hoveredAnchor_.OnHoverStart();
|
||||
}
|
||||
|
||||
private void UnhoverAnchor()
|
||||
{
|
||||
if (hoveredAnchor_ == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
hoveredAnchor_.OnHoverEnd();
|
||||
hoveredAnchor_ = null;
|
||||
}
|
||||
|
||||
private void SelectAnchor()
|
||||
{
|
||||
if (hoveredAnchor_ != null)
|
||||
{
|
||||
if (selectedAnchor_ != null)
|
||||
{
|
||||
// Deselect previous Anchor
|
||||
selectedAnchor_.OnSelect();
|
||||
selectedAnchor_ = null;
|
||||
}
|
||||
|
||||
// Select new Anchor
|
||||
selectedAnchor_ = hoveredAnchor_;
|
||||
selectedAnchor_.OnSelect();
|
||||
|
||||
// Defocus menu
|
||||
selectedButton_.OnDeselect(null);
|
||||
isFocused_ = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (selectedAnchor_ != null)
|
||||
{
|
||||
// Deselect previous Anchor
|
||||
selectedAnchor_.OnSelect();
|
||||
selectedAnchor_ = null;
|
||||
|
||||
// Refocus menu
|
||||
selectedButton_.OnSelect(null);
|
||||
isFocused_ = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion // Private Methods
|
||||
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9735d0f6df960334585926b5295e7d18
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,311 @@
|
||||
// Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
/// <summary>
|
||||
/// Handles calls to and from Spatial Anchor SDK
|
||||
/// </summary>
|
||||
public class SpatialAnchorSession : AnchorSession
|
||||
{
|
||||
public Dictionary<ulong, ulong> locateAnchorRequest = new Dictionary<ulong, ulong>();
|
||||
private const string numUuids = "numUuids";
|
||||
|
||||
private void Start()
|
||||
{
|
||||
// Bind Spatial Anchor API callbacks
|
||||
OVRManager.SpatialEntityStorageSave += SpatialAnchorSaved;
|
||||
OVRManager.SpatialEntityQueryResults += SpatialEntityQueryResults;
|
||||
OVRManager.SpatialEntityQueryComplete += SpatialEntityQueryComplete;
|
||||
OVRManager.SpatialEntityStorageErase += SpatialEntityStorageErase;
|
||||
OVRManager.SpatialEntitySetComponentEnabled += SpatialEntitySetComponentEnabled;
|
||||
}
|
||||
|
||||
private void OnDisable()
|
||||
{
|
||||
// Unbind Spatial Anchor API callbacks
|
||||
OVRManager.SpatialEntityStorageSave -= SpatialAnchorSaved;
|
||||
OVRManager.SpatialEntityQueryResults -= SpatialEntityQueryResults;
|
||||
OVRManager.SpatialEntityQueryComplete -= SpatialEntityQueryComplete;
|
||||
OVRManager.SpatialEntityStorageErase -= SpatialEntityStorageErase;
|
||||
OVRManager.SpatialEntitySetComponentEnabled -= SpatialEntitySetComponentEnabled;
|
||||
}
|
||||
|
||||
// ComponentEnabled callback
|
||||
private void SpatialEntitySetComponentEnabled(UInt64 requestId, bool result, OVRPlugin.SpatialEntityComponentType componentType, ulong space)
|
||||
{
|
||||
if (locateAnchorRequest.ContainsKey(requestId) && !handleToAnchor.ContainsKey(locateAnchorRequest[requestId]))
|
||||
{
|
||||
CreateAnchorGameobject(locateAnchorRequest[requestId]);
|
||||
}
|
||||
}
|
||||
|
||||
// Save callback
|
||||
private void SpatialAnchorSaved(UInt64 requestId, UInt64 space, bool result, OVRPlugin.SpatialEntityUuid uuid)
|
||||
{
|
||||
Log("SpatialAnchorSaved requestId: " + requestId + " space: " + space + " result: " + result + " uuid: " + GetUuidString(uuid));
|
||||
|
||||
// Write uuid of saved anchor to file
|
||||
if (!PlayerPrefs.HasKey(numUuids))
|
||||
{
|
||||
PlayerPrefs.SetInt(numUuids, 0);
|
||||
}
|
||||
int playerNumUuids = PlayerPrefs.GetInt(numUuids);
|
||||
PlayerPrefs.SetString("uuid" + playerNumUuids, GetUuidString(uuid));
|
||||
PlayerPrefs.SetInt(numUuids, ++playerNumUuids);
|
||||
|
||||
// Toggle local save icon
|
||||
if (handleToAnchor.ContainsKey(space))
|
||||
{
|
||||
handleToAnchor[space].ShowSaveIcon();
|
||||
}
|
||||
}
|
||||
|
||||
// Erase callback
|
||||
private void SpatialEntityStorageErase(UInt64 requestId, bool result, OVRPlugin.SpatialEntityUuid uuid, OVRPlugin.SpatialEntityStorageLocation location)
|
||||
{
|
||||
Log("SpatialEntityStorageErase requestID: " + requestId + " result: " + result + " uuid: " + GetUuidString(uuid) + " location: " + location);
|
||||
}
|
||||
|
||||
// QueryResult callback
|
||||
private void SpatialEntityQueryResults(UInt64 requestId, int numResults, OVRPlugin.SpatialEntityQueryResult[] results)
|
||||
{
|
||||
for (int i = 0; i < numResults; i++)
|
||||
{
|
||||
var uuid = results[i].uuid;
|
||||
var space = results[i].space;
|
||||
Log("SpatialEntityQueryResult requestId: " + requestId + " space: " + space + " uuid: " + GetUuidString(uuid));
|
||||
tryEnableComponent(space, OVRPlugin.SpatialEntityComponentType.Storable);
|
||||
tryEnableComponent(space, OVRPlugin.SpatialEntityComponentType.Locatable);
|
||||
}
|
||||
}
|
||||
|
||||
// QueryComplete callback
|
||||
private void SpatialEntityQueryComplete(UInt64 requestId, bool result, int numFound)
|
||||
{
|
||||
Log("SpatialEntityQueryComplete requestId: " + requestId + " result: " + result + " numFound: " + numFound);
|
||||
}
|
||||
|
||||
// Converts uuid to string in this format "e875df5e-3f47-4a8f-b0a5-9ca79280b27d"
|
||||
private string GetUuidString(OVRPlugin.SpatialEntityUuid uuid)
|
||||
{
|
||||
byte[] uuidData = new byte[16];
|
||||
BitConverter.GetBytes(uuid.Value_0).CopyTo(uuidData, 0);
|
||||
BitConverter.GetBytes(uuid.Value_1).CopyTo(uuidData, 8);
|
||||
return AnchorHelpers.UuidToString(uuidData);
|
||||
}
|
||||
|
||||
// Enables specified component if not already enabled
|
||||
private void tryEnableComponent(ulong anchorHandle, OVRPlugin.SpatialEntityComponentType type)
|
||||
{
|
||||
bool enabled;
|
||||
bool changePending;
|
||||
bool success = OVRPlugin.SpatialEntityGetComponentEnabled(ref anchorHandle, type, out enabled, out changePending);
|
||||
if (!success)
|
||||
{
|
||||
Log("WARNING SpatialEntityGetComponentEnabled did not complete successfully");
|
||||
}
|
||||
|
||||
if (enabled)
|
||||
{
|
||||
Log("Component of type: " + type + " already enabled for anchorHandle: " + anchorHandle);
|
||||
}
|
||||
else
|
||||
{
|
||||
ulong requestId = 0;
|
||||
OVRPlugin.SpatialEntitySetComponentEnabled(ref anchorHandle, type, true, 0, ref requestId);
|
||||
Log("Enabling component for anchorHandle: " + anchorHandle + " type: " + type + " requestId " + requestId);
|
||||
switch (type)
|
||||
{
|
||||
case OVRPlugin.SpatialEntityComponentType.Locatable:
|
||||
locateAnchorRequest.Add(requestId, anchorHandle);
|
||||
break;
|
||||
case OVRPlugin.SpatialEntityComponentType.Storable:
|
||||
break;
|
||||
default:
|
||||
Log("Tried to enable component that's not supported");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Create anchor gameobject with specified handle
|
||||
private void CreateAnchorGameobject(ulong anchorHandle)
|
||||
{
|
||||
// Create anchor gameobject
|
||||
GameObject anchorObject = Instantiate(anchorPrefab_);
|
||||
Anchor anchor = anchorObject.GetComponent<Anchor>();
|
||||
anchor.SetAnchorHandle(anchorHandle);
|
||||
|
||||
// Add gameobject to dictionary so it can be tracked, toggle save icon
|
||||
handleToAnchor.Add(anchorHandle, anchor);
|
||||
handleToAnchor[anchorHandle].ShowSaveIcon();
|
||||
}
|
||||
|
||||
void LateUpdate()
|
||||
{
|
||||
foreach (var handleAnchorPair in handleToAnchor)
|
||||
{
|
||||
var anchorHandle = handleAnchorPair.Key;
|
||||
var anchor = handleAnchorPair.Value;
|
||||
|
||||
if (anchorHandle == kInvalidHandle)
|
||||
{
|
||||
Log("Error: AnchorHandle invalid in tracking loop!");
|
||||
return;
|
||||
}
|
||||
|
||||
// Set anchor gameobject transform to pose returned from LocateSpace
|
||||
var pose = OVRPlugin.LocateSpace(ref anchorHandle, OVRPlugin.GetTrackingOriginType());
|
||||
anchor.transform.position = pose.ToOVRPose().position;
|
||||
anchor.transform.rotation = pose.ToOVRPose().orientation;
|
||||
}
|
||||
}
|
||||
|
||||
public override ulong CreateSpatialAnchor(Transform T_UnityWorld_Anchor)
|
||||
{
|
||||
OVRPlugin.SpatialEntityAnchorCreateInfo createInfo = new OVRPlugin.SpatialEntityAnchorCreateInfo()
|
||||
{
|
||||
Time = OVRPlugin.GetTimeInSeconds(),
|
||||
BaseTracking = OVRPlugin.GetTrackingOriginType(),
|
||||
PoseInSpace = OVRExtensions.ToOVRPose(T_UnityWorld_Anchor, false).ToPosef()
|
||||
};
|
||||
|
||||
ulong anchorHandle = AnchorSession.kInvalidHandle;
|
||||
if (OVRPlugin.SpatialEntityCreateSpatialAnchor(createInfo, ref anchorHandle))
|
||||
{
|
||||
Log("Spatial anchor created with handle: " + anchorHandle);
|
||||
}
|
||||
else
|
||||
{
|
||||
Log("OVRPlugin.SpatialEntityCreateSpatialAnchor failed");
|
||||
}
|
||||
|
||||
tryEnableComponent(anchorHandle, OVRPlugin.SpatialEntityComponentType.Locatable);
|
||||
tryEnableComponent(anchorHandle, OVRPlugin.SpatialEntityComponentType.Storable);
|
||||
|
||||
return anchorHandle;
|
||||
}
|
||||
|
||||
|
||||
public override void DestroyAnchor(ulong anchorHandle)
|
||||
{
|
||||
Log("DestroyAnchor called on anchorHandle: " + anchorHandle);
|
||||
|
||||
// Destroy anchor gameObject
|
||||
if (handleToAnchor.ContainsKey(anchorHandle))
|
||||
{
|
||||
var anchorObject = handleToAnchor[anchorHandle].gameObject;
|
||||
handleToAnchor.Remove(anchorHandle);
|
||||
Destroy(anchorObject);
|
||||
}
|
||||
|
||||
// Destroy anchor in memory
|
||||
if (!OVRPlugin.DestroySpace(ref anchorHandle))
|
||||
{
|
||||
Log("OVRPlugin.DestroySpace failed for anchorHandle " + anchorHandle);
|
||||
}
|
||||
}
|
||||
|
||||
public override void EraseAnchor(ulong anchorHandle)
|
||||
{
|
||||
Log("EraseAnchor called on anchorHandle: " + anchorHandle);
|
||||
|
||||
// Destroy anchor gameObject
|
||||
if (handleToAnchor.ContainsKey(anchorHandle))
|
||||
{
|
||||
Destroy(handleToAnchor[anchorHandle].gameObject);
|
||||
handleToAnchor.Remove(anchorHandle);
|
||||
}
|
||||
|
||||
// Erase anchor from storage
|
||||
ulong eraseRequest = 0;
|
||||
if (!OVRPlugin.SpatialEntityEraseSpatialEntity(ref anchorHandle, OVRPlugin.SpatialEntityStorageLocation.Local, ref eraseRequest))
|
||||
{
|
||||
Log("OVRPlugin.SpatialEntityEraseSpatialEntity initiated for anchorHandle " + anchorHandle);
|
||||
}
|
||||
}
|
||||
|
||||
public void QueryAnchorByUuid()
|
||||
{
|
||||
// Get number of saved anchor uuids
|
||||
if (!PlayerPrefs.HasKey(numUuids))
|
||||
{
|
||||
PlayerPrefs.SetInt(numUuids, 0);
|
||||
}
|
||||
int playerNumUuids = PlayerPrefs.GetInt("numUuids");
|
||||
Log("numUuids to query with: " + numUuids + " uuids ");
|
||||
if (playerNumUuids == 0)
|
||||
return;
|
||||
|
||||
|
||||
OVRPlugin.SpatialEntityUuid[] uuidArr = new OVRPlugin.SpatialEntityUuid[playerNumUuids];
|
||||
for (int i = 0; i < playerNumUuids; ++i)
|
||||
{
|
||||
string uuidKey = "uuid" + i;
|
||||
string currentUuid = PlayerPrefs.GetString(uuidKey);
|
||||
Log("QueryAnchorByUuid: " + currentUuid);
|
||||
|
||||
var byteArray = AnchorHelpers.StringToUuid(currentUuid);
|
||||
uuidArr[i] = new OVRPlugin.SpatialEntityUuid
|
||||
{
|
||||
Value_0 = BitConverter.ToUInt64(byteArray, 0),
|
||||
Value_1 = BitConverter.ToUInt64(byteArray, 8)
|
||||
};
|
||||
}
|
||||
|
||||
var uuidInfo = new OVRPlugin.SpatialEntityFilterInfoIds
|
||||
{
|
||||
NumIds = playerNumUuids,
|
||||
Ids = uuidArr
|
||||
};
|
||||
|
||||
var queryInfo = new OVRPlugin.SpatialEntityQueryInfo()
|
||||
{
|
||||
QueryType = OVRPlugin.SpatialEntityQueryType.Action,
|
||||
MaxQuerySpaces = 20,
|
||||
Timeout = 0,
|
||||
Location = OVRPlugin.SpatialEntityStorageLocation.Local,
|
||||
ActionType = OVRPlugin.SpatialEntityQueryActionType.Load,
|
||||
FilterType = OVRPlugin.SpatialEntityQueryFilterType.Ids,
|
||||
IdInfo = uuidInfo
|
||||
};
|
||||
|
||||
ulong newReqId = 0;
|
||||
if (!OVRPlugin.SpatialEntityQuerySpatialEntity(queryInfo, ref newReqId))
|
||||
{
|
||||
Log("OVRPlugin.SpatialEntityQuerySpatialEntity initiated");
|
||||
}
|
||||
}
|
||||
|
||||
public override void QueryAllLocalAnchors()
|
||||
{
|
||||
Log("QueryAllLocalAnchors called");
|
||||
var queryInfo = new OVRPlugin.SpatialEntityQueryInfo()
|
||||
{
|
||||
QueryType = OVRPlugin.SpatialEntityQueryType.Action,
|
||||
MaxQuerySpaces = 20,
|
||||
Timeout = 0,
|
||||
Location = OVRPlugin.SpatialEntityStorageLocation.Local,
|
||||
ActionType = OVRPlugin.SpatialEntityQueryActionType.Load,
|
||||
FilterType = OVRPlugin.SpatialEntityQueryFilterType.None,
|
||||
};
|
||||
|
||||
ulong newReqId = 0;
|
||||
if (!OVRPlugin.SpatialEntityQuerySpatialEntity(queryInfo, ref newReqId))
|
||||
{
|
||||
Log("OVRPlugin.SpatialEntityQuerySpatialEntity initiated");
|
||||
}
|
||||
}
|
||||
|
||||
public override void SaveAnchor(ulong anchorHandle, StorageLocation location)
|
||||
{
|
||||
Log("SaveAnchor called on anchorHandle: " + anchorHandle);
|
||||
ulong saveRequest = 0;
|
||||
if (!OVRPlugin.SpatialEntitySaveSpatialEntity(ref anchorHandle, OVRPlugin.SpatialEntityStorageLocation.Local, OVRPlugin.SpatialEntityStoragePersistenceMode.IndefiniteHighPri, ref saveRequest))
|
||||
{
|
||||
Log("OVRPlugin.SpatialEntitySaveSpatialEntity initiated for anchorHandle " + anchorHandle + " location " + location);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: aed24f56a57860947a021f1c69dcbb19
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 02ef9c7f02cc03a468df7f83d4a59b76
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 192 KiB |
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user