Ejemplo n.º 1
0
        public virtual void OnTriggerEnter2D(Collider2D other)
        {
            float levelTime = SaveAndLoadManager.GetValue <float>(LevelMap.previousLevelName + " Time", Mathf.Infinity);

            if (levelTime == Mathf.Infinity)
            {
                GameManager.Score++;
            }
            if (!LevelTimer.Instance.IsOverParTime() && LevelTimer.IsOverParTime(levelTime))
            {
                GameManager.Score++;
            }
            if (LevelTimer.Instance.timer.TimeElapsed < levelTime)
            {
                SaveAndLoadManager.SetValue(LevelMap.previousLevelName + " Time", LevelTimer.Instance.timer.TimeElapsed);
            }
            if (Snake.hasStar)
            {
                if (!SaveAndLoadManager.GetValue <bool>(LevelMap.previousLevelName + " Got Star", false))
                {
                    GameManager.Score++;
                }
                SaveAndLoadManager.SetValue(LevelMap.previousLevelName + " Got Star", true);
            }
            SaveAndLoadManager.Instance.SaveToCurrentAccount();
            UnlockablesManager.Instance.GetUnlocks();
            WinAnimation.instance.enabled = true;
        }
Ejemplo n.º 2
0
 void OnEnable()
 {
     LevelTimer.Instance.timer.Stop();
     Snake.instance.gameObject.SetActive(false);
     for (int i = 0; i < anims.Count; i++)
     {
         anim = anims[i];
         if (!SaveAndLoadManager.GetValue <bool>(anim.name + " Unlocked", false))
         {
             Destroy(anim.gameObject);
             anims.RemoveAt(i);
             i--;
         }
     }
     if (anims.Count > 0)
     {
         anim = anims[Random.Range(0, anims.Count)];
         anim.Play();
         animStarted = true;
     }
     GameManager.updatables = GameManager.updatables.Add(this);
 }
Ejemplo n.º 3
0
 public virtual void Start()
 {
     enabled = SaveAndLoadManager.GetValue <bool>("Friction Sparks", true);
 }