public void _ButtonResum() { GetComponent <AudioSource>().Play(); Time.timeScale = 1; PanelPause.SetActive(false); pause.gameObject.SetActive(true); }
void Awake() { panelPause = goPanelPause.GetComponent<PanelPause> (); button = gameObject.GetComponent<Button> (); button.onClick.AddListener (delegate() { buttonClick(); }); sound = gameObject.GetComponent<AudioSource>(); }
private void Start() { Instance = this; _pausePanel = FindObjectOfType <PanelPause>(); Debug.Log(_pausePanel); if (_pausePanel != null) { if (_pausePanel.gameObject.activeSelf) { _pausePanel.gameObject.SetActive(false); } } }
public void PauseGame() { if (panelDebug.activeInHierarchy) { panelDebug.SetActive(false); } PlayerScript playerScript; if (gameManagerScript.IsVirtualCamFollowingScientist) { playerScript = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerScript>(); } else { playerScript = GameObject.FindGameObjectWithTag("Robot").GetComponent <PlayerScript>(); } if (!PanelPause.activeInHierarchy) { if (PanelInventory.activeInHierarchy) { PanelInventory.SetActive(false); return; } playerScript.IsAbleToAttack = false; Time.timeScale = 0; PanelBoss.SetActive(false); } else { Time.timeScale = 1; StartCoroutine(AttackBool(playerScript)); panelParameters.SetActive(false); PanelInventory.SetActive(false); if (isLastPanelBossActive) { PanelBoss.SetActive(true); } } PanelPause.SetActive(!PanelPause.activeInHierarchy); }
//resumes the game from the paused state public void resumeGame() { Time.timeScale = 1; PanelPause.SetActive(false); }
//Pauses the game and timescale public void pauseGame() { Time.timeScale = 0.0001F; PanelPause.SetActive(true); }
public void Unpause() { Time.timeScale = 1f; PanelPause.SetActive(false); JoystickCanvas.SetActive(true); }
void Awake() { AdControl.hideBanner(); Application.targetFrameRate = 60; gameState = GameConst.GAME_STATE.PLAYING; bonusStyleControl = GetComponent<BonusStyleControl> (); trans = GetComponent<Transform> (); canvas = GameObject.Find ("Canvas"); score = canvas.GetComponent<Score>(); panelGameOver = goPanelGameover.GetComponent<PanelGameOver> (); panelPause = goPanelPause.GetComponent<PanelPause> (); listSnake = new List<SnakeBody> (); listFood = new List<Food>(); snakeState = GameConst.snakeState.MOVING; AudioSource[] audios = gameObject.GetComponents<AudioSource> (); combineSound = audios[0]; eatSound = audios[1]; crushSound = audios[2]; }