| 123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- using UnityEditor;
- using UnityEngine;
- namespace DunGen.Editor
- {
- [CustomEditor(typeof(DoorwaySocket))]
- public sealed class DoorwaySocketInspector : UnityEditor.Editor
- {
- #region Labels & SerializedProperties
- private static class Labels
- {
- public static readonly GUIContent Size = new GUIContent("Size", "The size of the doorway opening. Used for visualization and portal culling");
- }
- private class Properties
- {
- public SerializedProperty Size { get; private set; }
- public Properties(SerializedObject obj)
- {
- Size = obj.FindProperty("size");
- }
- }
- #endregion
- private Properties properties;
- private void OnEnable()
- {
- properties = new Properties(serializedObject);
- }
- public override void OnInspectorGUI()
- {
- serializedObject.Update();
- EditorGUILayout.PropertyField(properties.Size, Labels.Size);
- serializedObject.ApplyModifiedProperties();
- }
- }
- }
|