You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
677 B
C#

5 days ago
using UnityEditor;
using UnityEngine;
namespace Unity.BossRoom.Infrastructure
{
/// <summary>
/// Custom inspector class for GameEvent ScriptableObject class. Overriding OnInspectorGUI() to add debugging
/// functionality via the ability to raise this event within the editor.
/// </summary>
[CustomEditor(typeof(GameEvent))]
public class GameEventEditor : UnityEditor.Editor
{
public override void OnInspectorGUI()
{
base.OnInspectorGUI();
var gameEvent = (GameEvent)target;
if (GUILayout.Button("Raise Event"))
{
gameEvent.Raise();
}
}
}
}