public override void Execute() { var player = model.player; if (player.health.IsAlive) { player.health.Die(); model.virtualCamera.m_Follow = null; model.virtualCamera.m_LookAt = null; // player.collider.enabled = false; player.controlEnabled = false; if (player.audioSource && player.ouchAudio) { player.audioSource.PlayOneShot(player.ouchAudio); } player.animator.SetTrigger("hurt"); player.animator.SetBool("dead", true); Simulation.Schedule <PlayerSpawn>(2); int numTemp = Score.score; PlayerPrefs.SetInt("ScoreNumber", numTemp); Debug.Log("Save Score " + numTemp); if (LoadScore.p[0] < numTemp) { PlayerPrefs.SetInt("ps0", numTemp); LoadScore.loadScore(); } Score.score = 0; //Score.secondsCount = 0; } }
void Start() { var load_score = new LoadScore(); var score = load_score.Load(); var text_obj = GameObject.Find("Score").GetComponent <Text>(); text_obj.text = "今回のスコア:" + score.score.ToString(); score = load_score.Load(true); text_obj = GameObject.Find("BestScore").GetComponent <Text>(); text_obj.text = "ベストスコア:" + score.score.ToString(); }
public void Regist() { if (StaticDatas.Instance.PlayFabAPI.IsExeNow) { return; } var load = new LoadScore(); var score = load.Load(); var save = new SaveScore(); save.SaveName(input_name_text.text); StaticDatas.Instance.PlayFabAPI.SetUserName(input_name_text.text, score.score); }
void LoadScore() { var load = new LoadScore(); var score = load.Load(); var obj = GameObject.Find(ConstObjectNames.PLAYER_SCORE); var text = obj.GetComponent <Text>(); text.text = score.score.ToString(); obj = GameObject.Find(ConstObjectNames.PLAYER_NAME); text = obj.GetComponent <Text>(); text.text = score.name; StaticDatas.Instance.PlayFabAPI.UserName = score.name; }
public override void Execute() { model.player.animator.SetTrigger("victory"); model.player.controlEnabled = false; Score.isVictory = 1; // int numTemp = Score.score; PlayerPrefs.SetInt("ScoreNumber", numTemp); Debug.Log("Save Score " + numTemp); if (LoadScore.p[0] < numTemp) { PlayerPrefs.SetInt("ps0", numTemp); LoadScore.loadScore(); } }
private void OnEnable() { bestScore = LoadScore.Load(key); }