/// <summary> /// Valida datos y si se cumplen, se activan determinadas animaciones /// </summary> public void ChangePose() { if (playerHealth.CurrentHealth > 0 && !playerInRange && !enemyHealth.IsDead) { anim.SetBool("PlayerAlive", true); anim.SetBool("Walk", true); anim.SetBool("PlayerInRange", false); } if (playerHealth.CurrentHealth > 0 && playerInRange && !enemyAttack.IsAttacking && !enemyHealth.IsDead) { enemyAttack.IsAttacking = true; anim.SetBool("PlayerAlive", true); anim.SetBool("PlayerInRange", true); anim.SetBool("Walk", false); StartCoroutine(enemyAttack.AttackDelay()); } if ((playerHealth.CurrentHealth <= 0) && !enemyHealth.IsDead) { anim.SetBool("PlayerAlive", false); anim.SetBool("Walk", false); anim.SetBool("PlayerInRange", false); } if (enemyHealth.IsDead) { anim.SetBool("IsDead", true); anim.SetBool("PlayerAlive", false); anim.SetBool("Walk", false); anim.SetBool("PlayerInRange", false); } }