123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- using UnityEngine;
- #if UNITY_EDITOR
- using UnityEditor;
- #endif
- namespace XRTool.Util
- {
- [InitializeOnLoad]
- [CustomEditor(typeof(followCamera))]
- public class FollowCameraInspector : Editor
- {
- /// <summary>
- /// 显示距离
- /// </summary>
- public SerializedProperty dicCount;
- /// <summary>
- /// 最高跟随Y轴
- /// </summary>
- public SerializedProperty PDISTANCEY;
- /// <summary>
- /// 最低跟随Y轴
- /// </summary>
- public SerializedProperty PDISTANCEYY;
- /// <summary>
- /// 旋转角度
- /// </summary>
- public SerializedProperty DISTANCE;
- private void OnEnable()
- {
- dicCount = serializedObject.FindProperty("_dicCount");
- PDISTANCEY = serializedObject.FindProperty("PDISTANCEY");
- PDISTANCEYY = serializedObject.FindProperty("PDISTANCEYY");
- DISTANCE = serializedObject.FindProperty("DISTANCE");
- }
- public override void OnInspectorGUI()
- {
- serializedObject.Update();
- // base.OnInspectorGUI();
- EditorGUILayout.PropertyField(dicCount, new GUIContent("显示距离"));
- EditorGUILayout.PropertyField(DISTANCE, new GUIContent("旋转角度"));
- EditorGUILayout.PropertyField(PDISTANCEY, new GUIContent("最高跟随Y轴"));
- EditorGUILayout.PropertyField(PDISTANCEYY, new GUIContent("最低跟随Y轴"));
- serializedObject.ApplyModifiedProperties();
- }
- }
- }
|