Static Public Member Functions | |
static void | ShowWindow (GameObject _targetObject, string windowName="Wizard") |
Private Member Functions | |
void | OnGUI () |
Static Private Attributes | |
static List< AVR_WizardHook< T > > | registered_hooks = new List<AVR_WizardHook<T>>() |
static GameObject | targetObject |
Short documentation on HookableWizard: A Hookable Wizard is a simple wizard to change porperties on a certain object or component. A typical example: Adding Modules to a VR Controller (such as movement provider etc.) The wizard itself is merely an empty editorwindow with a title and a "Update" button. The actual contents/options are inserted via "WizardHooks". Take the example given above. The wizard to add controller modules by itself is empty. But each package adds individual hooks by declaring them. (arc-vr-motion would add the option to add a MovementProvider module). By keeping the wizards and hooks separate from one another, it allows us to add wizard-options on a per-package basis.
Creating a new wizard is as simple as this: Keep in mind that the class needs to self-referencing to work. (T needs to be the class of the wizard itself)
Now, to display thw wizard one must only call the following: As for the Hooks. Declaring a new hook (option) for your wizard consits only of declaring the class. An example for a simple hook: Just by exisitng, this hook now automatically appears in "MyWizard". Note that how this hook functions is not defined. Thus, it will simply appear as a label stating "Unnamed Module". If you are looking for a simple hook, namely: a toggle field that will add or remove a given prefab with a certain component as a child to our target object, there is a preexisitng class: This hook will add a toggle-field with the label "My Module" to the MyWizard. If the toggle is turned on and the targetObject has no MyComponent on itself or its children, it will instantiate a prefab found under the path designated by the prefabPathSettingsToken (in AVR_Settings). If the toggle is off, all gameobjects with a "MyComponent" will be destroyed.
Implementing your own custom hooks is easy. There are only three methods to implement:
T | : | AVR_HookableWizard<T> |
Definition at line 39 of file AVR_HookableWizard.cs.