33 lines
911 B
C#
33 lines
911 B
C#
using System;
|
|
using UnityEditor;
|
|
|
|
namespace Core
|
|
{
|
|
[CustomEditor(typeof(PlayerController))]
|
|
public class PlayerControllerEditor : Editor
|
|
{
|
|
private SerializedProperty _eventBrokerProperty;
|
|
|
|
private void OnEnable()
|
|
{
|
|
_eventBrokerProperty = serializedObject.FindProperty("eventBroker");
|
|
}
|
|
|
|
public override void OnInspectorGUI()
|
|
{
|
|
base.OnInspectorGUI();
|
|
|
|
serializedObject.Update();
|
|
//
|
|
// // update your serialized properties
|
|
//
|
|
// serializedObject.ApplyModifiedProperties();
|
|
|
|
// warning info text if the event broker is not set
|
|
if (!_eventBrokerProperty.objectReferenceValue)
|
|
{
|
|
EditorGUILayout.HelpBox("Event Broker Property has to be set!", MessageType.Warning);
|
|
}
|
|
}
|
|
}
|
|
} |