Skip to content

Custom Inspector

Henry de Jongh edited this page Mar 11, 2023 · 3 revisions

When your MonoBehaviour uses a custom editor for the Unity inspector, you can add the following lines of code to restore the Reactive Logic Settings section:

[CustomEditor(typeof(MyLogic))]
public class MyLogicEditor : UnityEditor.Editor
{
    public override void OnInspectorGUI()
    {
        var sReactiveData = serializedObject.FindProperty("_reactiveData");
        EditorGUILayout.PropertyField(sReactiveData);
        
        // ...
        
        if (serializedObject.hasModifiedProperties)
            serializedObject.ApplyModifiedProperties();
    }
}
Clone this wiki locally