public void LoseLife() { StartCoroutine(pacStudent.DeadTrigger()); lives--; Destroy(uiManager.lives[lives]); uiManager.lives.RemoveAt(lives); }
private void OnTriggerEnter2D(Collider2D collision) { if (collision.CompareTag("Player")) { PacStudentController pacStudent = collision.GetComponent <PacStudentController>(); if (isNormal) { StartCoroutine(pacStudent.DeadTrigger()); gameManager.LoseLife(); } else if (isScared || isRecovering) { if (!isDeath) { UiManager.Instance.UpdateScore(300); SetDeath(); } } } }