# GvrControllerVisual Class Reference

# GvrControllerVisual

Provides visual feedback for the daydream controller.

## Summary

### Inheritance

Inherits from: MonoBehaviour, [IGvrArmModelReceiver](https://developers.google.com/vr/reference/unity/interface/IGvrArmModelReceiver), [IGvrControllerInputDeviceReceiver](https://developers.google.com/vr/reference/unity/interface/IGvrControllerInputDeviceReceiver)  
Direct Known Subclasses:[GoogleVR.Beta.GvrBetaControllerVisualMulti](https://developers.google.com/vr/reference/unity/class/GoogleVR/Beta/GvrBetaControllerVisualMulti)

| ### Public attributes ||
|---|---|
| `https://developers.google.com/vr/reference/unity/class/GvrControllerVisual#classGvrControllerVisual_1a3b813c833292dc4267ce789558d59758 = 0.111f` | `const float` App button animation duration when pressed. |
| `https://developers.google.com/vr/reference/unity/class/GvrControllerVisual#classGvrControllerVisual_1aa913710c33fdcca64ca2eb8f6f58af33 = 0.0909f` | `const float` App button animation duration when released. |
| `https://developers.google.com/vr/reference/unity/class/GvrControllerVisual#classGvrControllerVisual_1a74cf9a0584e03ac4013c4e97a2f490fb = 0.111f` | `const float` System button animation duration when pressed. |
| `https://developers.google.com/vr/reference/unity/class/GvrControllerVisual#classGvrControllerVisual_1a171bbc7d41791fae82afd262c9193dc7 = 0.0909f` | `const float` System button animation duration when released. |
| `https://developers.google.com/vr/reference/unity/class/GvrControllerVisual#classGvrControllerVisual_1a3580f729838c2d3ca944d49db9e5f952 = 0.111f` | `const float` Touchpad animation duration when pressed. |
| `https://developers.google.com/vr/reference/unity/class/GvrControllerVisual#classGvrControllerVisual_1a4fea8cd8de84e1d85f17788d49f712ff = 0.075f` | `const float` **[Deprecated.](https://developers.google.com/vr/reference/unity/deprecated/deprecated)** This value controls scaling animation times for the touchpad button. |
| `https://developers.google.com/vr/reference/unity/class/GvrControllerVisual#classGvrControllerVisual_1a9e9535e9dddbcde803faa9e4c5f2c293 = 0.15f` | `const float` Duration of the visual bubble on the controller to grow to its full size when clicked. |
| `https://developers.google.com/vr/reference/unity/class/GvrControllerVisual#classGvrControllerVisual_1a2e2e31515b79f87b73afad418d8f7585 = 0.0909f` | `const float` Touchpad animation duration when released. |
| `https://developers.google.com/vr/reference/unity/class/GvrControllerVisual#classGvrControllerVisual_1a97a0fd7b3406d9568fa2b15de8cfe122` | `https://developers.google.com/vr/reference/unity/struct/GvrControllerVisual/ControllerDisplayState#structGvrControllerVisual_1_1ControllerDisplayState` Used to set the display state of the controller visual. |
| `https://developers.google.com/vr/reference/unity/class/GvrControllerVisual#classGvrControllerVisual_1ae51006478640522b20610f53fe47f45a = 1.0f` | `float` This is the preferred, maximum alpha value the object should have when it is a comfortable distance from the head. |
| `https://developers.google.com/vr/reference/unity/class/GvrControllerVisual#classGvrControllerVisual_1a2ac881b8b50b11a1f5a99be4aef51e4e = true` | `bool` Determines if the displayState is set from `https://developers.google.com/vr/reference/unity/class/GvrControllerInputDevice#classGvrControllerInputDevice`. |

| ### Properties ||
|---|---|
| `https://developers.google.com/vr/reference/unity/class/GvrControllerVisual#classGvrControllerVisual_1ad91b55ecf464920c85ca7bd1036c950f` | `Color` Gets or sets the color of the app button. |
| `https://developers.google.com/vr/reference/unity/class/GvrControllerVisual#classGvrControllerVisual_1ac71ef922e1d3b3c4c2f219c19c0d00aa` | `https://developers.google.com/vr/reference/unity/class/GvrBaseArmModel#classGvrBaseArmModel` Gets or sets the arm model used to position the controller. |
| `https://developers.google.com/vr/reference/unity/class/GvrControllerVisual#classGvrControllerVisual_1a3e6628231267668604f21f5a7228da6f` | `https://developers.google.com/vr/reference/unity/class/GvrControllerInputDevice#classGvrControllerInputDevice` Gets or sets the controller device reference. |
| `https://developers.google.com/vr/reference/unity/class/GvrControllerVisual#classGvrControllerVisual_1a504315e357a5bdf495011066b4090732` | `float` Gets the preferred alpha value for the controller. |
| `https://developers.google.com/vr/reference/unity/class/GvrControllerVisual#classGvrControllerVisual_1afe5628d545a17cee48a82f81d43da162` | `Color` Gets or sets the color of the system button. |
| `https://developers.google.com/vr/reference/unity/class/GvrControllerVisual#classGvrControllerVisual_1ac784ddc86ff082b5734a00adc978e083` | `Color` Gets or sets the color of the touch pad. |

| ### Public functions ||
|---|---|
| `https://developers.google.com/vr/reference/unity/class/GvrControllerVisual#classGvrControllerVisual_1a7de2e72a23c13669221f9532d2a0fb4c(Texture newTexture)` | `void` Sets the controller texture. |

| ### Protected functions ||
|---|---|
| `https://developers.google.com/vr/reference/unity/class/GvrControllerVisual#classGvrControllerVisual_1adf972bf591d1c053957530415acdac3c()` | `virtual https://developers.google.com/vr/reference/unity/struct/GvrControllerVisual/VisualAssets#structGvrControllerVisual_1_1VisualAssets` Override this method to customize the visual's assets. |

| ### Structs ||
|---|---|
| [GvrControllerVisual.ControllerDisplayState](https://developers.google.com/vr/reference/unity/struct/GvrControllerVisual/ControllerDisplayState) | The controller display state data structure. |
| [GvrControllerVisual.VisualAssets](https://developers.google.com/vr/reference/unity/struct/GvrControllerVisual/VisualAssets) | Struct that describes a mesh, material pair used for rendering a controller visual. |

## Public attributes

### APP_BUTTON_ACTIVE_DURATION_SECONDS

```c#
const float APP_BUTTON_ACTIVE_DURATION_SECONDS = 0.111f
```
App button animation duration when pressed.

### APP_BUTTON_RELEASE_DURATION_SECONDS

```c#
const float APP_BUTTON_RELEASE_DURATION_SECONDS = 0.0909f
```
App button animation duration when released.

### SYSTEM_BUTTON_ACTIVE_DURATION_SECONDS

```c#
const float SYSTEM_BUTTON_ACTIVE_DURATION_SECONDS = 0.111f
```
System button animation duration when pressed.

### SYSTEM_BUTTON_RELEASE_DURATION_SECONDS

```c#
const float SYSTEM_BUTTON_RELEASE_DURATION_SECONDS = 0.0909f
```
System button animation duration when released.

### TOUCHPAD_CLICK_DURATION_SECONDS

```c#
const float TOUCHPAD_CLICK_DURATION_SECONDS = 0.111f
```
Touchpad animation duration when pressed.

### TOUCHPAD_CLICK_SCALE_DURATION_SECONDS

```c#
const float TOUCHPAD_CLICK_SCALE_DURATION_SECONDS = 0.075f
```
This value controls scaling animation times for the touchpad button.


**[Deprecated.](https://developers.google.com/vr/reference/unity/deprecated/deprecated)**

### TOUCHPAD_POINT_SCALE_DURATION_SECONDS

```c#
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

```c#
const float TOUCHPAD_RELEASE_DURATION_SECONDS = 0.0909f
```
Touchpad animation duration when released.

### displayState

```c#
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

```c#
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

```c#
bool readControllerState = true
```
Determines if the displayState is set from `https://developers.google.com/vr/reference/unity/class/GvrControllerInputDevice#classGvrControllerInputDevice`.

## Properties

### AppButtonColor

```c#
Color AppButtonColor
```
Gets or sets the color of the app button.

The color of the app button.

### ArmModel

```c#
GvrBaseArmModel ArmModel
```
Gets or sets the arm model used to position the controller.

The arm model used to position the controller.

### ControllerInputDevice

```c#
GvrControllerInputDevice ControllerInputDevice
```
Gets or sets the controller device reference.

The controller device reference.

### PreferredAlpha

```c#
float PreferredAlpha
```
Gets the preferred alpha value for the controller.

The preferred alpha value for the controller.

### SystemButtonColor

```c#
Color SystemButtonColor
```
Gets or sets the color of the system button.

The color of the system button.

### TouchPadColor

```c#
Color TouchPadColor
```
Gets or sets the color of the touch pad.

The color of the touch pad.

## Public functions

### SetControllerTexture

```c#
void SetControllerTexture(
  Texture newTexture
)
```
Sets the controller texture.

<br />

| Details ||
|---|---|
| Parameters | |---|---| | `newTexture` | The new texture to set. | |

## Protected functions

### GetVisualAssets

```c#
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.

<br />

| Details ||
|---|---|
| **Returns** | A new struct containing the visual assets. |