コード例 #1
0
    public void load()
    {
        if (IsOnceLoad == false)
        {
            if (PlayerPrefs.HasKey("Stage"))
            {
                StageNum               = PlayerPrefs.GetInt("Stage", StageNum);
                StageText.text         = "Stage : " + StageNum.ToString();
                enemySpawn.IsStarted   = true;
                enemySpawn.Stage       = StageNum;
                enemySpawn.ReSpawnSize = StageNum;
                enemySpawn.LoadEnemy();
                ScoreNum         = PlayerPrefs.GetInt("Score", ScoreNum);
                enemySpawn.Score = ScoreNum;
                ScoreText.text   = "Score : " + ScoreNum.ToString();

                PlayerHp.PlayerCurHp = PlayerPrefs.GetFloat("PlayHp", PlayerHp.PlayerCurHp);
                PlayerHp.PlayerDamege();

                PlayerHp.BoomNum = PlayerPrefs.GetInt("Boom", PlayerHp.BoomNum);

                // 3 2 1
                // x x 1   -> //o x 1
                if (PlayerHp.BoomNum - 1 >= 0)
                {
                    PlayerHp.PlayerBooms[PlayerHp.BoomNum - 1].gameObject.SetActive(true);
                }
            }
            IsOnceLoad = true;
        }
    }