Files
gpd-924-en/EditorCustomization/Assets/Scripts/Editor/PlayerControllerEditor.cs
T
david a6dbfb224f add scriptable object examples
add editor window example
add attribute + drawer example
2025-06-13 18:07:18 +02:00

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);
}
}
}
}