From e13fd4cf1fc0ad9eff857295fd5abc15ab01462c Mon Sep 17 00:00:00 2001 From: Jakob Stendahl Date: Fri, 6 Oct 2017 16:04:38 +0200 Subject: Startet på tårn, fiksa dev-mode, laga stats UI MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- td/Assets/Scripts/developerMode.cs | 36 ++++++++++++++++++++++++++++++++---- 1 file changed, 32 insertions(+), 4 deletions(-) (limited to 'td/Assets/Scripts/developerMode.cs') diff --git a/td/Assets/Scripts/developerMode.cs b/td/Assets/Scripts/developerMode.cs index b0d7704..4f241cf 100644 --- a/td/Assets/Scripts/developerMode.cs +++ b/td/Assets/Scripts/developerMode.cs @@ -7,16 +7,35 @@ public class developerMode : MonoBehaviour { public string output = ""; public string stack = ""; + public bool cheatsAllowed; - bool developerModeActive; GameObject pnlCanvas; + GameObject pnlCheats; + Button btnToggleCheats; Text lblConsoleLog; + bool developerModeActive; + bool cheatMenuOpen; + void Start () { - pnlCanvas = transform.Find ("Canvas").gameObject; + /* Panels */ + pnlCanvas = this.gameObject.transform.GetChild (0).gameObject; + pnlCheats = pnlCanvas.transform.Find ("cheatMenu").gameObject; + /* Buttons */ + /* Button handlers */ + /* Lablels */ lblConsoleLog = pnlCanvas.transform.Find ("consoleLog").gameObject.GetComponent (); - + /* Do setup */ lblConsoleLog.text = ""; + + if (cheatsAllowed) { + btnToggleCheats = pnlCanvas.transform.Find ("toggleCheats").gameObject.GetComponent