{"_id":"5949558b324098001a20d2f3","project":"571fa55ca0acd42000af9545","version":{"_id":"594949e52be16d0026ec04cd","project":"571fa55ca0acd42000af9545","__v":2,"createdAt":"2017-06-20T16:14:29.816Z","releaseDate":"2017-06-20T16:14:29.816Z","categories":["594949e62be16d0026ec04ce","594949e62be16d0026ec04cf","594949e62be16d0026ec04d0","594949e62be16d0026ec04d1","594949e62be16d0026ec04d2","594949e62be16d0026ec04d3","594949e62be16d0026ec04d4","594949e62be16d0026ec04d5","594949e62be16d0026ec04d6","594949e62be16d0026ec04d7","594949e62be16d0026ec04d8","594949e62be16d0026ec04d9","594949e62be16d0026ec04da","594949e62be16d0026ec04db","594949e62be16d0026ec04dc","594949e62be16d0026ec04dd","594949e62be16d0026ec04de","594949e62be16d0026ec04df","594949e62be16d0026ec04e0","594949e62be16d0026ec04e1","59497219f4a8980024dd0631"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"Kunekune","version_clean":"3.2.0","version":"3.2.0"},"category":{"_id":"594949e62be16d0026ec04d4","version":"594949e52be16d0026ec04cd","project":"571fa55ca0acd42000af9545","__v":0,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2017-01-01T16:45:52.489Z","from_sync":false,"order":6,"slug":"interactions","title":"Interactions"},"user":"571fa519db52d01700f5cf3d","__v":0,"parentDoc":null,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2017-06-20T17:04:11.251Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":9,"body":"## Overview\n\nThe Object Appearance script provides a collection of static methods for controlling the appearance of a GameObject.\n\nThe GameObject can have it's opacity changed, or it's renderers toggled, or highlighters toggled.\n\n## Class Methods\n\n### SetOpacity/3\n\n  > `public static void SetOpacity(GameObject model, float alpha, float transitionDuration = 0f)`\n\n  * Parameters\n   * `GameObject model` - The GameObject to change the renderer opacity on.\n   * `float alpha` - The alpha level to apply to opacity of the controller object. `0f` to `1f`.\n   * `float transitionDuration` - The time to transition from the current opacity to the new opacity.\n  * Returns\n   * _none_\n\nThe SetOpacity method allows the opacity of the given GameObject to be changed. A lower alpha value will make the object more transparent, such as `0.5f` will make the controller partially transparent where as `0f` will make the controller completely transparent.\n\n### SetRendererVisible/2\n\n  > `public static void SetRendererVisible(GameObject model, GameObject ignoredModel = null)`\n\n  * Parameters\n   * `GameObject model` - The GameObject to show the renderers for.\n   * `GameObject ignoredModel` - An optional GameObject to ignore the renderer toggle on.\n  * Returns\n   * _none_\n\nThe SetRendererVisible method turns on renderers of a given GameObject. It can also be provided with an optional model to ignore the render toggle on.\n\n### SetRendererHidden/2\n\n  > `public static void SetRendererHidden(GameObject model, GameObject ignoredModel = null)`\n\n  * Parameters\n   * `GameObject model` - The GameObject to hide the renderers for.\n   * `GameObject ignoredModel` - An optional GameObject to ignore the renderer toggle on.\n  * Returns\n   * _none_\n\nThe SetRendererHidden method turns off renderers of a given GameObject. It can also be provided with an optional model to ignore the render toggle on.\n\n### ToggleRenderer/3\n\n  > `public static void ToggleRenderer(bool state, GameObject model, GameObject ignoredModel = null)`\n\n  * Parameters\n   * `bool state` - If true then the renderers will be enabled, if false the renderers will be disabled.\n   * `GameObject model` - The GameObject to toggle the renderer states of.\n   * `GameObject ignoredModel` - An optional GameObject to ignore the renderer toggle on.\n  * Returns\n   * _none_\n\nThe ToggleRenderer method turns on or off the renderers of a given GameObject. It can also be provided with an optional model to ignore the render toggle of.\n\n### HighlightObject/3\n\n  > `public static void HighlightObject(GameObject model, Color? highlightColor, float fadeDuration = 0f)`\n\n  * Parameters\n   * `GameObject model` - The GameObject to attempt to call the Highlight on.\n   * `Color? highlightColor` - The colour to highlight to.\n   * `float fadeDuration` - The duration in time to fade from the initial colour to the target colour.\n  * Returns\n   * _none_\n\nThe HighlightObject method calls the Highlight method on the highlighter attached to the given GameObject with the provided colour.\n\n### UnhighlightObject/1\n\n  > `public static void UnhighlightObject(GameObject model)`\n\n  * Parameters\n   * `GameObject model` - The GameObject to attempt to call the Unhighlight on.\n  * Returns\n   * _none_\n\nThe UnhighlightObject method calls the Unhighlight method on the highlighter attached to the given GameObject.","excerpt":"","slug":"vrtk_objectappearance","type":"basic","title":"VRTK_ObjectAppearance"}

VRTK_ObjectAppearance


## Overview The Object Appearance script provides a collection of static methods for controlling the appearance of a GameObject. The GameObject can have it's opacity changed, or it's renderers toggled, or highlighters toggled. ## Class Methods ### SetOpacity/3 > `public static void SetOpacity(GameObject model, float alpha, float transitionDuration = 0f)` * Parameters * `GameObject model` - The GameObject to change the renderer opacity on. * `float alpha` - The alpha level to apply to opacity of the controller object. `0f` to `1f`. * `float transitionDuration` - The time to transition from the current opacity to the new opacity. * Returns * _none_ The SetOpacity method allows the opacity of the given GameObject to be changed. A lower alpha value will make the object more transparent, such as `0.5f` will make the controller partially transparent where as `0f` will make the controller completely transparent. ### SetRendererVisible/2 > `public static void SetRendererVisible(GameObject model, GameObject ignoredModel = null)` * Parameters * `GameObject model` - The GameObject to show the renderers for. * `GameObject ignoredModel` - An optional GameObject to ignore the renderer toggle on. * Returns * _none_ The SetRendererVisible method turns on renderers of a given GameObject. It can also be provided with an optional model to ignore the render toggle on. ### SetRendererHidden/2 > `public static void SetRendererHidden(GameObject model, GameObject ignoredModel = null)` * Parameters * `GameObject model` - The GameObject to hide the renderers for. * `GameObject ignoredModel` - An optional GameObject to ignore the renderer toggle on. * Returns * _none_ The SetRendererHidden method turns off renderers of a given GameObject. It can also be provided with an optional model to ignore the render toggle on. ### ToggleRenderer/3 > `public static void ToggleRenderer(bool state, GameObject model, GameObject ignoredModel = null)` * Parameters * `bool state` - If true then the renderers will be enabled, if false the renderers will be disabled. * `GameObject model` - The GameObject to toggle the renderer states of. * `GameObject ignoredModel` - An optional GameObject to ignore the renderer toggle on. * Returns * _none_ The ToggleRenderer method turns on or off the renderers of a given GameObject. It can also be provided with an optional model to ignore the render toggle of. ### HighlightObject/3 > `public static void HighlightObject(GameObject model, Color? highlightColor, float fadeDuration = 0f)` * Parameters * `GameObject model` - The GameObject to attempt to call the Highlight on. * `Color? highlightColor` - The colour to highlight to. * `float fadeDuration` - The duration in time to fade from the initial colour to the target colour. * Returns * _none_ The HighlightObject method calls the Highlight method on the highlighter attached to the given GameObject with the provided colour. ### UnhighlightObject/1 > `public static void UnhighlightObject(GameObject model)` * Parameters * `GameObject model` - The GameObject to attempt to call the Unhighlight on. * Returns * _none_ The UnhighlightObject method calls the Unhighlight method on the highlighter attached to the given GameObject.