AR Design
UBC EML collab with UBC SALA - visualizing IoT data in AR
InteractiveWidget.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
using
System
.Collections;
6
7
namespace
HoloToolkit
.Examples.InteractiveElements
8
{
13
public
class
InteractiveWidget
: MonoBehaviour
14
{
15
[Tooltip(
"The Interactive that will update the widget, optional: use if the widget is a sibling of the Interactive or if the parent Interactive is child of another Interactive"
)]
16
public
Interactive
InteractiveHost
;
17
18
// the Interactive state
19
protected
Interactive
.
ButtonStateEnum
State
;
20
24
protected
virtual
void
OnEnable
()
25
{
26
if
(InteractiveHost != null)
27
{
28
InteractiveHost.
RegisterWidget
(
this
);
29
}
30
}
31
35
protected
virtual
void
OnDisable
()
36
{
37
if
(InteractiveHost != null)
38
{
39
InteractiveHost.
UnregisterWidget
(
this
);
40
}
41
}
42
57
public
virtual
void
SetState
(
Interactive
.
ButtonStateEnum
state)
58
{
59
60
switch
(state)
61
{
62
case
Interactive
.
ButtonStateEnum
.Default:
63
break
;
64
case
Interactive
.
ButtonStateEnum
.Focus:
65
break
;
66
case
Interactive
.
ButtonStateEnum
.Press:
67
break
;
68
case
Interactive
.
ButtonStateEnum
.Selected:
69
break
;
70
case
Interactive
.
ButtonStateEnum
.FocusSelected:
71
break
;
72
case
Interactive
.
ButtonStateEnum
.PressSelected:
73
break
;
74
case
Interactive
.
ButtonStateEnum
.Disabled:
75
break
;
76
case
Interactive
.
ButtonStateEnum
.DisabledSelected:
77
break
;
78
default
:
79
break
;
80
}
81
82
State = state;
83
}
84
}
85
}
HoloToolkit.Examples.InteractiveElements.Interactive.UnregisterWidget
void UnregisterWidget(InteractiveWidget widget)
Definition:
Interactive.cs:388
HoloToolkit.Examples.InteractiveElements.InteractiveWidget.InteractiveHost
Interactive InteractiveHost
Definition:
InteractiveWidget.cs:16
HoloToolkit.Examples.InteractiveElements.InteractiveWidget
InteractiveState can exist on a child element of the game object containing the Interactive component...
Definition:
InteractiveWidget.cs:13
System
HoloToolkit.Examples.InteractiveElements.InteractiveWidget.SetState
virtual void SetState(Interactive.ButtonStateEnum state)
Interactive calls this method on state change
Definition:
InteractiveWidget.cs:57
HoloToolkit.Examples.InteractiveElements.Interactive.ButtonStateEnum
ButtonStateEnum
A button typically has 8 potential states. We can update visual feedback based on state change...
Definition:
Interactive.cs:80
HoloToolkit.Examples.InteractiveElements.InteractiveWidget.OnDisable
virtual void OnDisable()
Unregister when disabled
Definition:
InteractiveWidget.cs:35
HoloToolkit.Examples.InteractiveElements.InteractiveWidget.OnEnable
virtual void OnEnable()
register if the InteractiveHost was not manually set
Definition:
InteractiveWidget.cs:24
HoloToolkit.Examples.InteractiveElements.InteractiveWidget.State
Interactive.ButtonStateEnum State
Definition:
InteractiveWidget.cs:19
HoloToolkit
HoloToolkit.Examples.InteractiveElements.Interactive.RegisterWidget
void RegisterWidget(InteractiveWidget widget)
Definition:
Interactive.cs:376
HoloToolkit.Examples.InteractiveElements.Interactive
Interactive exposes basic button type events to the Unity Editor and receives messages from the Gestu...
Definition:
Interactive.cs:22
UnityEngine
Assets
HoloToolkit-Examples
UX
Scripts
Widgets
InteractiveWidget.cs
Generated by
1.8.12