11using System.Collections;
12using System.Collections.Generic;
24 [Tooltip(
"If enabled, the object will lerp to its hoverColor when a hand is nearby.")]
27 [Tooltip(
"If enabled, the object will use its primaryHoverColor when the primary hover of an InteractionHand.")]
30 [Header(
"InteractionBehaviour Colors")]
36 [Header(
"InteractionButton Colors")]
37 [Tooltip(
"This color only applies if the object is an InteractionButton or InteractionSlider.")]
40 private Material _material;
45 _intObj = GetComponent<InteractionBehaviour>();
47 Renderer renderer = GetComponent<Renderer>();
48 if (renderer ==
null) {
49 renderer = GetComponentInChildren<Renderer>();
51 if (renderer !=
null) {
52 _material = renderer.material;
57 if (_material !=
null) {
94 _material.color =
Color.Lerp(_material.color, targetColor, 30F * Time.deltaTime);
InteractionBehaviours are components that enable GameObjects to interact with interaction controllers...
bool isPrimaryHovered
Gets whether this object is the primary hover for any interaction controller.
bool isSuspended
Gets whether the object is currently suspended. An object is "suspended" if it is currently grasped b...
bool isHovered
Gets whether any interaction controller is nearby.
float closestHoveringControllerDistance
Gets the distance from this object to the palm of the closest hand to this object,...
This simple script changes the color of an InteractionBehaviour as a function of its distance to the ...