GvrControllerVisual

Provides visual feedback for the daydream controller.

Summary

Inheritance

Inherits from: MonoBehaviour, IGvrArmModelReceiver, IGvrControllerInputDeviceReceiver
Direct Known Subclasses:GoogleVR.Beta.GvrBetaControllerVisualMulti

Public attributes

APP_BUTTON_ACTIVE_DURATION_SECONDS = 0.111f
const float
App button animation duration when pressed.
APP_BUTTON_RELEASE_DURATION_SECONDS = 0.0909f
const float
App button animation duration when released.
SYSTEM_BUTTON_ACTIVE_DURATION_SECONDS = 0.111f
const float
System button animation duration when pressed.
SYSTEM_BUTTON_RELEASE_DURATION_SECONDS = 0.0909f
const float
System button animation duration when released.
TOUCHPAD_CLICK_DURATION_SECONDS = 0.111f
const float
Touchpad animation duration when pressed.
TOUCHPAD_CLICK_SCALE_DURATION_SECONDS = 0.075f
const float
Deprecated.
This value controls scaling animation times for the touchpad button.
TOUCHPAD_POINT_SCALE_DURATION_SECONDS = 0.15f
const float
Duration of the visual bubble on the controller to grow to its full size when clicked.
TOUCHPAD_RELEASE_DURATION_SECONDS = 0.0909f
const float
Touchpad animation duration when released.
displayState
Used to set the display state of the controller visual.
maximumAlpha = 1.0f
float
This is the preferred, maximum alpha value the object should have when it is a comfortable distance from the head.
readControllerState = true
bool
Determines if the displayState is set from GvrControllerInputDevice.

Properties

AppButtonColor
Color
Gets or sets the color of the app button.
ArmModel
Gets or sets the arm model used to position the controller.
ControllerInputDevice
Gets or sets the controller device reference.
PreferredAlpha
float
Gets the preferred alpha value for the controller.
SystemButtonColor
Color
Gets or sets the color of the system button.
TouchPadColor
Color
Gets or sets the color of the touch pad.

Public functions

SetControllerTexture(Texture newTexture)
void
Sets the controller texture.

Protected functions

GetVisualAssets()
virtual VisualAssets
Override this method to customize the visual's assets.

Structs

GvrControllerVisual.ControllerDisplayState

The controller display state data structure.

GvrControllerVisual.VisualAssets

Struct that describes a mesh, material pair used for rendering a controller visual.

Public attributes

APP_BUTTON_ACTIVE_DURATION_SECONDS

const float APP_BUTTON_ACTIVE_DURATION_SECONDS = 0.111f

App button animation duration when pressed.

APP_BUTTON_RELEASE_DURATION_SECONDS

const float APP_BUTTON_RELEASE_DURATION_SECONDS = 0.0909f

App button animation duration when released.

SYSTEM_BUTTON_ACTIVE_DURATION_SECONDS

const float SYSTEM_BUTTON_ACTIVE_DURATION_SECONDS = 0.111f

System button animation duration when pressed.

SYSTEM_BUTTON_RELEASE_DURATION_SECONDS

const float SYSTEM_BUTTON_RELEASE_DURATION_SECONDS = 0.0909f

System button animation duration when released.

TOUCHPAD_CLICK_DURATION_SECONDS

const float TOUCHPAD_CLICK_DURATION_SECONDS = 0.111f

Touchpad animation duration when pressed.

TOUCHPAD_CLICK_SCALE_DURATION_SECONDS

const float TOUCHPAD_CLICK_SCALE_DURATION_SECONDS = 0.075f

This value controls scaling animation times for the touchpad button.

Deprecated.

TOUCHPAD_POINT_SCALE_DURATION_SECONDS

const float TOUCHPAD_POINT_SCALE_DURATION_SECONDS = 0.15f

Duration of the visual bubble on the controller to grow to its full size when clicked.

TOUCHPAD_RELEASE_DURATION_SECONDS

const float TOUCHPAD_RELEASE_DURATION_SECONDS = 0.0909f

Touchpad animation duration when released.

displayState

ControllerDisplayState displayState

Used to set the display state of the controller visual.

This can be used for tutorials that visualize the controller or other use-cases that require displaying the controller visual without the state being determined by controller input. Additionally, it can be used to preview the controller visual in the editor.

NOTE: readControllerState must be disabled to set the display state.

maximumAlpha

float maximumAlpha = 1.0f

This is the preferred, maximum alpha value the object should have when it is a comfortable distance from the head.

readControllerState

bool readControllerState = true

Determines if the displayState is set from GvrControllerInputDevice.

Properties

AppButtonColor

Color AppButtonColor

Gets or sets the color of the app button.

The color of the app button.

ArmModel

GvrBaseArmModel ArmModel

Gets or sets the arm model used to position the controller.

The arm model used to position the controller.

ControllerInputDevice

GvrControllerInputDevice ControllerInputDevice

Gets or sets the controller device reference.

The controller device reference.

PreferredAlpha

float PreferredAlpha

Gets the preferred alpha value for the controller.

The preferred alpha value for the controller.

SystemButtonColor

Color SystemButtonColor

Gets or sets the color of the system button.

The color of the system button.

TouchPadColor

Color TouchPadColor

Gets or sets the color of the touch pad.

The color of the touch pad.

Public functions

SetControllerTexture

void SetControllerTexture(
  Texture newTexture
)

Sets the controller texture.

Details
Parameters
newTexture
The new texture to set.

Protected functions

GetVisualAssets

virtual VisualAssets GetVisualAssets()

Override this method to customize the visual's assets.

This method is called once per frame in the visual update process. Call the base method to get the current assets.

Details
Returns
A new struct containing the visual assets.