// void UpdateGame(){ // //Game.current.inventory = GameObject.FindGameObjectWithTag ("Inventory").GetComponent<Inventory> ().inventory; // Game.current.playerSanity = GameObject.FindGameObjectWithTag ("Player").GetComponent<Sanity> ().currentSanity; // //Game.current.savePoint = GameObject.FindGameObjectWithTag ("Player").GetComponent<Player> ().savePoint; // // } void OnGUI() { DogCommands dog = GameObject.FindGameObjectWithTag("Dog").GetComponent <DogCommands> (); if (hideShow == true) { if (isDetected) { GUI.Box(new Rect((Screen.width - 150) / 2, (Screen.height - 20) / 2, 150, 20), "The enemy sees you."); } else if (dog.switchOn) { GUI.Box(new Rect((Screen.width - 150) / 2, (Screen.height - 20) / 2, 200, 20), "Make sure lights are off!"); GUI.Box(new Rect((Screen.width - 150) / 2, (Screen.height + 30) / 2, 200, 20), "Input <Space> to disable lights."); } else { GUI.Box(new Rect((Screen.width - 150) / 2, (Screen.height - 20) / 2, 150, 20), "Input <e> to Hide."); } //GUI.Box(new Rect(0, 0, Screen.width, Screen.height), "This is a title"); } if (Input.GetKey(KeyCode.Tab)) { Help(); } }
// Use this for initialization void Start() { mainCamera.camera.enabled = true; this.hidingCamera.camera.enabled = false; player = GameObject.FindGameObjectWithTag("Player").GetComponent <Player> (); dog = GameObject.FindGameObjectWithTag("Dog").GetComponent <DogCommands> (); }