forked from microsoft/MixedRealityToolkit-Unity
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathButtonReceiverExample.cs
42 lines (35 loc) · 1.38 KB
/
ButtonReceiverExample.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.
using HoloToolkit.Unity;
using System.Collections.Generic;
using UnityEngine;
using HoloToolkit.Unity.Receivers;
using HoloToolkit.Unity.InputModule;
namespace HoloToolkit.Unity.Examples
{
public class ButtonReceiverExample : InteractionReceiver
{
public GameObject textObjectState;
private TextMesh txt;
void Start()
{
txt = textObjectState.GetComponentInChildren<TextMesh>();
}
protected override void FocusEnter(GameObject obj, PointerSpecificEventData eventData) {
Debug.Log(obj.name + " : FocusEnter");
txt.text = obj.name + " : FocusEnter";
}
protected override void FocusExit(GameObject obj, PointerSpecificEventData eventData) {
Debug.Log(obj.name + " : FocusExit");
txt.text = obj.name + " : FocusExit";
}
protected override void InputDown(GameObject obj, InputEventData eventData) {
Debug.Log(obj.name + " : InputDown");
txt.text = obj.name + " : InputDown";
}
protected override void InputUp(GameObject obj, InputEventData eventData) {
Debug.Log(obj.name + " : InputUp");
txt.text = obj.name + " : InputUp";
}
}
}