// Update is called once per frame void Update() { if (_enemy == null) { _enemy = Instantiate(_enemyPrefab) as GameObject; _enemy.transform.position = SpawnLocation(); _enemy.transform.Rotate(0, Random.rotation.eulerAngles.y, 0); } if (Input.GetKeyDown(KeyCode.Escape)) { switch (Paused) { case false: Time.timeScale = 0; MouseView.PressedPause(Paused); Paused = true; break; case true: Time.timeScale = 1; MouseView.PressedPause(Paused); Paused = false; break; } } }
// Update is called once per frame void Update() { //Pause game if (Input.GetKeyDown(KeyCode.Escape)) { switch (Paused) { case false: Time.timeScale = 0; MouseView.PressedPause(Paused); Paused = true; break; case true: Time.timeScale = 1; MouseView.PressedPause(Paused); Paused = false; break; } ui.OnPaused(Paused); } }