void OnGameOver() { if (gameController.Score > GamePreferences.profile.HighScore) { GamePreferences.profile.updateHighScore(gameController.Score); GamePreferences.submitScore(GamePreferences.profile.HighScore); } GamePreferences.profile.updateStar(gameController.Star); GamePreferences.saveProfile(); _isPlaying = false; StartCoroutine("toResultState"); }
void UnLock(int id) { if (GamePreferences.profile.Star >= listItem[id].data.star) { GamePreferences.profile.unLockCustomize(id); GamePreferences.profile.updateStar(0 - listItem[id].data.star); GamePreferences.saveProfile(); txtStar.text = GamePreferences.profile.Star.ToString(); listItem[id].UnLock(); ReLoadTextStar(); } else { PopupManager.Instance.InitMesage("not enough GEM"); } }
void OnCallbackRescue() { // Callback show video // safe cameraGame.transform.position += distanceRescueVel; // Reset Ghost ghost.transform.position = startGhost.position; ghost.init(); ghost.CanControl = true; ghost.OnGhostDie += OnGhostDie; // resume countRescue++; GamePreferences.profile.updateStar(0 - GameConstants.Instance.gemRescue); GamePreferences.saveProfile(); resumeGame(); }
public void onBtnSettingsClick() { float value = 0; if (GamePreferences.profile.SoundVolume != 0) { value = 0f; Utils.setActive(audioOn, false); Utils.setActive(audioOff, true); } else { value = 1.0f; Utils.setActive(audioOn, true); Utils.setActive(audioOff, false); } GamePreferences.profile.SoundVolume = value; AudioManager.SetSFXVolume(value); GamePreferences.saveProfile(); }
public void onBtnOkClick() { GSGamePlay.Instance.UpgradeCharater(GamePreferences.profile.Customize); GamePreferences.saveProfile(); GameStatesManager.Instance.stateMachine.SwitchState(GSGamePlay.Instance); }
public void onBtnPlayClick() { GamePreferences.profile.EnableTutorial = false; GamePreferences.saveProfile(); GameStatesManager.Instance.stateMachine.SwitchState(GSGamePlay.Instance); }