{"_id":"5b1f8576c2505d00031254a9","category":{"_id":"5b1f8576c2505d000312542b","version":"5b1f8576c2505d00031254db","project":"571fa55ca0acd42000af9545","__v":0,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2017-01-01T16:48:47.829Z","from_sync":false,"order":8,"slug":"highlighters","title":"Highlighters"},"user":"571fa519db52d01700f5cf3d","parentDoc":null,"project":"571fa55ca0acd42000af9545","version":{"_id":"5b1f8576c2505d00031254db","project":"571fa55ca0acd42000af9545","__v":4,"forked_from":"594949e52be16d0026ec04cd","createdAt":"2017-06-20T16:14:29.816Z","releaseDate":"2017-06-20T16:14:29.816Z","categories":["5b1f8576c2505d0003125424","5b1f8576c2505d0003125425","5b1f8576c2505d0003125426","5b1f8576c2505d0003125427","5b1f8576c2505d0003125428","5b1f8576c2505d0003125429","5b1f8576c2505d000312542a","5b1f8576c2505d000312542b","5b1f8576c2505d000312542c","5b1f8576c2505d000312542d","5b1f8576c2505d000312542e","5b1f8576c2505d000312542f","5b1f8576c2505d0003125430","5b1f8576c2505d0003125431","5b1f8576c2505d0003125432","5b1f8576c2505d0003125433","5b1f8576c2505d0003125434","5b1f8576c2505d0003125435","5b1f8576c2505d0003125436","5b1f8576c2505d0003125437","5b1f8576c2505d0003125438","5b1f8aab9c683000032979e7","5b1f8b2f3073470003ffa5da","5b1f8bd9fd653400031d94f4","5b1f900bd4c5f000036b57bd"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"Mangalica","version_clean":"3.3.0","version":"3.3.0"},"githubsync":"","__v":0,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2017-01-01T16:49:15.150Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":1,"body":"## Overview\n\nProvides a base that all highlighters can inherit from.\n\n**Script Usage:**\n  > This is an abstract class that is to be inherited to a concrete class that provides highlight functionality, therefore this script should not be directly used.\n\n## Inspector Parameters\n\n * **Active:** Determines if this highlighter is the active highlighter for the object the component is attached to. Only one active highlighter can be applied to a GameObject.\n * **Unhighlight On Disable:** Determines if the highlighted object should be unhighlighted when it is disabled.\n\n## Class Methods\n\n### Initialise/3\n\n  > `public abstract void Initialise(Color? color = null, GameObject affectObject = null, Dictionary<string, object> options = null);`\n\n * Parameters\n   * `Color? color` - An optional colour may be passed through at point of initialisation in case the highlighter requires it.\n   * `GameObject affectObject` - An optional GameObject to specify which object to apply the highlighting to.\n   * `Dictionary<string, object> options` - An optional dictionary of highlighter specific options that may be differ with highlighter implementations.\n * Returns\n   * _none_\n\nThe Initalise method is used to set up the state of the highlighter.\n\n### ResetHighlighter/0\n\n  > `public abstract void ResetHighlighter();`\n\n * Parameters\n   * _none_\n * Returns\n   * _none_\n\nThe ResetHighlighter method is used to reset the highlighter if anything on the object has changed. It should be called by any scripts changing object materials or colours.\n\n### Highlight/2\n\n  > `public abstract void Highlight(Color? color = null, float duration = 0f);`\n\n * Parameters\n   * `Color? color` - An optional colour to highlight the game object to. The highlight colour may already have been set in the `Initialise` method so may not be required here.\n   * `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.\n * Returns\n   * _none_\n\nThe Highlight method is used to initiate the highlighting logic to apply to an object.\n\n### Unhighlight/2\n\n  > `public abstract void Unhighlight(Color? color = null, float duration = 0f);`\n\n * Parameters\n   * `Color? color` - An optional colour that could be used during the unhighlight phase. Usually will be left as null.\n   * `float duration` - An optional duration of how long before the unhighlight has occured.\n * Returns\n   * _none_\n\nThe Unhighlight method is used to initiate the logic that returns an object back to it's original appearance.\n\n### GetOption<T>/2\n\n  > `public virtual T GetOption<T>(Dictionary<string, object> options, string key)`\n\n * Type Params\n   * `T` - The system type that is expected to be returned.\n * Parameters\n   * `Dictionary<string, object> options` - The dictionary of options to check in.\n   * `string key` - The identifier key to look for.\n * Returns\n   * `T` - The value in the options at the given key returned in the provided system type.\n\nThe GetOption method is used to return a value from the options array if the given key exists.\n\n### UsesClonedObject/0\n\n  > `public virtual bool UsesClonedObject()`\n\n * Parameters\n   * _none_\n * Returns\n   * `bool` - Returns `true` if the highlighter creates a cloned object to apply the highlighter on, returns `false` if no additional object is created.\n\nThe UsesClonedObject method is used to return whether the current highlighter creates a cloned object to do the highlighting with.\n\n### GetActiveHighlighter/1\n\n  > `public static VRTK_BaseHighlighter GetActiveHighlighter(GameObject obj)`\n\n * Parameters\n   * `GameObject obj` - The GameObject to check for a highlighter on.\n * Returns\n   * `VRTK_BaseHighlighter` - A valid and active highlighter.\n\nThe GetActiveHighlighter method checks the given GameObject for a valid and active highlighter.","excerpt":"","slug":"vrtk_basehighlighter","type":"basic","title":"VRTK_BaseHighlighter"}

VRTK_BaseHighlighter


## Overview Provides a base that all highlighters can inherit from. **Script Usage:** > This is an abstract class that is to be inherited to a concrete class that provides highlight functionality, therefore this script should not be directly used. ## Inspector Parameters * **Active:** Determines if this highlighter is the active highlighter for the object the component is attached to. Only one active highlighter can be applied to a GameObject. * **Unhighlight On Disable:** Determines if the highlighted object should be unhighlighted when it is disabled. ## Class Methods ### Initialise/3 > `public abstract void Initialise(Color? color = null, GameObject affectObject = 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. * `GameObject affectObject` - An optional GameObject to specify which object to apply the highlighting to. * `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. ### ResetHighlighter/0 > `public abstract void ResetHighlighter();` * Parameters * _none_ * Returns * _none_ The ResetHighlighter method is used to reset the highlighter if anything on the object has changed. It should be called by any scripts changing object materials or colours. ### 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 the `Initialise` 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<T>/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. ### UsesClonedObject/0 > `public virtual bool UsesClonedObject()` * Parameters * _none_ * Returns * `bool` - Returns `true` if the highlighter creates a cloned object to apply the highlighter on, returns `false` if no additional object is created. The UsesClonedObject method is used to return whether the current highlighter creates a cloned object to do the highlighting with. ### GetActiveHighlighter/1 > `public static VRTK_BaseHighlighter GetActiveHighlighter(GameObject obj)` * Parameters * `GameObject obj` - The GameObject to check for a highlighter on. * Returns * `VRTK_BaseHighlighter` - A valid and active highlighter. The GetActiveHighlighter method checks the given GameObject for a valid and active highlighter.