浏览代码

Removed some superfluous assets and updated code for better readability.

/3.1
David Mohrhardt 6 年前
当前提交
bd6d21cd
共有 9 个文件被更改,包括 28 次插入289 次删除
  1. 8
      Assets/Materials/EyeLaserMaterial.mat
  2. 96
      Assets/Prefabs/Eye Laser Prefab.prefab
  3. 12
      Assets/Scripts/EyePoseVisualizer.cs
  4. 4
      Assets/Scripts/FixationPoint2DVisualizer.cs
  5. 28
      Assets/Scripts/FixationPoint3DVisualizer.cs
  6. 76
      Assets/Materials/ZMaterial 1.mat
  7. 8
      Assets/Materials/ZMaterial 1.mat.meta
  8. 77
      Assets/Materials/EyeLaserMaterial 1.mat
  9. 8
      Assets/Materials/EyeLaserMaterial 1.mat.meta

8
Assets/Materials/EyeLaserMaterial.mat


m_PrefabAsset: {fileID: 0}
m_Name: EyeLaserMaterial
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords:
m_LightmapFlags: 4
m_ShaderKeywords: _EMISSION
m_LightmapFlags: 2
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -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}
- _Color: {r: 0.8018868, g: 0.47281063, b: 0.47281063, a: 1}
- _EmissionColor: {r: 0.9150943, g: 0.038848326, b: 0.038848326, a: 1}

96
Assets/Prefabs/Eye Laser Prefab.prefab


m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: f0193f5526ec94dec90f9e2245b8d4b9, type: 2}
- {fileID: 2100000, guid: b0a46feb4b70f43f88f599f902d3a3a6, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0

m_Height: 2
m_Direction: 1
m_Center: {x: 0.000000059604645, y: 0, z: -0.00000008940697}
--- !u!1 &5742448745450694299
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 8247788344567932373}
- component: {fileID: 4167325113468462211}
- component: {fileID: 4129805616664749089}
- component: {fileID: 8606903474625777994}
m_Layer: 0
m_Name: Interior Cylinder
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &8247788344567932373
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5742448745450694299}
m_LocalRotation: {x: 0.7071068, y: -0, z: -0, w: 0.7071068}
m_LocalPosition: {x: 0, y: 0, z: -100}
m_LocalScale: {x: -0.01, y: -100.0003, z: -0.01}
m_Children: []
m_Father: {fileID: 2417772964488661957}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0}
--- !u!33 &4167325113468462211
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5742448745450694299}
m_Mesh: {fileID: 10206, guid: 0000000000000000e000000000000000, type: 0}
--- !u!23 &4129805616664749089
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5742448745450694299}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: f0193f5526ec94dec90f9e2245b8d4b9, 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!136 &8606903474625777994
CapsuleCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5742448745450694299}
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 &6696638613615050577
GameObject:
m_ObjectHideFlags: 0

m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 6075187149356605993}
- {fileID: 8247788344567932373}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}

12
Assets/Scripts/EyePoseVisualizer.cs


m_Face = GetComponent<ARFace>();
}
void GetOrCreateEyeGameObjects()
void CreateEyeGameObjectsIfNecessary()
if (m_Face.leftEyeTransform != null && m_Face.rightEyeTransform != null &&
m_LeftEyeGameObject == null && m_RightEyeGameObject == null)
if (m_Face.leftEyeTransform != null && m_LeftEyeGameObject == null )
m_LeftEyeGameObject.SetActive(false);
}
if (m_Face.rightEyeTransform != null && m_RightEyeGameObject == null)
{
m_LeftEyeGameObject.SetActive(false);
m_RightEyeGameObject.SetActive(false);
}
}

void OnUpdated(ARFaceUpdatedEventArgs eventArgs)
{
GetOrCreateEyeGameObjects();
CreateEyeGameObjectsIfNecessary();
UpdateVisibility();
}
}

4
Assets/Scripts/FixationPoint2DVisualizer.cs


m_Face = GetComponent<ARFace>();
}
void GetOrCreateEyeGameObjects()
void CreateEyeGameObjectsIfNecessary()
{
var canvas = FindObjectOfType<Canvas>();
if (m_Face.fixationPointTransform != null && canvas != null && m_FixationReticleGameObject == null)

void OnUpdated(ARFaceUpdatedEventArgs eventArgs)
{
GetOrCreateEyeGameObjects();
CreateEyeGameObjectsIfNecessary();
UpdateVisibility();
UpdateScreenReticle();
}

28
Assets/Scripts/FixationPoint3DVisualizer.cs


public class FixationPoint3DVisualizer : MonoBehaviour
{
[SerializeField]
GameObject m_FixationPointPrefab;
GameObject m_FixationRayPrefab;
public GameObject fixationPointPrefab
public GameObject fixationRayPrefab
get => m_FixationPointPrefab;
set => m_FixationPointPrefab = value;
get => m_FixationRayPrefab;
set => m_FixationRayPrefab = value;
GameObject m_FixationPointGameObject;
GameObject m_FixationRayGameObject;
ARFace m_Face;
XRFaceSubsystem m_FaceSubsystem;

m_Face = GetComponent<ARFace>();
}
void GetOrCreateEyeGameObjects()
void CreateEyeGameObjectsIfNecessary()
if (m_FixationPointGameObject == null && m_Face.fixationPointTransform != null)
if (m_FixationRayGameObject == null && m_Face.fixationPointTransform != null)
m_FixationPointGameObject = Instantiate(m_FixationPointPrefab, m_Face.transform);
m_FixationPointGameObject.SetActive(false);
m_FixationRayGameObject = Instantiate(m_FixationRayPrefab, m_Face.transform);
m_FixationRayGameObject.SetActive(false);
if (m_FixationPointGameObject != null)
m_FixationPointGameObject.SetActive(visible);
if (m_FixationRayGameObject != null)
m_FixationRayGameObject.SetActive(visible);
}
void UpdateVisibility()

void OnUpdated(ARFaceUpdatedEventArgs eventArgs)
{
GetOrCreateEyeGameObjects();
CreateEyeGameObjectsIfNecessary();
UpdateVisibility();
UpdateFixationPoint();
}

if (m_FixationPointGameObject != null)
if (m_FixationRayGameObject != null)
m_FixationPointGameObject.transform.LookAt(m_Face.fixationPointTransform.position);
m_FixationRayGameObject.transform.LookAt(m_Face.fixationPointTransform.position);
}
}

76
Assets/Materials/ZMaterial 1.mat


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: ZMaterial 1
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.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.10196078, g: 0.9281988, b: 0.9529412, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}

8
Assets/Materials/ZMaterial 1.mat.meta


fileFormatVersion: 2
guid: 4260d5b4b48824e04b5464194b713343
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

77
Assets/Materials/EyeLaserMaterial 1.mat


%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: EyeLaserMaterial 1
m_Shader: {fileID: 46, 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
- _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.9811321, g: 0.7821289, b: 0.7821289, a: 1}
- _EmissionColor: {r: 0.7169812, g: 0, b: 0, a: 1}

8
Assets/Materials/EyeLaserMaterial 1.mat.meta


fileFormatVersion: 2
guid: f0193f5526ec94dec90f9e2245b8d4b9
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:
正在加载...
取消
保存