AR Design
UBC EML collab with UBC SALA - visualizing IoT data in AR
OnFocusEvent.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 UnityEngine.Events;
6 
7 namespace HoloToolkit.Unity.InputModule.Tests
8 {
9  public class OnFocusEvent : MonoBehaviour, IFocusable
10  {
11  public UnityEvent FocusEnterEvent;
12  public UnityEvent FocusLostEvent;
13 
14  public void OnFocusEnter()
15  {
16  if (FocusEnterEvent != null)
17  {
18  FocusEnterEvent.Invoke();
19  }
20  }
21 
22  public void OnFocusExit()
23  {
24  if (FocusLostEvent != null)
25  {
26  FocusLostEvent.Invoke();
27  }
28  }
29  }
30 }
Interface to implement to react to focus enter/exit.
Definition: IFocusable.cs:11