public void Update() { timeLeft -= Time.deltaTime; if (timeLeft < 0) { LevelChanger.FadeNextScene(); } }
private void OnTriggerEnter2D(Collider2D collision) { boxAnimator.SetTrigger("DamageBox"); hitpoint.SetTrigger("DamageBox"); boxDamage++; if (boxDamage == 3) { boxAnimator.SetTrigger("OverBox"); LevelChanger.FadeNextScene(); } }