public void OnPausePress() { Time.timeScale = 0; this.mainMusic.Pause(); isPaused = true; this.startResumeObj.SetActive(true); this.restartButton.interactable = true; ValuesManager.SaveScore(); DisableEnableMenu(true); }
private void OnTriggerEnter2D(Collider2D collider) { if (collider.CompareTag("Laser")) { if (!isDead) { this.mainAudioSrc.PlayOneShot(this.laserZapSound); } isDead = true; ValuesManager.SaveCoins(); ValuesManager.SaveScore(); } else if (collider.CompareTag("Coin")) { Destroy(collider.gameObject); this.mainAudioSrc.PlayOneShot(this.collectCoinSound); ValuesManager.AddCoin(); this.ui.UpdateCoinsText(); } }