浏览代码

addde modeSupported UI Text in HDR

/4.1
Shan Jiang 4 年前
当前提交
bac36d40
共有 3 个文件被更改,包括 112 次插入4 次删除
  1. 83
      Assets/Scenes/LightEstimation/HDRLightEstimation.unity
  2. 29
      Assets/Scripts/HDRLightEstimationUI.cs
  3. 4
      ProjectSettings/ProjectSettings.asset

83
Assets/Scenes/LightEstimation/HDRLightEstimation.unity


m_Father: {fileID: 0}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &326400021
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 326400022}
- component: {fileID: 326400024}
- component: {fileID: 326400023}
m_Layer: 5
m_Name: ModeSupported
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &326400022
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 326400021}
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: 1633939411}
m_RootOrder: 8
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 125, y: -1000}
m_SizeDelta: {x: 160, y: 30}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &326400023
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 326400021}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_FontData:
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
m_FontSize: 35
m_FontStyle: 0
m_BestFit: 0
m_MinSize: 3
m_MaxSize: 49
m_Alignment: 0
m_AlignByGeometry: 0
m_RichText: 1
m_HorizontalOverflow: 1
m_VerticalOverflow: 1
m_LineSpacing: 1
m_Text: Current Mode is supported
--- !u!222 &326400024
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 326400021}
m_CullTransparentMesh: 0
--- !u!1 &400734518
GameObject:
m_ObjectHideFlags: 0

m_MainLightIntensityLumens: {fileID: 1373858106}
m_MainLightColor: {fileID: 639485727}
m_SphericalHarmonicsText: {fileID: 1377107162}
m_ModeSupportedText: {fileID: 326400023}
--- !u!114 &1195718495
MonoBehaviour:
m_ObjectHideFlags: 0

- target: {fileID: 2304810881573073946, guid: 4ee22c1f54b174122b6a766fe09e0de8,
type: 3}
propertyPath: m_RootOrder
value: 8
value: 9
objectReference: {fileID: 0}
- target: {fileID: 2304810881573073946, guid: 4ee22c1f54b174122b6a766fe09e0de8,
type: 3}

- {fileID: 1373858105}
- {fileID: 639485726}
- {fileID: 1377107161}
- {fileID: 326400022}
- {fileID: 1595064836}
m_Father: {fileID: 0}
m_RootOrder: 4

29
Assets/Scripts/HDRLightEstimationUI.cs


}
StringBuilder m_SphericalHarmonicsStringBuilder = new StringBuilder("");
[Tooltip("The UI Text element used to display whether the requested light estimation mode is supported on the device.")]
[SerializeField]
Text m_ModeSupportedText;
public Text modeSupportedText
{
get => m_ModeSupportedText;
set => m_ModeSupportedText = value;
}
m_cameraManager = m_LightEstimation.cameraManager;
}
void Update()

SetUIValue(m_LightEstimation.mainLightIntensityLumens, mainLightIntensityLumens);
SetSphericalHarmonicsUIValue(m_LightEstimation.sphericalHarmonics, ambientSphericalHarmonicsText);
SetModeSupportedUIValue(m_cameraManager.requestedLightEstimation, m_cameraManager.requestedFacingDirection);
}
void SetSphericalHarmonicsUIValue(SphericalHarmonicsL2? maybeAmbientSphericalHarmonics, Text text)

text.text = displayValue.HasValue ? displayValue.Value.ToString(): k_UnavailableText;
}
void SetModeSupportedUIValue(ARFoundation.LightEstimation lightEstimation, CameraFacingDirection direction)
{
#if UNITY_IOS
if (direction == CameraFacingDirection.World)
{
m_ModeSupportedText.text = "The requested world facing and HDR Mode is NOT supported on iOS.";
}
#endif
#if UNITY_ANDROID
if (direction == CameraFacingDirection.User)
{
m_ModeSupportedText.text = "The requested user facing and HDR Mode is NOT supported on Android.";
}
#endif
}
ARCameraManager m_cameraManager;
}
}

4
ProjectSettings/ProjectSettings.asset


16:9: 1
Others: 1
bundleVersion: 0.1
preloadedAssets:
- {fileID: 4800000, guid: e7c77f6eaab324a819efdc13b8125a39, type: 3}
- {fileID: -7479341934665344595, guid: e2f869774b12e400996eb546603602e3, type: 2}
preloadedAssets: []
metroInputSource: 0
wsaTransparentSwapchain: 0
m_HolographicPauseOnTrackingLoss: 1

正在加载...
取消
保存