public override void DamageEvent(int damage, string motion) { playerInfo.hp -= damage; if (playerInfo.hp <= 0) { playerInfo.hp = 0; } nextState = new DamegeState(); nextState.InitNextState(playerInfo); playerInfo.animator.Play(motion); }
public override void DamageEvent(int damage, string motion) { if (damage > (float)playerInfo.characterInfo.status.hp / 10f) { playerInfo.animator.Play(motion); nextState = new DamegeState(); nextState.InitNextState(playerInfo); } playerInfo.hp -= damage; if (playerInfo.hp <= 0) { playerInfo.hp = 0; } }