コード例 #1
0
    private void Awake()
    {
        LevelStats stats = LevelStats.Load(levelName);

        if (stats == null)
        {
            stats = new LevelStats();
        }

        if (stats.hasCrystals)
        {
            crystal.sprite = allCrystals;
            crystal.GetComponent <Transform>().localScale = new Vector3(.7f, .7f, 1f);
        }
        if (stats.hasAllFruits)
        {
            fruit.sprite = allFruits;
            fruit.GetComponent <Transform>().localScale = new Vector3(.8f, .8f, 1f);
        }
        if (LevelStats.Load(prevLevel) != null)
        {
            isOpen = LevelStats.Load(prevLevel).levelPassed;
        }
        doorLock.enabled = !isOpen;
        check.enabled    = stats.levelPassed;
    }
コード例 #2
0
 public void Load()
 {
     this.stats = LevelStats.Load(levelName);
     if (this.stats == null)
     {
         this.stats = new LevelStats();
     }
 }