1234567891011121314151617181920212223242526272829303132 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEditor;
- using UnityEngine;
- namespace XRTool.WorldUI
- {
- [InitializeOnLoad]
- [CustomEditor(typeof(XRBoundLine))]
- public class XRBoundLineEditor : Editor
- {
- private SerializedProperty scaleType;
- private XRBoundLine line;
- private void OnEnable()
- {
- scaleType = serializedObject.FindProperty("scaleType");
- line = target as XRBoundLine;
- }
- public override void OnInspectorGUI()
- {
- base.OnInspectorGUI();
- EditorGUILayout.PropertyField(scaleType, new GUIContent("缩放模式"));
- serializedObject.ApplyModifiedProperties();
- if (GUI.changed)
- {
- if (line)
- {
- line.SetLine(line.transform.localScale);
- }
- }
- }
- }
- }
|