GitHub Enterprise
4 年前
当前提交
b326bd71
共有 58 个文件被更改,包括 5984 次插入 和 2227 次删除
-
684Assets/Scenes/ARFoundationMenu/Menu.unity
-
2Assets/Scenes/LightEstimation/Rotator.cs
-
2Assets/Scenes/LightEstimation/HDRLightEstimationSettings.lighting
-
30Assets/Scripts/UX/ARSceneSelectUI.cs
-
3Assets/Scripts/UX/ActiveMenu.cs
-
25Assets/Scripts/UX/CheckAvailableFeatures.cs
-
58Assets/Scripts/HDRLightEstimation.cs
-
141Assets/Scripts/BasicLightEstimationUI.cs
-
5ProjectSettings/EditorBuildSettings.asset
-
10README.md
-
8Assets/Materials/Island.meta
-
636Assets/Prefabs/LightDirectionArrow.prefab
-
7Assets/Prefabs/LightDirectionArrow.prefab.meta
-
1001Assets/Scenes/LightEstimation/BasicLightEstimation.unity
-
72Assets/Scenes/LightEstimation/FacingDirectionManager.cs
-
1001Assets/Scenes/LightEstimation/HDRLightEstimation.unity
-
7Assets/Scenes/LightEstimation/HDRLightEstimation.unity.meta
-
789Assets/Scenes/LightEstimation/Tiny3D.fbx
-
150Assets/Scenes/LightEstimation/Tiny3D.fbx.meta
-
106Assets/Scripts/BasicLightEstimation.cs
-
11Assets/Scripts/HDRLightEstimation.cs.meta
-
104Assets/Scripts/HDRLightEstimationUI.cs
-
11Assets/Scripts/HDRLightEstimationUI.cs.meta
-
109Assets/Materials/Island/CloudMaterial.mat
-
8Assets/Materials/Island/CloudMaterial.mat.meta
-
109Assets/Materials/Island/GrassMaterial.mat
-
8Assets/Materials/Island/GrassMaterial.mat.meta
-
109Assets/Materials/Island/GroundMaterial.mat
-
8Assets/Materials/Island/GroundMaterial.mat.meta
-
109Assets/Materials/Island/RocksMaterial.mat
-
8Assets/Materials/Island/RocksMaterial.mat.meta
-
109Assets/Materials/Island/TreeMaterial.mat
-
8Assets/Materials/Island/TreeMaterial.mat.meta
-
109Assets/Materials/Island/TrunkMaterial.mat
-
8Assets/Materials/Island/TrunkMaterial.mat.meta
-
109Assets/Materials/Island/WIndmillMaterial1.mat
-
8Assets/Materials/Island/WIndmillMaterial1.mat.meta
-
109Assets/Materials/Island/WaterMaterial.mat
-
8Assets/Materials/Island/WaterMaterial.mat.meta
-
109Assets/Materials/Island/WindmillMaterial2.mat
-
8Assets/Materials/Island/WindmillMaterial2.mat.meta
-
109Assets/Materials/Island/WindmillMaterial3.mat
-
8Assets/Materials/Island/WindmillMaterial3.mat.meta
-
109Assets/Materials/Island/WindmillMaterial4.mat
-
8Assets/Materials/Island/WindmillMaterial4.mat.meta
-
7Assets/Scenes/LightEstimation/ARKitHDRLightEstimation.unity.meta
-
52Assets/Scenes/LightEstimation/PlatformSelector.cs
-
1001Assets/Scenes/LightEstimation/ARKitHDRLightEstimation.unity
-
1001Assets/Scenes/LightEstimation/LightEstimation.unity
-
0/Assets/Scenes/LightEstimation/HDRLightEstimationSettings.lighting.meta
-
0/Assets/Scenes/LightEstimation/HDRLightEstimationSettings.lighting
-
0/Assets/Scenes/LightEstimation/FacingDirectionManager.cs.meta
-
0/Assets/Scenes/LightEstimation/BasicLightEstimation.unity.meta
-
0/Assets/Scripts/HDRLightEstimation.cs
-
0/Assets/Scripts/BasicLightEstimationUI.cs.meta
-
0/Assets/Scripts/BasicLightEstimationUI.cs
-
0/Assets/Scripts/BasicLightEstimation.cs.meta
|
|||
using UnityEngine; |
|||
using System; |
|||
using System.Text; |
|||
|
|||
using UnityEngine.Rendering; |
|||
/// A simple UI controller to display light estimation information.
|
|||
/// A simple UI controller to display basic light estimation information.
|
|||
[RequireComponent(typeof(LightEstimation))] |
|||
public class LightEstimationUI : MonoBehaviour |
|||
[RequireComponent(typeof(BasicLightEstimation))] |
|||
public class BasicLightEstimationUI : MonoBehaviour |
|||
[Tooltip("The UI Text element used to display the estimated brightness in the physical environment.")] |
|||
[Tooltip("The UI Text element used to display the estimated ambient intensity in the physical environment.")] |
|||
Text m_BrightnessText; |
|||
Text m_AmbientIntensityText; |
|||
/// The UI Text element used to display the estimated brightness value.
|
|||
/// The UI Text element used to display the estimated ambient intensity value.
|
|||
public Text brightnessText |
|||
public Text ambientIntensityText |
|||
get { return m_BrightnessText; } |
|||
set { m_BrightnessText = brightnessText; } |
|||
get { return m_AmbientIntensityText; } |
|||
set { m_AmbientIntensityText = ambientIntensityText; } |
|||
[Tooltip("The UI Text element used to display the estimated color temperature in the physical environment.")] |
|||
[Tooltip("The UI Text element used to display the estimated ambient color in the physical environment.")] |
|||
Text m_ColorTemperatureText; |
|||
Text m_AmbientColorText; |
|||
/// The UI Text element used to display the estimated color temperature in the scene.
|
|||
/// The UI Text element used to display the estimated ambient color in the scene.
|
|||
public Text colorTemperatureText |
|||
public Text ambientColorText |
|||
get { return m_ColorTemperatureText; } |
|||
set { m_ColorTemperatureText = value; } |
|||
} |
|||
|
|||
[Tooltip("The UI Text element used to display the estimated color correction value for the physical environment.")] |
|||
[SerializeField] |
|||
Text m_ColorCorrectionText; |
|||
|
|||
[Tooltip("The UI Text element used to display the estimated direction of the main light for the physical environment.")] |
|||
[SerializeField] |
|||
Text m_MainLightDirectionText; |
|||
public Text mainLightDirectionText |
|||
{ |
|||
get => m_MainLightDirectionText; |
|||
set => m_MainLightDirectionText = value; |
|||
} |
|||
|
|||
[Tooltip("The UI Text element used to display the estimated intensity in lumens of the main light for the physical environment.")] |
|||
[SerializeField] |
|||
Text m_MainLightIntensityLumens; |
|||
public Text mainLightIntensityLumens |
|||
{ |
|||
get => m_MainLightIntensityLumens; |
|||
set => m_MainLightIntensityLumens = value; |
|||
} |
|||
|
|||
[Tooltip("The UI Text element used to display the estimated color of the main light for the physical environment.")] |
|||
[SerializeField] |
|||
Text m_MainLightColor; |
|||
public Text mainLightColorText |
|||
{ |
|||
get => m_MainLightColor; |
|||
set => m_MainLightColor = value; |
|||
} |
|||
|
|||
[Tooltip("The UI Text element used to display the estimated spherical harmonics coefficients for the physical environment.")] |
|||
[SerializeField] |
|||
Text m_SphericalHarmonicsText; |
|||
public Text ambientSphericalHarmonicsText |
|||
{ |
|||
get => m_SphericalHarmonicsText; |
|||
set => m_SphericalHarmonicsText = value; |
|||
} |
|||
StringBuilder m_SphericalHarmonicsStringBuilder = new StringBuilder(""); |
|||
|
|||
/// <summary>
|
|||
/// The UI Text element used to display the estimated color correction value for the scene.
|
|||
/// </summary>
|
|||
public Text colorCorrectionText |
|||
{ |
|||
get { return m_ColorCorrectionText; } |
|||
set { m_ColorCorrectionText = value; } |
|||
get { return m_AmbientColorText; } |
|||
set { m_AmbientColorText = value; } |
|||
m_LightEstimation = GetComponent<LightEstimation>(); |
|||
m_LightEstimation = GetComponent<BasicLightEstimation>(); |
|||
SetUIValue(m_LightEstimation.brightness, brightnessText); |
|||
SetUIValue(m_LightEstimation.colorTemperature, colorTemperatureText); |
|||
SetUIValue(m_LightEstimation.colorCorrection, colorCorrectionText); |
|||
SetUIValue(m_LightEstimation.mainLightDirection, mainLightDirectionText); |
|||
SetUIValue(m_LightEstimation.mainLightColor, mainLightColorText); |
|||
SetUIValue(m_LightEstimation.mainLightIntensityLumens, mainLightIntensityLumens); |
|||
SetSphericalHarmonicsUIValue(m_LightEstimation.sphericalHarmonics, ambientSphericalHarmonicsText); |
|||
} |
|||
|
|||
void SetSphericalHarmonicsUIValue(SphericalHarmonicsL2? maybeAmbientSphericalHarmonics, Text text) |
|||
{ |
|||
if (text != null) |
|||
{ |
|||
if (maybeAmbientSphericalHarmonics.HasValue) |
|||
{ |
|||
m_SphericalHarmonicsStringBuilder.Clear(); |
|||
for (int i = 0; i < 3; ++i) |
|||
{ |
|||
if (i == 0) |
|||
m_SphericalHarmonicsStringBuilder.Append("R:["); |
|||
else if (i == 1) |
|||
m_SphericalHarmonicsStringBuilder.Append("G:["); |
|||
else |
|||
m_SphericalHarmonicsStringBuilder.Append("B:["); |
|||
SetUIValue(m_LightEstimation.brightness, ambientIntensityText); |
|||
for (int j = 0; j < 9; ++j) |
|||
{ |
|||
m_SphericalHarmonicsStringBuilder.Append(j != 8 ? $"{maybeAmbientSphericalHarmonics.Value[i, j]}, " : $"{maybeAmbientSphericalHarmonics.Value[i, j]}]\n"); |
|||
} |
|||
} |
|||
text.text = m_SphericalHarmonicsStringBuilder.ToString(); |
|||
} |
|||
else |
|||
{ |
|||
text.text = k_UnavailableText; |
|||
} |
|||
} |
|||
//Display color temperature or color correction if supported
|
|||
if (m_LightEstimation.colorTemperature != null) |
|||
SetUIValue(m_LightEstimation.colorTemperature, ambientColorText); |
|||
else if (m_LightEstimation.colorCorrection != null) |
|||
SetUIValue(m_LightEstimation.colorCorrection, ambientColorText); |
|||
else |
|||
SetUIValue<float>(null, ambientColorText); |
|||
|
|||
|
|||
text.text = displayValue.HasValue ? displayValue.Value.ToString(): k_UnavailableText; |
|||
text.text = displayValue.HasValue ? displayValue.Value.ToString(): "Unavailable"; |
|||
const string k_UnavailableText = "Unavailable"; |
|||
|
|||
LightEstimation m_LightEstimation; |
|||
BasicLightEstimation m_LightEstimation; |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 1bf0262f2a4874fc69fea167bebcb14e |
|||
folderAsset: yes |
|||
DefaultImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
%YAML 1.1 |
|||
%TAG !u! tag:unity3d.com,2011: |
|||
--- !u!1 &916868577326146583 |
|||
GameObject: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
serializedVersion: 6 |
|||
m_Component: |
|||
- component: {fileID: 916868577326146582} |
|||
m_Layer: 0 |
|||
m_Name: GreenTip |
|||
m_TagString: Untagged |
|||
m_Icon: {fileID: 0} |
|||
m_NavMeshLayer: 0 |
|||
m_StaticEditorFlags: 0 |
|||
m_IsActive: 1 |
|||
--- !u!4 &916868577326146582 |
|||
Transform: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 916868577326146583} |
|||
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: 916868577675938017} |
|||
- {fileID: 916868579213684350} |
|||
m_Father: {fileID: 916868577924213743} |
|||
m_RootOrder: 1 |
|||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} |
|||
--- !u!1 &916868577675938046 |
|||
GameObject: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
serializedVersion: 6 |
|||
m_Component: |
|||
- component: {fileID: 916868577675938017} |
|||
- component: {fileID: 916868577675938018} |
|||
- component: {fileID: 916868577675938019} |
|||
- component: {fileID: 916868577675938016} |
|||
m_Layer: 0 |
|||
m_Name: TipX1 |
|||
m_TagString: Untagged |
|||
m_Icon: {fileID: 0} |
|||
m_NavMeshLayer: 0 |
|||
m_StaticEditorFlags: 0 |
|||
m_IsActive: 1 |
|||
--- !u!4 &916868577675938017 |
|||
Transform: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 916868577675938046} |
|||
m_LocalRotation: {x: 0.38268343, y: -0, z: -0, w: 0.92387956} |
|||
m_LocalPosition: {x: 0, y: -0.15, z: 0} |
|||
m_LocalScale: {x: 0.1, y: 0.5, z: 0.10000001} |
|||
m_Children: [] |
|||
m_Father: {fileID: 916868577326146582} |
|||
m_RootOrder: 0 |
|||
m_LocalEulerAnglesHint: {x: 45, y: 0, z: 0} |
|||
--- !u!33 &916868577675938018 |
|||
MeshFilter: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 916868577675938046} |
|||
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} |
|||
--- !u!23 &916868577675938019 |
|||
MeshRenderer: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 916868577675938046} |
|||
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_RayTraceProcedural: 0 |
|||
m_RenderingLayerMask: 1 |
|||
m_RendererPriority: 0 |
|||
m_Materials: |
|||
- {fileID: 2100000, guid: e62de97909a2840f786ce710f802cf2d, 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 &916868577675938016 |
|||
BoxCollider: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 916868577675938046} |
|||
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 &916868577924213740 |
|||
GameObject: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
serializedVersion: 6 |
|||
m_Component: |
|||
- component: {fileID: 916868577924213743} |
|||
m_Layer: 0 |
|||
m_Name: Tip |
|||
m_TagString: Untagged |
|||
m_Icon: {fileID: 0} |
|||
m_NavMeshLayer: 0 |
|||
m_StaticEditorFlags: 0 |
|||
m_IsActive: 1 |
|||
--- !u!4 &916868577924213743 |
|||
Transform: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 916868577924213740} |
|||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} |
|||
m_LocalPosition: {x: 0, y: 0, z: 1} |
|||
m_LocalScale: {x: 0.5, y: 0.5, z: 0.5} |
|||
m_Children: |
|||
- {fileID: 916868578582566500} |
|||
- {fileID: 916868577326146582} |
|||
m_Father: {fileID: 916868578267998725} |
|||
m_RootOrder: 1 |
|||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} |
|||
--- !u!1 &916868578147282539 |
|||
GameObject: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
serializedVersion: 6 |
|||
m_Component: |
|||
- component: {fileID: 916868578147282538} |
|||
m_Layer: 0 |
|||
m_Name: LightDirectionArrow |
|||
m_TagString: Untagged |
|||
m_Icon: {fileID: 0} |
|||
m_NavMeshLayer: 0 |
|||
m_StaticEditorFlags: 0 |
|||
m_IsActive: 1 |
|||
--- !u!4 &916868578147282538 |
|||
Transform: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 916868578147282539} |
|||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} |
|||
m_LocalPosition: {x: 0, y: 0, z: 0.9} |
|||
m_LocalScale: {x: 0.05, y: 0.05, z: 0.1} |
|||
m_Children: |
|||
- {fileID: 916868578267998725} |
|||
m_Father: {fileID: 0} |
|||
m_RootOrder: 0 |
|||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} |
|||
--- !u!1 &916868578267998722 |
|||
GameObject: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
serializedVersion: 6 |
|||
m_Component: |
|||
- component: {fileID: 916868578267998725} |
|||
m_Layer: 0 |
|||
m_Name: Offset |
|||
m_TagString: Untagged |
|||
m_Icon: {fileID: 0} |
|||
m_NavMeshLayer: 0 |
|||
m_StaticEditorFlags: 0 |
|||
m_IsActive: 1 |
|||
--- !u!4 &916868578267998725 |
|||
Transform: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 916868578267998722} |
|||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} |
|||
m_LocalPosition: {x: 0, y: 0, z: -0.5} |
|||
m_LocalScale: {x: 1, y: 1, z: 1} |
|||
m_Children: |
|||
- {fileID: 916868579276083149} |
|||
- {fileID: 916868577924213743} |
|||
m_Father: {fileID: 916868578147282538} |
|||
m_RootOrder: 0 |
|||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} |
|||
--- !u!1 &916868578377272062 |
|||
GameObject: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
serializedVersion: 6 |
|||
m_Component: |
|||
- component: {fileID: 916868578377272033} |
|||
- component: {fileID: 916868578377272034} |
|||
- component: {fileID: 916868578377272035} |
|||
- component: {fileID: 916868578377272032} |
|||
m_Layer: 0 |
|||
m_Name: TipX2 |
|||
m_TagString: Untagged |
|||
m_Icon: {fileID: 0} |
|||
m_NavMeshLayer: 0 |
|||
m_StaticEditorFlags: 0 |
|||
m_IsActive: 1 |
|||
--- !u!4 &916868578377272033 |
|||
Transform: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 916868578377272062} |
|||
m_LocalRotation: {x: -0.38268343, y: -0, z: -0, w: 0.92387956} |
|||
m_LocalPosition: {x: 0, y: 0.15, z: 0} |
|||
m_LocalScale: {x: 0.1, y: 0.5, z: 0.10000001} |
|||
m_Children: [] |
|||
m_Father: {fileID: 916868578582566500} |
|||
m_RootOrder: 1 |
|||
m_LocalEulerAnglesHint: {x: -45, y: 0, z: 0} |
|||
--- !u!33 &916868578377272034 |
|||
MeshFilter: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 916868578377272062} |
|||
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} |
|||
--- !u!23 &916868578377272035 |
|||
MeshRenderer: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 916868578377272062} |
|||
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_RayTraceProcedural: 0 |
|||
m_RenderingLayerMask: 1 |
|||
m_RendererPriority: 0 |
|||
m_Materials: |
|||
- {fileID: 2100000, guid: 1d85e66239f5b41eb87246c413157610, 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 &916868578377272032 |
|||
BoxCollider: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 916868578377272062} |
|||
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 &916868578582566501 |
|||
GameObject: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
serializedVersion: 6 |
|||
m_Component: |
|||
- component: {fileID: 916868578582566500} |
|||
m_Layer: 0 |
|||
m_Name: Red tip |
|||
m_TagString: Untagged |
|||
m_Icon: {fileID: 0} |
|||
m_NavMeshLayer: 0 |
|||
m_StaticEditorFlags: 0 |
|||
m_IsActive: 1 |
|||
--- !u!4 &916868578582566500 |
|||
Transform: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 916868578582566501} |
|||
m_LocalRotation: {x: -0, y: -0, z: 0.7071068, w: 0.7071068} |
|||
m_LocalPosition: {x: 0, y: 0, z: 0} |
|||
m_LocalScale: {x: 1, y: 1, z: 1} |
|||
m_Children: |
|||
- {fileID: 916868578838762582} |
|||
- {fileID: 916868578377272033} |
|||
m_Father: {fileID: 916868577924213743} |
|||
m_RootOrder: 0 |
|||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90} |
|||
--- !u!1 &916868578838762583 |
|||
GameObject: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
serializedVersion: 6 |
|||
m_Component: |
|||
- component: {fileID: 916868578838762582} |
|||
- component: {fileID: 916868578838762587} |
|||
- component: {fileID: 916868578838762584} |
|||
- component: {fileID: 916868578838762585} |
|||
m_Layer: 0 |
|||
m_Name: TipX1 |
|||
m_TagString: Untagged |
|||
m_Icon: {fileID: 0} |
|||
m_NavMeshLayer: 0 |
|||
m_StaticEditorFlags: 0 |
|||
m_IsActive: 1 |
|||
--- !u!4 &916868578838762582 |
|||
Transform: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 916868578838762583} |
|||
m_LocalRotation: {x: 0.38268343, y: -0, z: -0, w: 0.92387956} |
|||
m_LocalPosition: {x: 0, y: -0.15, z: 0} |
|||
m_LocalScale: {x: 0.1, y: 0.5, z: 0.10000001} |
|||
m_Children: [] |
|||
m_Father: {fileID: 916868578582566500} |
|||
m_RootOrder: 0 |
|||
m_LocalEulerAnglesHint: {x: 45, y: 0, z: 0} |
|||
--- !u!33 &916868578838762587 |
|||
MeshFilter: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 916868578838762583} |
|||
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} |
|||
--- !u!23 &916868578838762584 |
|||
MeshRenderer: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 916868578838762583} |
|||
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_RayTraceProcedural: 0 |
|||
m_RenderingLayerMask: 1 |
|||
m_RendererPriority: 0 |
|||
m_Materials: |
|||
- {fileID: 2100000, guid: 1d85e66239f5b41eb87246c413157610, 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 &916868578838762585 |
|||
BoxCollider: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 916868578838762583} |
|||
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 &916868579213684351 |
|||
GameObject: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
serializedVersion: 6 |
|||
m_Component: |
|||
- component: {fileID: 916868579213684350} |
|||
- component: {fileID: 916868579213684323} |
|||
- component: {fileID: 916868579213684320} |
|||
- component: {fileID: 916868579213684321} |
|||
m_Layer: 0 |
|||
m_Name: TipX2 |
|||
m_TagString: Untagged |
|||
m_Icon: {fileID: 0} |
|||
m_NavMeshLayer: 0 |
|||
m_StaticEditorFlags: 0 |
|||
m_IsActive: 1 |
|||
--- !u!4 &916868579213684350 |
|||
Transform: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 916868579213684351} |
|||
m_LocalRotation: {x: -0.38268343, y: -0, z: -0, w: 0.92387956} |
|||
m_LocalPosition: {x: 0, y: 0.15, z: 0} |
|||
m_LocalScale: {x: 0.1, y: 0.5, z: 0.10000001} |
|||
m_Children: [] |
|||
m_Father: {fileID: 916868577326146582} |
|||
m_RootOrder: 1 |
|||
m_LocalEulerAnglesHint: {x: -45, y: 0, z: 0} |
|||
--- !u!33 &916868579213684323 |
|||
MeshFilter: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 916868579213684351} |
|||
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} |
|||
--- !u!23 &916868579213684320 |
|||
MeshRenderer: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 916868579213684351} |
|||
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_RayTraceProcedural: 0 |
|||
m_RenderingLayerMask: 1 |
|||
m_RendererPriority: 0 |
|||
m_Materials: |
|||
- {fileID: 2100000, guid: e62de97909a2840f786ce710f802cf2d, 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 &916868579213684321 |
|||
BoxCollider: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 916868579213684351} |
|||
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 &916868579276083146 |
|||
GameObject: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
serializedVersion: 6 |
|||
m_Component: |
|||
- component: {fileID: 916868579276083149} |
|||
- component: {fileID: 916868579276083150} |
|||
- component: {fileID: 916868579276083151} |
|||
- component: {fileID: 916868579276083148} |
|||
m_Layer: 0 |
|||
m_Name: Forward |
|||
m_TagString: Untagged |
|||
m_Icon: {fileID: 0} |
|||
m_NavMeshLayer: 0 |
|||
m_StaticEditorFlags: 0 |
|||
m_IsActive: 1 |
|||
--- !u!4 &916868579276083149 |
|||
Transform: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 916868579276083146} |
|||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} |
|||
m_LocalPosition: {x: 0, y: 0, z: 0.5} |
|||
m_LocalScale: {x: 0.1, y: 0.1, z: 1} |
|||
m_Children: [] |
|||
m_Father: {fileID: 916868578267998725} |
|||
m_RootOrder: 0 |
|||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} |
|||
--- !u!33 &916868579276083150 |
|||
MeshFilter: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 916868579276083146} |
|||
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} |
|||
--- !u!23 &916868579276083151 |
|||
MeshRenderer: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 916868579276083146} |
|||
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_RayTraceProcedural: 0 |
|||
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 |
|||
m_AdditionalVertexStreams: {fileID: 0} |
|||
--- !u!65 &916868579276083148 |
|||
BoxCollider: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 916868579276083146} |
|||
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} |
|
|||
fileFormatVersion: 2 |
|||
guid: c8395de59a6d145749f00299c3bbcb76 |
|||
PrefabImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
1001
Assets/Scenes/LightEstimation/BasicLightEstimation.unity
文件差异内容过多而无法显示
查看文件
文件差异内容过多而无法显示
查看文件
|
|||
using System.Collections; |
|||
using System.Collections.Generic; |
|||
using UnityEngine; |
|||
using UnityEngine.XR.ARFoundation; |
|||
|
|||
namespace UnityEngine.XR.ARFoundation.Samples |
|||
{ |
|||
/// <summary>
|
|||
/// This script enables face tracking with user facing camera and disables it otherwise.
|
|||
/// It enables the world space object with world facing camera and disables it otherwise.
|
|||
/// </summary>
|
|||
[RequireComponent(typeof(ARSessionOrigin))] |
|||
[RequireComponent(typeof(ARFaceManager))] |
|||
[RequireComponent(typeof(ARCameraManager))] |
|||
public class FacingDirectionManager : MonoBehaviour |
|||
{ |
|||
[SerializeField] |
|||
GameObject m_WorldSpaceObject; |
|||
|
|||
public GameObject worldSpaceObject |
|||
{ |
|||
get => m_WorldSpaceObject; |
|||
set => m_WorldSpaceObject = value; |
|||
} |
|||
|
|||
CameraFacingDirection m_CurrentCameraFacingDirection; |
|||
ARCameraManager m_CameraManager; |
|||
|
|||
void OnEnable() |
|||
{ |
|||
m_CameraManager = GetComponentInChildren<ARCameraManager>(); |
|||
m_CurrentCameraFacingDirection = m_CameraManager.currentFacingDirection; |
|||
} |
|||
|
|||
void Update() |
|||
{ |
|||
var updatedCameraFacingDirection = m_CameraManager.currentFacingDirection; |
|||
if (updatedCameraFacingDirection != CameraFacingDirection.None && updatedCameraFacingDirection != m_CurrentCameraFacingDirection) |
|||
{ |
|||
if (updatedCameraFacingDirection == CameraFacingDirection.User) |
|||
{ |
|||
m_CurrentCameraFacingDirection = updatedCameraFacingDirection; |
|||
GetComponent<ARFaceManager>().enabled = true; |
|||
worldSpaceObject.SetActive(false); |
|||
Application.onBeforeRender -= OnBeforeRender; |
|||
} |
|||
else if (updatedCameraFacingDirection == CameraFacingDirection.World) |
|||
{ |
|||
m_CurrentCameraFacingDirection = updatedCameraFacingDirection; |
|||
GetComponent<ARFaceManager>().enabled = false; |
|||
worldSpaceObject.SetActive(true); |
|||
Application.onBeforeRender += OnBeforeRender; |
|||
} |
|||
} |
|||
} |
|||
|
|||
void OnDisable() |
|||
{ |
|||
GetComponent<ARFaceManager>().enabled = false; |
|||
Application.onBeforeRender -= OnBeforeRender; |
|||
} |
|||
|
|||
void OnBeforeRender() |
|||
{ |
|||
var camera = GetComponent<ARSessionOrigin>().camera; |
|||
if (camera && worldSpaceObject) |
|||
{ |
|||
worldSpaceObject.transform.position = camera.transform.position + camera.transform.forward; |
|||
} |
|||
} |
|||
} |
|||
} |
1001
Assets/Scenes/LightEstimation/HDRLightEstimation.unity
文件差异内容过多而无法显示
查看文件
文件差异内容过多而无法显示
查看文件
|
|||
fileFormatVersion: 2 |
|||
guid: 9d96daba3bd254cfebe94efd2d61b2c3 |
|||
DefaultImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
Kaydara FBX Binary L o |
|||
|