-
Notifications
You must be signed in to change notification settings - Fork 0
/
GameFlow.cs
71 lines (67 loc) · 1.82 KB
/
GameFlow.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
using Fungus;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class GameFlow : MonoBehaviour
{
public Flowchart flow;
private void OnTriggerEnter2D(Collider2D collision)
{
if(collision.tag == "Computer")
{
flow.ExecuteBlock("Exploring Computers in Room.");
}
if (collision.tag == "Files")
{
flow.ExecuteBlock("Look Through Files.");
}
if (collision.tag == "Stairs")
{
flow.ExecuteBlock("Found Stairs");
}
if(collision.tag == "taperecorder")
{
flow.ExecuteBlock("Tape Recorder");
}
if (collision.tag == "box")
{
flow.ExecuteBlock("Box");
}
if (collision.tag == "fameis")
{
flow.ExecuteBlock("Fameis");
}
}
private void OnCollisionEnter2D(UnityEngine.Collision2D collision)
{
if(collision.gameObject.tag == "Sword")
{
gameObject.GetComponent<WeaponSwitcher>().weaponHolding = gameObject.GetComponent<WeaponSwitcher>().weaponList[0];
flow.ExecuteBlock("Regular Sword");
Destroy(collision.gameObject);
}
}
private void OnTriggerExit2D(Collider2D other)
{
if(other.tag == "StairsPrompt")
{
flow.StopAllBlocks();
flow.ExecuteBlock("Go To Stairs");
}
if (other.tag == "Computer")
{
flow.StopAllBlocks();
flow.StopBlock("Menu Options");
}
if (other.tag == "Files")
{
flow.StopAllBlocks();
flow.StopBlock("Menu Options");
}
if (other.tag == "Stairs")
{
flow.StopAllBlocks();
flow.StopBlock("Menu Options");
}
}
}