Added lots of examples for editor customization
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Events.Editor
|
||||
{
|
||||
[CustomEditor(typeof(EventBroker))]
|
||||
public class EventBrokerEditor : UnityEditor.Editor
|
||||
{
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
base.OnInspectorGUI();
|
||||
|
||||
if (!EditorApplication.isPlaying) return;
|
||||
|
||||
if (GUILayout.Button("Player Died"))
|
||||
{
|
||||
(target as EventBroker)?.RaisePlayerDied();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user