首次提交
This commit is contained in:
28
Assets/Scripts/Editor/RopeEditor.cs
Normal file
28
Assets/Scripts/Editor/RopeEditor.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
[CustomEditor(typeof(Rope))]
|
||||
public class RopeFishLineEditor : Editor
|
||||
{
|
||||
private Rope _target;
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
_target = target as Rope;
|
||||
// lookAtPoint = serializedObject.FindProperty("lookAtPoint");
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
base.OnInspectorGUI();
|
||||
|
||||
|
||||
if (GUILayout.Button("打印总长度"))
|
||||
{
|
||||
Debug.Log($"总长度={_target.GetCurrentLength()} 目标长度={_target.GetTargetLength()}");
|
||||
}
|
||||
// serializedObject.Update();
|
||||
// EditorGUILayout.PropertyField(lookAtPoint);
|
||||
// serializedObject.ApplyModifiedProperties();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user