-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGameMaster.cs
More file actions
41 lines (35 loc) · 1.01 KB
/
GameMaster.cs
File metadata and controls
41 lines (35 loc) · 1.01 KB
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
using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
[DisallowMultipleComponent]
public class GameMaster : MonoBehaviour {
public static GameMaster gm;
// Use a queue to insert character actions
// Resets every turn; turns determined when actionqueue is empty
// private bool battleInProgress = false;
private void Awake () {
if (gm == null) {
gm = this;
} else if (gm != this) {
//If instance already exists and it's not this: destroy this game object
Destroy(gameObject);
}
DontDestroyOnLoad(gameObject);
// battle = transform.GetComponentInChildren<BattleStates> ();
}
// void Update () {
// if (Input.GetButtonDown("Fire1")) {
// if (!battleInProgress) {
// battleInProgress = true;
// battle.InitBattle ();
//// Debug.Log ("Battle ended.");
// }
// }
// if(Input.GetButtonDown("Fire3")) {
// battle.EndBattle (BattleStates.WinStatus.Escape);
// battleInProgress = false;
// Debug.Log ("Ending the battle...");
// }
//}
}