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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ea036d9930184985a5a989eeb914e5fe
|
||||
timeCreated: 1782226034
|
||||
Reference in New Issue
Block a user