MonoBehaviour binder
Intro
MonoBehaviour is the base class from which every Unity script derives.When you use C#, you must explicitly derive from MonoBehaviour.
In XR MOD development, we cannot directly drag and drop Monobehaviour into game objects.
Even if the traditional drag-and-drop is not supported, we provide another way to bind MonoBehaviour. We call it Mono Binder.
How to use it
Manual
- Add MonoBinder to your own game object
- Typing your script namespace and class name
- Click the Binding button
Well done! You have mastered how to use monobinder. You may not understand the panel parameters. Next, we will Introduction the function and usage of each parameter of the panel in detail.
Id | Name | Description |
---|---|---|
1 | ScriptList | MonoBehaviour list |
2 | Element | MonoBehaviour binding configure. |
3 | ClassNamespace | Your script namespace |
4 | ClassName | Your script class name |
5 | Fields | All public fields in the script |
6 | FieldName | The name of the field in the script |
7 | Value | The value of the field in the script |
8 | GameObject | Allow you drag-and-drop gameobjec for it |
9 | FieldType | The type of the field in the script |
10 | Auto-Binding | Auto binding fields |
11 | Refresh | Refresh bound fields and remove uselessfields |
12 | Clean | Remove all binding |
Auto Convert
- Write a C# script
- Extends
XRMODBehaviour
script - Write logic code according to the workflow of Unity Monobehaviour
- Add your script to Unity-GameObject
- You will see this script component has a button call
Convert To MonoBinder
and click it