public void GetDamage(float amount) { //Debug.Log("Enemy Get Attack " + amount); AnimatorStateInfo stateInfo = GameObject.Find("Player").GetComponent <Player>().ani.GetCurrentAnimatorStateInfo(0); if (stateInfo.IsName("Stand") || stateInfo.IsName("Walk")) { return; } if (amount < 0) { return; } states.health -= amount; lifeBar.fillAmount -= (amount / 100); if (states.health < 0) { //Debug.Log("Enemy Die"); mother.FreeEnemy(this.gameObject); } }