AR Design
UBC EML collab with UBC SALA - visualizing IoT data in AR
ResetAnchorButton.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
using
UnityEngine
;
4
using
HoloToolkit
.
Unity
.
InputModule
;
5
6
7
namespace
HoloToolkit
.Unity.SharingWithUNET
8
{
12
public
class
ResetAnchorButton
: MonoBehaviour,
IInputClickHandler
13
{
18
public
void
OnInputClicked
(
InputClickedEventData
eventData)
19
{
20
if
(
NetworkDiscoveryWithAnchors
.
Instance
.isServer)
21
{
22
#if UNITY_WSA
23
UNetAnchorManager
.
Instance
.MakeNewAnchor();
24
#endif
25
eventData.Use();
26
}
27
else
28
{
29
Debug
.Log(
"Only the server can reset the anchor at this time."
);
30
}
31
}
32
}
33
}
HoloToolkit.Unity.SharingWithUNET.ResetAnchorButton
Triggers resetting the shared anchor when clicked.
Definition:
ResetAnchorButton.cs:12
HoloToolkit.Unity.InputModule
Definition:
AnimatedCursor.cs:7
HoloToolkit.Unity.SharingWithUNET.NetworkDiscoveryWithAnchors
Inherits from UNet's NetworkDiscovery script. Adds automatic anchor management on discovery...
Definition:
NetworkDiscoveryWithAnchors.cs:25
HoloToolkit.Unity.SharingWithUNET.UNetAnchorManager
Creates, exports, and imports anchors as required.
Definition:
UNetAnchorManager.cs:28
HoloToolkit.Unity.InputModule.IInputClickHandler
Interface to implement to react to simple click input.
Definition:
IInputClickHandler.cs:11
HoloToolkit.Unity.SharingWithUNET.NetworkDiscoveryWithAnchors.Instance
static NetworkDiscoveryWithAnchors Instance
Definition:
NetworkDiscoveryWithAnchors.cs:32
HoloToolkit.Unity.SharingWithUNET.ResetAnchorButton.OnInputClicked
void OnInputClicked(InputClickedEventData eventData)
When clicked we will reset the anchor if we are the server
Definition:
ResetAnchorButton.cs:18
Debug
HoloToolkit.Unity.InputModule.InputClickedEventData
Describes an input event that involves a tap.
Definition:
InputClickedEventData.cs:11
HoloToolkit
HoloToolkit.Unity.SharingWithUNET.UNetAnchorManager.Instance
static UNetAnchorManager Instance
Definition:
UNetAnchorManager.cs:37
UnityEngine
HoloToolkit.Unity
Assets
HoloToolkit-Examples
SharingWithUNET
Scripts
ResetAnchorButton.cs
Generated by
1.8.12