forked from Myyyvothrr/1gam-dungeon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtile_level_trigger.cs
33 lines (29 loc) · 1.02 KB
/
tile_level_trigger.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
using UnityEngine;
using System.Collections;
public class tile_level_trigger : MonoBehaviour
{
void Start()
{
}
void Update()
{
}
void OnTriggerEnter(Collider other)
{
if (tag.Equals("exit") && other.tag.Equals("Player"))
other.SendMessage("exit_triggered", true);
else if (tag.Equals("teleporter") && other.tag.Equals("Player"))
other.SendMessage("teleporter_triggered", true);
else if (tag.Equals("teleporter_boss") && other.tag.Equals("Player"))
other.SendMessage("teleporter_boss_triggered", true);
}
void OnTriggerExit(Collider other)
{
if (tag.Equals("exit") && other.tag.Equals("Player"))
other.SendMessage("exit_triggered", false);
else if (tag.Equals("teleporter") && other.tag.Equals("Player"))
other.SendMessage("teleporter_triggered", false);
else if (tag.Equals("teleporter_boss") && other.tag.Equals("Player"))
other.SendMessage("teleporter_boss_triggered", false);
}
}