using UnityEngine;
using UnityEditor;
[CustomEditor(typeof(Script_04_01))]
public class Script_04_01_Insprctor : Editor {
public override void OnInspectorGUI()
{
serializedObject.Update();//更新最新数据
EditorGUI.BeginChangeCheck(); //监听具体的元素发生变化
EditorGUILayout.PropertyField(serializedObject.FindProperty("datas"), true);
if (EditorGUI.EndChangeCheck())
{
Debug.LogError("datas changes");
}
if (GUI.changed) //监听任意元素发生变化
Debug.LogError("有东西改变了");
serializedObject.ApplyModifiedProperties();
}
}