add scriptable object examples
add editor window example add attribute + drawer example
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user