SW 중심대학 OSS GIT 서버 박건태, 이승준, 고기완, 이준호 새로운 배포
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

45 lines
1.6 KiB

4 years ago
  1. using UnityEngine;
  2. using UnityEngine.XR.ARFoundation;
  3. namespace UnityEditor.XR.ARFoundation
  4. {
  5. [CustomEditor(typeof(ARCameraBackground))]
  6. internal class ARCameraBackgroundEditor : Editor
  7. {
  8. SerializedProperty m_UseCustomMaterial;
  9. SerializedProperty m_CustomMaterial;
  10. static class Tooltips
  11. {
  12. public static readonly GUIContent useCustomMaterial = new GUIContent(
  13. "Use Custom Material",
  14. "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.");
  15. public static readonly GUIContent customMaterial = new GUIContent(
  16. "Custom Material",
  17. "The material to use for background rendering.");
  18. }
  19. public override void OnInspectorGUI()
  20. {
  21. serializedObject.Update();
  22. EditorGUILayout.PropertyField(m_UseCustomMaterial, Tooltips.useCustomMaterial);
  23. if (m_UseCustomMaterial.boolValue)
  24. {
  25. ++EditorGUI.indentLevel;
  26. EditorGUILayout.PropertyField(m_CustomMaterial, Tooltips.customMaterial);
  27. --EditorGUI.indentLevel;
  28. }
  29. serializedObject.ApplyModifiedProperties();
  30. }
  31. void OnEnable()
  32. {
  33. m_UseCustomMaterial = serializedObject.FindProperty("m_UseCustomMaterial");
  34. m_CustomMaterial = serializedObject.FindProperty("m_CustomMaterial");
  35. }
  36. }
  37. }