{"_id":"5b1f90ead4c5f000036b57d8","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"},"category":{"_id":"5b1f900bd4c5f000036b57bd","project":"571fa55ca0acd42000af9545","version":"5b1f8576c2505d00031254db","__v":0,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2018-06-12T09:19:07.462Z","from_sync":false,"order":6,"slug":"interactors","title":"Interactors"},"user":"571fa519db52d01700f5cf3d","githubsync":"","__v":0,"parentDoc":null,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2018-06-12T09:22:50.798Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":7,"body":"## Overview\n\nEnables highlighting of controller elements.\n\n**Optional Components:**\n * `VRTK_BaseHighlighter` - The highlighter to use when highligting the controller. If one is not already injected in the `Controller Highlighter` parameter then the component on the same GameObject will be used.\n\n**Script Usage:**\n * Place the `VRTK_ControllerHighlighter` script on either:\n   * The controller script alias GameObject of the controller to affect (e.g. Right Controller Script Alias).\n   * Any other scene GameObject and provide the controller script alias GameObject to the `Controller Alias` parameter of this script.\n * The Model Element Paths will be auto populated at runtime based on the SDK Setup Model Alias being used (except if a custom Model Alias for the SDK Setup is provided).\n * The Highlighter used by the Controller Highlighter will be selected in the following order:\n   * The provided Base Highlighter in the `Controller Highlighter` parameter.\n   * If the above is not provided, then the first active Base Highlighter found on the actual controller GameObject will be used.\n   * If the above is not found, then a Material Color Swap Highlighter will be created on the actual controller GameObject at runtime.\n\n## Inspector Parameters\n\n * **Transition Duration:** The amount of time to take to transition to the set highlight colour.\n * **Highlight Controller:** The colour to set the entire controller highlight colour to.\n * **Highlight Body:** The colour to set the body highlight colour to.\n * **Highlight Trigger:** The colour to set the trigger highlight colour to.\n * **Highlight Grip:** The colour to set the grip highlight colour to.\n * **Highlight Touchpad:** The colour to set the touchpad highlight colour to.\n * **Highlight Touchpad Two:** The colour to set the touchpad two highlight colour to.\n * **Highlight Button One:** The colour to set the button one highlight colour to.\n * **Highlight Button Two:** The colour to set the button two highlight colour to.\n * **Highlight System Menu:** The colour to set the system menu highlight colour to.\n * **Highlight Start Menu:** The colour to set the start menu highlight colour to.\n * **Model Element Paths:** A collection of strings that determine the path to the controller model sub elements for identifying the model parts at runtime. If the paths are left empty they will default to the model element paths of the selected SDK Bridge.\n * **Element Highlighter Overrides:** A collection of highlighter overrides for each controller model sub element. If no highlighter override is given then highlighter on the Controller game object is used.\n * **Controller Alias:** An optional GameObject to specify which controller to apply the script methods to. If this is left blank then this script is required to be placed on a controller script alias GameObject and it will use the Actual Controller GameObject linked to the controller script alias.\n * **Model Container:** An optional GameObject to specifiy where the controller models are. If this is left blank then the controller Model Alias object will be used.\n * **Controller Highlighter:** An optional Highlighter to use when highlighting the controller element. If this is left blank, then the first active highlighter on the same GameObject will be used, if one isn't found then a Material Color Swap Highlighter will be created at runtime.\n\n## Class Methods\n\n### ConfigureControllerPaths/0\n\n  > `public virtual void ConfigureControllerPaths()`\n\n * Parameters\n   * _none_\n * Returns\n   * _none_\n\nThe ConfigureControllerPaths method is used to set up the model element paths.\n\n### PopulateHighlighters/0\n\n  > `public virtual void PopulateHighlighters()`\n\n * Parameters\n   * _none_\n * Returns\n   * _none_\n\nThe PopulateHighlighters method sets up the highlighters on the controller model.\n\n### HighlightController/2\n\n  > `public virtual void HighlightController(Color color, float fadeDuration = 0f)`\n\n * Parameters\n   * `Color color` - The Color to highlight the controller to.\n   * `float fadeDuration` - The duration in seconds to fade from the initial color to the target color.\n * Returns\n   * _none_\n\nThe HighlightController method attempts to highlight all sub models of the controller.\n\n### UnhighlightController/0\n\n  > `public virtual void UnhighlightController()`\n\n * Parameters\n   * _none_\n * Returns\n   * _none_\n\nThe UnhighlightController method attempts to remove the highlight from all sub models of the controller.\n\n### HighlightElement/3\n\n  > `public virtual void HighlightElement(SDK_BaseController.ControllerElements elementType, Color color, float fadeDuration = 0f)`\n\n * Parameters\n   * `SDK_BaseController.ControllerElements elementType` - The element type on the controller.\n   * `Color color` - The Color to highlight the controller element to.\n   * `float fadeDuration` - The duration in seconds to fade from the initial color to the target color.\n * Returns\n   * _none_\n\nThe HighlightElement method attempts to highlight a specific controller element.\n\n### UnhighlightElement/1\n\n  > `public virtual void UnhighlightElement(SDK_BaseController.ControllerElements elementType)`\n\n * Parameters\n   * `SDK_BaseController.ControllerElements elementType` - The element type on the controller.\n * Returns\n   * _none_\n\nThe UnhighlightElement method attempts to remove the highlight from the specific controller element.\n\n## Example\n\n`VRTK/Examples/035_Controller_OpacityAndHighlighting` demonstrates the ability to change the opacity of a controller model and to highlight specific elements of a controller such as the buttons or even the entire controller model.","excerpt":"","slug":"vrtk_controllerhighlighter-1","type":"basic","title":"VRTK_ControllerHighlighter"}

