AR Design
UBC EML collab with UBC SALA - visualizing IoT data in AR
AnimButton.cs
Go to the documentation of this file.
1
// Copyright (c) Microsoft Corporation. All rights reserved.
2
// Licensed under the MIT License. See LICENSE in the project root for license information.
3
4
using
UnityEngine
;
5
6
namespace
HoloToolkit
.Unity.Buttons
7
{
11
[RequireComponent(typeof(Animator))]
12
public
class
AnimButton
:
Button
13
{
17
private
Animator _animator;
18
22
public
override
void
OnStateChange
(
ButtonStateEnum
newState)
23
{
24
if
(_animator == null)
25
{
26
_animator = this.GetComponent<Animator>();
27
}
28
29
_animator.SetInteger(
"State"
, (
int
)newState);
30
31
base.OnStateChange(newState);
32
}
33
}
34
}
HoloToolkit.Unity.Buttons.AnimButton.OnStateChange
override void OnStateChange(ButtonStateEnum newState)
On state change swap out the active mesh based on the state
Definition:
AnimButton.cs:22
HoloToolkit.Unity.Buttons.ButtonStateEnum
ButtonStateEnum
State enum for buttons.
Definition:
ButtonStateEnum.cs:9
HoloToolkit.Unity.Buttons.AnimButton
Mesh button is a mesh renderer interactable with state data for button state
Definition:
AnimButton.cs:12
HoloToolkit
Button
UnityEngine
Assets
HoloToolkit
UX
Scripts
Buttons
AnimButton.cs
Generated by
1.8.12