void OnTriggerEnter(Collider col) { if (!bossFightStarted) { if (col.gameObject.CompareTag("Player")) { hpBarVisual.SetActive(true); fightTrigger.enabled = false; pillar.SetActive(true); whatPhase = bossFightState.first; bossFightStarted = true; } } if (bossFightStarted && alive) { if (col.gameObject.CompareTag("Sword") && !hurt && !transformAnimation && whatPhase == bossFightState.first) { hurt = true; stunned = true; StartCoroutine(Hurt()); } if (col.gameObject.CompareTag("Sword") && !hurt && !transformAnimation && whatPhase == bossFightState.second && canBeHitSecondPhase) { canBeHitSecondPhase = false; StartCoroutine(HurtSecondPhase()); } } }
IEnumerator PhaseTwo() { anim.SetInteger("State", 5); yield return(new WaitForSeconds(2.5f)); whatPhase = bossFightState.second; transformAnimation = false; }