{"_id":"5b1f8576c2505d00031254c7","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":"5b1f8576c2505d000312542a","version":"5b1f8576c2505d00031254db","project":"571fa55ca0acd42000af9545","__v":0,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2017-01-01T16:45:52.489Z","from_sync":false,"order":7,"slug":"interactions","title":"Interactables"},"user":"571fa519db52d01700f5cf3d","githubsync":"","__v":0,"parentDoc":null,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2017-06-20T17:04:11.251Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":4,"body":"> extends [VRTK_InteractableListener](doc:vrtk_interactablelistener)\n\n## Overview\n\nDetermine whether the `Object To Affect` should be visible or hidden by default or on interaction (near touch, touch, grab, use).\n\n**Required Components:**\n * `VRTK_InteractableObject` - The Interactable Object component to detect interactions on. This must be applied on the same GameObject as this script if one is not provided via the `Object To Monitor` parameter.\n\n**Script Usage:**\n * Place the `VRTK_InteractObjectAppearance` script on either:\n   * The GameObject of the Interactable Object to detect interactions on.\n   * Any other scene GameObject and provide a valid `VRTK_InteractableObject` component to the `Object To Monitor` parameter of this script.\n * Optionally provide a GameObject to the `Object To Affect` parameter to determine which GameObject to affect the appearance of.\n\n## Inspector Parameters\n\n * **Object To Affect:** The GameObject to affect the appearance of. If this is null then then the interacting object will be used (usually the controller).\n * **Game Object Active By Default:** If this is checked then the `Object To Affect` will be an active GameObject when the script is enabled. If it's unchecked then it will be disabled. This only takes effect if `Affect Interacting Object` is unticked.\n * **Renderer Visible By Default:** If this is checked then the `Object To Affect` will have visible renderers when the script is enabled. If it's unchecked then it will have it's renderers disabled. This only takes effect if `Affect Interacting Object` is unticked.\n * **Game Object Active On Near Touch:** If this is checked then the `Object To Affect` will be an active GameObject when the `Object To Monitor` is near touched. If it's unchecked then it will be disabled on near touch.\n * **Renderer Visible On Near Touch:** If this is checked then the `Object To Affect` will have visible renderers when the `Object To Monitor` is near touched. If it's unchecked then it will have it's renderers disabled on near touch.\n * **Near Touch Appearance Delay:** The amount of time to wait before the near touch appearance settings are applied after the near touch event.\n * **Near Untouch Appearance Delay:** The amount of time to wait before the previous appearance settings are applied after the near untouch event.\n * **Valid Near Touch Interacting Object:** Determines what type of interacting object will affect the appearance of the `Object To Affect` after the near touch and near untouch event.\n * **Game Object Active On Touch:** If this is checked then the `Object To Affect` will be an active GameObject when the `Object To Monitor` is touched. If it's unchecked then it will be disabled on touch.\n * **Renderer Visible On Touch:** If this is checked then the `Object To Affect` will have visible renderers when the `Object To Monitor` is touched. If it's unchecked then it will have it's renderers disabled on touch.\n * **Touch Appearance Delay:** The amount of time to wait before the touch appearance settings are applied after the touch event.\n * **Untouch Appearance Delay:** The amount of time to wait before the previous appearance settings are applied after the untouch event.\n * **Valid Touch Interacting Object:** Determines what type of interacting object will affect the appearance of the `Object To Affect` after the touch/untouch event.\n * **Game Object Active On Grab:** If this is checked then the `Object To Affect` will be an active GameObject when the `Object To Monitor` is grabbed. If it's unchecked then it will be disabled on grab.\n * **Renderer Visible On Grab:** If this is checked then the `Object To Affect` will have visible renderers when the `Object To Monitor` is grabbed. If it's unchecked then it will have it's renderers disabled on grab.\n * **Grab Appearance Delay:** The amount of time to wait before the grab appearance settings are applied after the grab event.\n * **Ungrab Appearance Delay:** The amount of time to wait before the previous appearance settings are applied after the ungrab event.\n * **Valid Grab Interacting Object:** Determines what type of interacting object will affect the appearance of the `Object To Affect` after the grab/ungrab event.\n * **Game Object Active On Use:** If this is checked then the `Object To Affect` will be an active GameObject when the `Object To Monitor` is used. If it's unchecked then it will be disabled on use.\n * **Renderer Visible On Use:** If this is checked then the `Object To Affect` will have visible renderers when the `Object To Monitor` is used. If it's unchecked then it will have it's renderers disabled on use.\n * **Use Appearance Delay:** The amount of time to wait before the use appearance settings are applied after the use event.\n * **Unuse Appearance Delay:** The amount of time to wait before the previous appearance settings are applied after the unuse event.\n * **Valid Use Interacting Object:** Determines what type of interacting object will affect the appearance of the `Object To Affect` after the use/unuse event.\n\n## Class Variables\n\n * `public enum ValidInteractingObject` - The valid interacting object.\n   * `Anything` - Any GameObject is considered a valid interacting object.\n   * `EitherController` - Only a game controller is considered a valid interacting objcet.\n   * `NeitherController` - Any GameObject except a game controller is considered a valid interacting object.\n   * `LeftControllerOnly` - Only the left game controller is considered a valid interacting objcet.\n   * `RightControllerOnly` - Only the right game controller is considered a valid interacting objcet.\n\n## Class Events\n\n * `GameObjectEnabled` - Emitted when the GameObject on the `Object To Affect` is enabled.\n * `GameObjectDisabled` - Emitted when the GameObject on the `Object To Affect` is disabled.\n * `RenderersEnabled` - Emitted when the Renderers on the `Object To Affect` are enabled.\n * `RenderersDisabled` - Emitted when the Renderers on the `Object To Affect` are disabled.\n\n## Unity Events\n\nAdding the `VRTK_InteractObjectAppearance_UnityEvents` component to `VRTK_InteractObjectAppearance` object allows access to `UnityEvents` that will react identically to the Class Events.\n\n * All C# delegate events are mapped to a Unity Event with the `On` prefix. e.g. `MyEvent` -> `OnMyEvent`.\n\n## Event Payload\n\n * `GameObject affectingObject` - The GameObject that is being affected.\n * `VRTK_InteractableObject monitoringObject` - The Interactable Object that is being monitored.\n * `VRTK_InteractableObject.InteractionType interactionType` - The type of interaction initiating the event.\n\n## Example\n\n`VRTK/Examples/008_Controller_UsingAGrabbedObject` shows that the controller can be hidden when touching, grabbing and using an object.","excerpt":"","slug":"vrtk_objectappearance","type":"basic","title":"VRTK_ObjectAppearance"}

