using UnityEngine;
#if UNITY_EDITOR
using UnityEditor;
#endif
namespace XRTool.Util
{
[InitializeOnLoad]
[CustomEditor(typeof(followCamera))]
public class FollowCameraInspector : Editor
{
///
/// 显示距离
///
public SerializedProperty dicCount;
///
/// 最高跟随Y轴
///
public SerializedProperty PDISTANCEY;
///
/// 最低跟随Y轴
///
public SerializedProperty PDISTANCEYY;
///
/// 旋转角度
///
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();
}
}
}