?
?
public class MyPlanet : MonoBehaviour
{
[Serializable]
public class ZoomLevelChangedEvent : UnityEvent<int> { }
public ZoomLevelChangedEvent zoomLevelChangedEvent;
}
如果要在自定义Editor中显示
override public void OnInspectorGUI()
{
serializedObject.Update();
EditorGUILayout.BeginVertical();
SerializedProperty sprop = serializedObject.FindProperty("zoomLevelChangedEvent");
EditorGUILayout.PropertyField(sprop, new GUIContent("zoomLevelChangedEvent Object"));
EditorGUILayout.EndVertical();
serializedObject.ApplyModifiedProperties();
}
|