public void Play(int LoadLevel) { int level = PlayerPrefs.GetInt("level"); if (LoadLevel <= level) { Levels.SetAct(false); load.SetLevel(LoadLevel); load.loadlevel(); } }
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(); }
public override void Die() { menu.Die(); load.SetLevel(0); load.loadlevel(); }