API reference
API reference
Select your platform
No SDKs available
No versions available

ControllerRayVisual Class

Extends MonoBehaviour
A visual affordance designed to accompany RayInteractors.
This is used in most ray interaction prefabs, wizards, and example scenes provided by the Interaction SDK. Though this class includes a number of customization options and can be set up independently, you should usually start from an example (scene or prefab) rather than trying to add this visual from scratch as this type makes assumptions about certain of its dependencies, such as those added by InjectRenderer(Renderer) and InjectMaterialPropertyBlockEditor(MaterialPropertyBlockEditor).

Properties

The maximum distance the visual ray is allowed to extend.
Note that this has nothing to do with RayInteractor.MaxRayLength, which is usually much longer as the visual typically attenuates only part of the way to the ray's actual terminus.
The inner color to show when hovering.
The outer color to show when hovering.
The inner color to show when selecting.
This color will supersede HoverColor0 when the associated RayInteractor moves from InteractorState.Hover to InteractorState.Select.
The outer color to show when selecting.
This color will supersede HoverColor1 when the associated RayInteractor moves from InteractorState.Hover to InteractorState.Select.

Protected Functions

virtual void Start ( )
virtual void OnEnable ( )
virtual void OnDisable ( )

Member Functions

Injects all required dependencies for a dynamically instantiated ControllerRayVisual; effectively wraps InjectRayInteractor(RayInteractor), InjectRenderer(Renderer), and InjectMaterialPropertyBlockEditor(MaterialPropertyBlockEditor).
This method exists to support Interaction SDK's dependency injection pattern and is not needed for typical Unity Editor-based usage.
Sets the RayInteractor for a dynamically instantiated ControllerRayVisual.
This method exists to support Interaction SDK's dependency injection pattern and is not needed for typical Unity Editor-based usage.
Sets the Renderer for a dynamically instantiated ControllerRayVisual.
This method exists to support Interaction SDK's dependency injection pattern and is not needed for typical Unity Editor-based usage.
Sets the MaterialPropertyBlockEditor for a dynamically instantiated ControllerRayVisual.
This method exists to support Interaction SDK's dependency injection pattern and is not needed for typical Unity Editor-based usage.
Did you find this page helpful?
Thumbs up icon
Thumbs down icon