private IEnumerator Death() { float time = 2f; SetHitBox(false); particles[1].enabled = true; particles[2].enabled = false; pacAnim.SetBool("Dead", true); while (time > 0f) { time -= Time.deltaTime; yield return(null); } frameRenderer.enabled = false; particles[1].enabled = false; yield return(null); while (time < 1f) { time += Time.deltaTime; yield return(null); } GUIText.DecrementLife(); pacAnim.SetBool("Dead", false); float x = isLevel2 ? 2f : 1f; gameObject.transform.position = new Vector2(x, 13f); gameObject.transform.eulerAngles = new Vector3(0f, 0f, -90f); SetHitBox(true); frameRenderer.enabled = true; }