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;
5 
6 
7 namespace HoloToolkit.Unity.SharingWithUNET
8 {
12  public class ResetAnchorButton : MonoBehaviour, IInputClickHandler
13  {
18  public void OnInputClicked(InputClickedEventData eventData)
19  {
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 }
Triggers resetting the shared anchor when clicked.
Inherits from UNet's NetworkDiscovery script. Adds automatic anchor management on discovery...
Creates, exports, and imports anchors as required.
Interface to implement to react to simple click input.
void OnInputClicked(InputClickedEventData eventData)
When clicked we will reset the anchor if we are the server
Describes an input event that involves a tap.