Note about custom inspector

  • If you take a look in the "Scripts > Editor" folder you will find the custom inspector script for both the "LeverItem" and the "LeverSystemController" scripts. You can edit these if you want variables from the appropriate scripts to appear in the inspectorn

Example Editor Script:

As you can see below, we can set the "EditorGUILayout.PropertyField" to add a new reference to a field or variable in the inspector.

  • At the top of the editor script we create a serialized property to hold the field we'll use like this:

  • We then go to the "OnEnable" method and find the appropriate field reference

  • With the "OnInspectorGUI" method we then apply the property by using:

  • See the full code below:

Last updated