What is Expose Methods Utility?
Method Expose Utility is a Unity Tool for exposing and invoking methods from Unity Inspector.
How to use?
For a method to be shown in inspector there is 2 steps.
- Mark the MonoBehaviour as Exposable
- Mark the Method as Exposable
Marking Monobehaviour
Exposable Attribute should be added to the MonoBehaviour for exposable methods.
Warning! If Component already has a custom editor, or another Inspector
overhaul plugin, this plugin will not work..
Marking Methods
There is 2 types of exposable methods.
- EditorExposable - Editor Specific
- RuntimeExposable - Runtime Specific
Choosing EditorExposable
If Method has Editor specific functions, EditorExpose attribute shoud be used.
[EditorExpose] Attribute should be added like this.
Generate Map Method in sample image will look like this
in Editor
EditorExpose Methods will not be interactable in
'Playing' state.
Choosing RuntimeExposable
If Method should be used in Play mode; RuntimeExpose attribute should be used
[EditorExpose] Attribute should be added like this.
Path Find Method in sample image will look like this
in Editor
RuntimeExpose Methods will not be interactable in
'Editor' state.
Choosing Expose
If you decide that your method can be used in Editor mode AND Play mode, than you can use
[Expose] attribute.
Danger! If play mode codes are used in editor, this could change the
structure of scene hierarchy!
[Expose] Attribute should be added like this.
Expose Methods will be interactable in 'Playing'
and 'Editor' state.
Expose Methods will be interactable in 'Playing'
and 'Editor' state.
Supported Arguments
If exposed methods have arguments, than they can be filled in inspector.
Supported Arguments are following;
- bool
- string
- integer
- float
- Vector3
- Any UnityEngine.Object as long as Unity Engine supports it.
- Color