GUIManager.cs 1.51 KB
Newer Older
Joe Libipl's avatar
Joe Libipl committed
1
using UnityEngine;
2
using System.Text;
Joe Libipl's avatar
Joe Libipl committed
3 4 5 6

public class GUIManager : MonoBehaviour {
	
	private static GUIManager instance;
Joe Libipl's avatar
Joe Libipl committed
7 8
	public MapManager mapManager;
	public NpcManager npcManager;
9
	public CameraControlScript mainCamera;
Joe Libipl's avatar
Joe Libipl committed
10 11 12 13 14 15

	void Start () {
		instance = this;
	}
	
	void Update () {
16
		if (Input.GetKeyDown (KeyCode.Z)) {
Joe Libipl's avatar
Joe Libipl committed
17
			mapManager.CycleZ(false);
18 19
		}
		if (Input.GetKeyDown (KeyCode.A)) {
Joe Libipl's avatar
Joe Libipl committed
20
			mapManager.CycleZ(true);
21
		}
22 23 24 25
		if (Input.GetKeyDown (KeyCode.Space)) {
			mainCamera.ReturnToHome();
		}
		if (Input.GetKeyDown (KeyCode.N)) {
26 27 28 29
			CellLoc randomNpcCell = npcManager.locateRandomNpc();
            Vector3 randomNpcPos = CLUtils.CellLocToVector3(randomNpcCell, 1);
			mainCamera.lookAtNpc(randomNpcPos);
			mapManager.UpdateZ(randomNpcPos.z + 1f);
30
		}
Joe Libipl's avatar
Joe Libipl committed
31 32 33
	}
			
	void OnGUI(){
Joe Libipl's avatar
Joe Libipl committed
34
		GUI.Box (new Rect (0,0,100,50), "# of cells\n" + mapManager.num_cells);
35 36 37
		GUI.Box (new Rect (100,0,100,50), "NPC Instances\n" + npcManager.NumNpcScripts);
		GUI.Box (new Rect (200,0,100,50), "Active NPC Insts\n" + npcManager.NumActiveNpcScripts);
		GUI.Box (new Rect (300,0,100,50), "NPCs in DB\n" + npcManager.NumNpcsInDb);
Joe Libipl's avatar
Joe Libipl committed
38 39
		GUI.Box (new Rect (Screen.width - 100,0,100,50), "# of blocks\n" + mapManager.num_blocks);
		GUI.Box (new Rect (0,Screen.height - 50,100,50), "Z top\n" + mapManager.zTop);
40
		StringBuilder builder = new StringBuilder();
Joe Libipl's avatar
Joe Libipl committed
41
		foreach (int gameRound in npcManager.activeGameRounds)
42 43
			builder.Append(gameRound).Append(" ");
		GUI.Box (new Rect (Screen.width - 100,Screen.height - 50,100,50), "Game Round\n" + builder.ToString());
Joe Libipl's avatar
Joe Libipl committed
44 45 46
	}
	
}