-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGameManager.cs
95 lines (78 loc) · 1.97 KB
/
GameManager.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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class GameManager
{
private static GameManager _instance = new GameManager();
private GameState gameStatus = GameState.PLAYING;
public bool timerRunning = false;
public int numberOfAgents = 0;
public int numberOfStations = 0;
public int numberOfPoliti = 0;
public bool spawnEnemies = false;
public bool spawnWinReward = false;
public float totalGameTime = 0;
public enum GameState
{
PLAYING = 0,
WON = 1,
LOST = -1
}
public GameState GameStatus
{
get { return gameStatus; }
set { gameStatus = value; }
}
public float TotalGameplay
{
get { return totalGameTime; }
set { totalGameTime = value; }
}
public bool TimerRunning
{
get { return timerRunning; }
set { timerRunning = value; }
}
public int NumberOfAgents
{
get { return numberOfAgents; }
set { numberOfAgents = value; }
}
public int NumberOfPolice
{
get { return numberOfPoliti; }
set { numberOfPoliti = value; }
}
public int NumberOfStations
{
get { return numberOfStations; }
set { numberOfStations = value; }
}
public bool SpawnEnemies
{
get { return spawnEnemies; }
set { spawnEnemies = value; }
}
public bool SpawnReward
{
get { return spawnWinReward; }
set { spawnWinReward = value; }
}
public static GameManager Instance
{
get
{
if (_instance == null)
{
Debug.Log("created Singleton....");
_instance = new GameManager();
}
return _instance;
}
}
private GameManager() { }
void Awake()
{
_instance = this;
}
}