Note about custom inspector
Last updated
Last updated
NOTE: If you're confused any way, just send me an email and I'll be happy to help!
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
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: