add scriptable object examples

add editor window example
add attribute + drawer example
This commit is contained in:
2025-06-13 18:07:18 +02:00
parent 0ae837c57b
commit a6dbfb224f
52 changed files with 1460 additions and 533 deletions
@@ -1,3 +1,4 @@
using System;
using UnityEditor;
namespace Core
@@ -5,15 +6,28 @@ 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();
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);
}
}
}
}