-
Notifications
You must be signed in to change notification settings - Fork 0
/
CanvasText.cs
38 lines (36 loc) · 1.03 KB
/
CanvasText.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
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.XR;
using UnityEngine.UI;
public class CanvasText : MonoBehaviour
{
public GameObject canvasObj = null;
private int collide_status = 0;
private int sensorOffsetValueChecked = 0;
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
Text whatToWrite = canvasObj.GetComponent<Text> ();
if(sensorOffsetValueChecked == 0){
whatToWrite.text = "Please press Y button when you decide your initial position.";
if(OVRInput.Get(OVRInput.RawButton.Y)){
sensorOffsetValueChecked = 1;
}
} else {
if (collide_status == 0){
whatToWrite.text = "";
} else {
whatToWrite.text = "YOU WIN!" + "\n" + "YOU ARE A SEEKER!!";
}
}
}
void OnTriggerEnter(Collider collision)
{
collide_status = 1;
}
}