Example #1
0
    public void Play(int LoadLevel)
    {
        int level = PlayerPrefs.GetInt("level");

        if (LoadLevel <= level)
        {
            Levels.SetAct(false);
            load.SetLevel(LoadLevel);
            load.loadlevel();
        }
    }
Example #2
0
    private void OnTriggerEnter2D(Collider2D collider)
    {
        int r = PlayerPrefs.GetInt("level");

        if (r < level)
        {
            PlayerPrefs.SetInt("level", level);
        }
        Unit unit = collider.GetComponent <Unit>();

        load.SetLevel(level);
        load.loadlevel();
    }
Example #3
0
 public override void Die()
 {
     menu.Die();
     load.SetLevel(0);
     load.loadlevel();
 }