VRTK_ControllerHighlighter


## Overview Enables highlighting of controller elements. **Optional Components:** * `VRTK_BaseHighlighter` - The highlighter to use when highligting the controller. If one is not already injected in the `Controller Highlighter` parameter then the component on the same GameObject will be used. **Script Usage:** * Place the `VRTK_ControllerHighlighter` script on either: * The controller script alias GameObject of the controller to affect (e.g. Right Controller Script Alias). * Any other scene GameObject and provide the controller script alias GameObject to the `Controller Alias` parameter of this script. * The Model Element Paths will be auto populated at runtime based on the SDK Setup Model Alias being used (except if a custom Model Alias for the SDK Setup is provided). * The Highlighter used by the Controller Highlighter will be selected in the following order: * The provided Base Highlighter in the `Controller Highlighter` parameter. * If the above is not provided, then the first active Base Highlighter found on the actual controller GameObject will be used. * If the above is not found, then a Material Color Swap Highlighter will be created on the actual controller GameObject at runtime. ## Inspector Parameters * **Transition Duration:** The amount of time to take to transition to the set highlight colour. * **Highlight Controller:** The colour to set the entire controller highlight colour to. * **Highlight Body:** The colour to set the body highlight colour to. * **Highlight Trigger:** The colour to set the trigger highlight colour to. * **Highlight Grip:** The colour to set the grip highlight colour to. * **Highlight Touchpad:** The colour to set the touchpad highlight colour to. * **Highlight Touchpad Two:** The colour to set the touchpad two highlight colour to. * **Highlight Button One:** The colour to set the button one highlight colour to. * **Highlight Button Two:** The colour to set the button two highlight colour to. * **Highlight System Menu:** The colour to set the system menu highlight colour to. * **Highlight Start Menu:** The colour to set the start menu highlight colour to. * **Model Element Paths:** A collection of strings that determine the path to the controller model sub elements for identifying the model parts at runtime. If the paths are left empty they will default to the model element paths of the selected SDK Bridge. * **Element Highlighter Overrides:** A collection of highlighter overrides for each controller model sub element. If no highlighter override is given then highlighter on the Controller game object is used. * **Controller Alias:** An optional GameObject to specify which controller to apply the script methods to. If this is left blank then this script is required to be placed on a controller script alias GameObject and it will use the Actual Controller GameObject linked to the controller script alias. * **Model Container:** An optional GameObject to specifiy where the controller models are. If this is left blank then the controller Model Alias object will be used. * **Controller Highlighter:** An optional Highlighter to use when highlighting the controller element. If this is left blank, then the first active highlighter on the same GameObject will be used, if one isn't found then a Material Color Swap Highlighter will be created at runtime. ## Class Methods ### ConfigureControllerPaths/0 > `public virtual void ConfigureControllerPaths()` * Parameters * _none_ * Returns * _none_ The ConfigureControllerPaths method is used to set up the model element paths. ### PopulateHighlighters/0 > `public virtual void PopulateHighlighters()` * Parameters * _none_ * Returns * _none_ The PopulateHighlighters method sets up the highlighters on the controller model. ### HighlightController/2 > `public virtual void HighlightController(Color color, float fadeDuration = 0f)` * Parameters * `Color color` - The Color to highlight the controller to. * `float fadeDuration` - The duration in seconds to fade from the initial color to the target color. * Returns * _none_ The HighlightController method attempts to highlight all sub models of the controller. ### UnhighlightController/0 > `public virtual void UnhighlightController()` * Parameters * _none_ * Returns * _none_ The UnhighlightController method attempts to remove the highlight from all sub models of the controller. ### HighlightElement/3 > `public virtual void HighlightElement(SDK_BaseController.ControllerElements elementType, Color color, float fadeDuration = 0f)` * Parameters * `SDK_BaseController.ControllerElements elementType` - The element type on the controller. * `Color color` - The Color to highlight the controller element to. * `float fadeDuration` - The duration in seconds to fade from the initial color to the target color. * Returns * _none_ The HighlightElement method attempts to highlight a specific controller element. ### UnhighlightElement/1 > `public virtual void UnhighlightElement(SDK_BaseController.ControllerElements elementType)` * Parameters * `SDK_BaseController.ControllerElements elementType` - The element type on the controller. * Returns * _none_ The UnhighlightElement method attempts to remove the highlight from the specific controller element. ## Example `VRTK/Examples/035_Controller_OpacityAndHighlighting` demonstrates the ability to change the opacity of a controller model and to highlight specific elements of a controller such as the buttons or even the entire controller model.