I can't see new fields / variables?

Some scripts do have custom editors which mean that if you add fields or variables to the parent script, they won't appear unless you update the custom editor.

Scripts with Custom Editors:

  • AKItem

  • AKUIManager

  • BasicNote

  • BasicReverseNote

  • CustomNote

  • CustomReverseNote

  • ExaminableItem

  • FlashlightItemBaseClass

  • GeneratorItem

  • LeverSystemController

How to edit these scripts to include new variables:

  • Each script that you see in the inspector that uses a custom editor will have a button called "Open Editor Script" - So you can easily access it.

  • Lets take the FlashlightItemBaseClass as an example:

  • You first set the SerializedProperty for the fields you've created in your other script:

SerializedProperty NameOfFieldsFromOtherScript;

Then in OnEnable, you must find that property.

private void OnEnable()
{
    NameOfFieldsFromOtherScript = serializedObject.FindProperty("NameOfFieldsFromOtherScript");
}

In the OnInspectorGUI you must add the field to show the field

public override void OnInspectorGUI()
{
    EditorGUILayout.PropertyField(NameOfFieldsFromOtherScript);
}

Last updated