AR Design
UBC EML collab with UBC SALA - visualizing IoT data in AR
MoveObjectSelectWidget.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
HoloToolkit
.
Examples
.
Prototyping
;
5
using
System
.Collections;
6
using
System
.Collections.Generic;
7
using
UnityEngine
;
8
9
namespace
HoloToolkit
.Examples.InteractiveElements
10
{
14
[RequireComponent(typeof(
MoveToPosition
))]
15
public
class
MoveObjectSelectWidget
:
InteractiveWidget
16
{
17
[Tooltip(
"Default position for the default state"
)]
18
public
Vector3
DefaultPosition
;
19
20
[Tooltip(
"Position for the selected state"
)]
21
public
Vector3
SelectPosition
;
22
23
private
MoveToPosition
mMoveToPosition;
24
28
void
Awake()
29
{
30
mMoveToPosition = GetComponent<MoveToPosition>();
31
}
32
37
public
override
void
SetState
(
Interactive
.
ButtonStateEnum
state)
38
{
39
base.SetState(state);
40
41
if
(mMoveToPosition != null)
42
{
43
if
(state ==
Interactive
.
ButtonStateEnum
.FocusSelected || state ==
Interactive
.
ButtonStateEnum
.Selected || state ==
Interactive
.
ButtonStateEnum
.PressSelected || state ==
Interactive
.
ButtonStateEnum
.DisabledSelected)
44
{
45
mMoveToPosition.
TargetValue
= SelectPosition;
46
mMoveToPosition.
StartRunning
();
47
}
48
else
49
{
50
mMoveToPosition.
TargetValue
= DefaultPosition;
51
mMoveToPosition.
StartRunning
();
52
}
53
}
54
}
55
}
56
}
HoloToolkit.Examples.InteractiveElements.MoveObjectSelectWidget.SetState
override void SetState(Interactive.ButtonStateEnum state)
Animate the position
Definition:
MoveObjectSelectWidget.cs:37
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
HoloToolkit.Examples.InteractiveElements.MoveObjectSelectWidget
Changes the position of an element based on the Interactive selected state
Definition:
MoveObjectSelectWidget.cs:15
HoloToolkit.Examples.Prototyping.MoveToPosition.StartRunning
void StartRunning()
Start the animation
Definition:
MoveToPosition.cs:76
HoloToolkit.Examples.Prototyping.MoveToPosition
A position animation component that supports easing and local position The animation can be triggered...
Definition:
MoveToPosition.cs:22
HoloToolkit.Examples.InteractiveElements.MoveObjectSelectWidget.SelectPosition
Vector3 SelectPosition
Definition:
MoveObjectSelectWidget.cs:21
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.Prototyping.MoveToPosition.TargetValue
Vector3 TargetValue
Definition:
MoveToPosition.cs:38
HoloToolkit.Examples.InteractiveElements.MoveObjectSelectWidget.DefaultPosition
Vector3 DefaultPosition
Definition:
MoveObjectSelectWidget.cs:18
HoloToolkit.Examples.Prototyping
Definition:
ColorTransition.cs:8
HoloToolkit
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
MoveObjectSelectWidget.cs
Generated by
1.8.12