VRTK_ObjectAppearance


> extends [VRTK_InteractableListener](doc:vrtk_interactablelistener) ## Overview Determine whether the `Object To Affect` should be visible or hidden by default or on interaction (near touch, touch, grab, use). **Required Components:** * `VRTK_InteractableObject` - The Interactable Object component to detect interactions on. This must be applied on the same GameObject as this script if one is not provided via the `Object To Monitor` parameter. **Script Usage:** * Place the `VRTK_InteractObjectAppearance` script on either: * The GameObject of the Interactable Object to detect interactions on. * Any other scene GameObject and provide a valid `VRTK_InteractableObject` component to the `Object To Monitor` parameter of this script. * Optionally provide a GameObject to the `Object To Affect` parameter to determine which GameObject to affect the appearance of. ## Inspector Parameters * **Object To Affect:** The GameObject to affect the appearance of. If this is null then then the interacting object will be used (usually the controller). * **Game Object Active By Default:** If this is checked then the `Object To Affect` will be an active GameObject when the script is enabled. If it's unchecked then it will be disabled. This only takes effect if `Affect Interacting Object` is unticked. * **Renderer Visible By Default:** If this is checked then the `Object To Affect` will have visible renderers when the script is enabled. If it's unchecked then it will have it's renderers disabled. This only takes effect if `Affect Interacting Object` is unticked. * **Game Object Active On Near Touch:** If this is checked then the `Object To Affect` will be an active GameObject when the `Object To Monitor` is near touched. If it's unchecked then it will be disabled on near touch. * **Renderer Visible On Near Touch:** If this is checked then the `Object To Affect` will have visible renderers when the `Object To Monitor` is near touched. If it's unchecked then it will have it's renderers disabled on near touch. * **Near Touch Appearance Delay:** The amount of time to wait before the near touch appearance settings are applied after the near touch event. * **Near Untouch Appearance Delay:** The amount of time to wait before the previous appearance settings are applied after the near untouch event. * **Valid Near Touch Interacting Object:** Determines what type of interacting object will affect the appearance of the `Object To Affect` after the near touch and near untouch event. * **Game Object Active On Touch:** If this is checked then the `Object To Affect` will be an active GameObject when the `Object To Monitor` is touched. If it's unchecked then it will be disabled on touch. * **Renderer Visible On Touch:** If this is checked then the `Object To Affect` will have visible renderers when the `Object To Monitor` is touched. If it's unchecked then it will have it's renderers disabled on touch. * **Touch Appearance Delay:** The amount of time to wait before the touch appearance settings are applied after the touch event. * **Untouch Appearance Delay:** The amount of time to wait before the previous appearance settings are applied after the untouch event. * **Valid Touch Interacting Object:** Determines what type of interacting object will affect the appearance of the `Object To Affect` after the touch/untouch event. * **Game Object Active On Grab:** If this is checked then the `Object To Affect` will be an active GameObject when the `Object To Monitor` is grabbed. If it's unchecked then it will be disabled on grab. * **Renderer Visible On Grab:** If this is checked then the `Object To Affect` will have visible renderers when the `Object To Monitor` is grabbed. If it's unchecked then it will have it's renderers disabled on grab. * **Grab Appearance Delay:** The amount of time to wait before the grab appearance settings are applied after the grab event. * **Ungrab Appearance Delay:** The amount of time to wait before the previous appearance settings are applied after the ungrab event. * **Valid Grab Interacting Object:** Determines what type of interacting object will affect the appearance of the `Object To Affect` after the grab/ungrab event. * **Game Object Active On Use:** If this is checked then the `Object To Affect` will be an active GameObject when the `Object To Monitor` is used. If it's unchecked then it will be disabled on use. * **Renderer Visible On Use:** If this is checked then the `Object To Affect` will have visible renderers when the `Object To Monitor` is used. If it's unchecked then it will have it's renderers disabled on use. * **Use Appearance Delay:** The amount of time to wait before the use appearance settings are applied after the use event. * **Unuse Appearance Delay:** The amount of time to wait before the previous appearance settings are applied after the unuse event. * **Valid Use Interacting Object:** Determines what type of interacting object will affect the appearance of the `Object To Affect` after the use/unuse event. ## Class Variables * `public enum ValidInteractingObject` - The valid interacting object. * `Anything` - Any GameObject is considered a valid interacting object. * `EitherController` - Only a game controller is considered a valid interacting objcet. * `NeitherController` - Any GameObject except a game controller is considered a valid interacting object. * `LeftControllerOnly` - Only the left game controller is considered a valid interacting objcet. * `RightControllerOnly` - Only the right game controller is considered a valid interacting objcet. ## Class Events * `GameObjectEnabled` - Emitted when the GameObject on the `Object To Affect` is enabled. * `GameObjectDisabled` - Emitted when the GameObject on the `Object To Affect` is disabled. * `RenderersEnabled` - Emitted when the Renderers on the `Object To Affect` are enabled. * `RenderersDisabled` - Emitted when the Renderers on the `Object To Affect` are disabled. ## Unity Events Adding the `VRTK_InteractObjectAppearance_UnityEvents` component to `VRTK_InteractObjectAppearance` object allows access to `UnityEvents` that will react identically to the Class Events. * All C# delegate events are mapped to a Unity Event with the `On` prefix. e.g. `MyEvent` -> `OnMyEvent`. ## Event Payload * `GameObject affectingObject` - The GameObject that is being affected. * `VRTK_InteractableObject monitoringObject` - The Interactable Object that is being monitored. * `VRTK_InteractableObject.InteractionType interactionType` - The type of interaction initiating the event. ## Example `VRTK/Examples/008_Controller_UsingAGrabbedObject` shows that the controller can be hidden when touching, grabbing and using an object.