Skip to main content

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.

IdNameDescription
1ScriptListMonoBehaviour list
2ElementMonoBehaviour binding configure.
3ClassNamespaceYour script namespace
4ClassNameYour script class name
5FieldsAll public fields in the script
6FieldNameThe name of the field in the script
7ValueThe value of the field in the script
8GameObjectAllow you drag-and-drop gameobjec for it
9FieldTypeThe type of the field in the script
10Auto-BindingAuto binding fields
11RefreshRefresh bound fields and remove uselessfields
12CleanRemove 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