This repository has been archived on 2025-04-28. You can view files and clone it, but cannot push or open issues or pull requests.
ARPlusSystem/ARPlusSystem-250418/Library/PackageCache/com.unity.xr.arfoundation@4.../Editor/ARCameraBackgroundEditor.cs

46 lines
1.6 KiB
C#
Raw Permalink Normal View History

using UnityEngine;
using UnityEngine.XR.ARFoundation;
namespace UnityEditor.XR.ARFoundation
{
[CustomEditor(typeof(ARCameraBackground))]
internal class ARCameraBackgroundEditor : Editor
{
SerializedProperty m_UseCustomMaterial;
SerializedProperty m_CustomMaterial;
static class Tooltips
{
public static readonly GUIContent useCustomMaterial = new GUIContent(
"Use Custom Material",
"When false, a material is generated automatically from the shader included in the platform-specific package. When true, the Custom Material is used instead, overriding the automatically generated one. This is not necessary for most AR experiences.");
public static readonly GUIContent customMaterial = new GUIContent(
"Custom Material",
"The material to use for background rendering.");
}
public override void OnInspectorGUI()
{
serializedObject.Update();
EditorGUILayout.PropertyField(m_UseCustomMaterial, Tooltips.useCustomMaterial);
if (m_UseCustomMaterial.boolValue)
{
++EditorGUI.indentLevel;
EditorGUILayout.PropertyField(m_CustomMaterial, Tooltips.customMaterial);
--EditorGUI.indentLevel;
}
serializedObject.ApplyModifiedProperties();
}
void OnEnable()
{
m_UseCustomMaterial = serializedObject.FindProperty("m_UseCustomMaterial");
m_CustomMaterial = serializedObject.FindProperty("m_CustomMaterial");
}
}
}