-
Notifications
You must be signed in to change notification settings - Fork 1
/
ispycollision.cs
50 lines (39 loc) · 1.12 KB
/
ispycollision.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
43
44
45
46
47
48
49
50
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class ispycollision : MonoBehaviour
{
// Start is called before the first frame update
public GameObject cursor;
public Text clock;
public Text balloon;
public Text guitar;
GameObject foundObject;
void Start()
{
}
// Update is called once per frame
void Update()
{
}
void OnTriggerEnter(Collider col)
{
//Ouput the Collision to the console
if(col.gameObject.name=="clock"){
Debug.Log("Found Clock");
clock.text = "✓";
clock.color = new Color32(0,255,0,255);
}else if(col.gameObject.name=="balloon"){
Debug.Log("Found Balloon");
balloon.text = "✓";
balloon.color = new Color32(0,255,0,255);
}else if(col.gameObject.name=="guitar"){
Debug.Log("Found Guitar");
guitar.text = "✓";
guitar.color = new Color32(0,255,0,255);
}
Debug.Log("Collision : " + col.gameObject.name);
}
//✓
}