🚪
Door Interaction Kit - Doc
  • Introduction
  • ⭐Getting Started
    • Quick Setup
    • Changing Door Key
    • How To Create a Key
    • How To Add Planks
    • How To Spawn Objects
  • ❓Support
    • FAQ
    • Door Rotation Issue?
    • Door Customisation
    • System Namespace
    • What Inputs Are Used?
    • Audio ScriptableObjects
    • Variables / Fields Not Appearing in Inspector?
  • 🌀Development
    • Patch Notes - V1.2
    • Roadmap
  • 📧Contact me
    • Contact Me
    • My Other Assets
Powered by GitBook
On this page
  • Adding New Fields to the Custom Inspector
  • Code Examples:
  • Understanding Custom Editors:
  1. Support

Variables / Fields Not Appearing in Inspector?

PreviousAudio ScriptableObjectsNextPatch Notes - V1.2

Last updated 1 year ago

Adding New Fields to the Custom Inspector

The video below will explain how to add fields or variables to the DoorInteractable script as it uses a custom inspector

Code Examples:

  1. Add a field as below into the DoorInteractable script

[SerializeField] private GameObject exampleField = null;
  1. Open the DoorInteractableEditor script - At the top of the script created a new property with the same name like:

SerializedProperty exampleField;
  1. Find the OnEnable() method and add a new find property reference as below:

exampleField = serializedObject.FindProperty(nameof(exampleField));
  1. In the methods below that, find a place for your new field. I've grouped them together to make it more readable. Add a property GUI field:

EditorGUILayout.PropertyField(exampleField);

Understanding Custom Editors:

Below is a ttuorial I made to highlight the usage and examples of custom inspectors / editors

❓