VRTK_BaseHighlighter
Overview
The Base Highlighter is an abstract class that all other highlighters inherit and are required to implement the public methods.
As this is an abstract class, it cannot be applied directly to a game object and performs no logic.
Inspector Parameters
- Active: Determines if this highlighter is the active highlighter for the object the component is attached to. Only 1 active highlighter can be applied to a game object.
Class Methods
Initialise/2
public abstract void Initialise(Color? color = null, Dictionary<string, object> options = null);
- Parameters
Color? color
- An optional colour may be passed through at point of initialisation in case the highlighter requires it.Dictionary<string, object> options
- An optional dictionary of highlighter specific options that may be differ with highlighter implementations.- Returns
- none
The Initalise method is used to set up the state of the highlighter.
Highlight/2
public abstract void Highlight(Color? color = null, float duration = 0f);
- Parameters
Color? color
- An optional colour to highlight the game object to. The highlight colour may already have been set in theInitialise
method so may not be required here.float duration
- An optional duration of how long before the highlight has occured. It can be used by highlighters to fade the colour if possible.- Returns
- none
The Highlight method is used to initiate the highlighting logic to apply to an object.
Unhighlight/2
public abstract void Unhighlight(Color? color = null, float duration = 0f);
- Parameters
Color? color
- An optional colour that could be used during the unhighlight phase. Usually will be left as null.float duration
- An optional duration of how long before the unhighlight has occured.- Returns
- none
The Unhighlight method is used to initiate the logic that returns an object back to it's original appearance.
GetOption/2
public virtual T GetOption<T>(Dictionary<string, object> options, string key)
- Type Params
T
- The system type that is expected to be returned.- Parameters
Dictionary<string, object> options
- The dictionary of options to check in.string key
- The identifier key to look for.- Returns
T
- The value in the options at the given key returned in the provided system type.
The GetOption method is used to return a value from the options array if the given key exists.
Updated less than a minute ago