Update items
This commit is contained in:
@@ -103,10 +103,12 @@ public partial class Enemy : CharacterBody3D, IEnemy, IProvide<IEnemyLogic>
|
||||
})
|
||||
.Handle((in EnemyLogic.Output.Attack _) =>
|
||||
{
|
||||
AnimationPlayer.Stop();
|
||||
AnimationPlayer.Play("attack");
|
||||
})
|
||||
.Handle((in EnemyLogic.Output.Defeated output) =>
|
||||
{
|
||||
AnimationPlayer.Stop();
|
||||
AnimationPlayer.Play("defeated");
|
||||
});
|
||||
|
||||
@@ -225,13 +227,15 @@ public partial class Enemy : CharacterBody3D, IEnemy, IProvide<IEnemyLogic>
|
||||
if (newHP <= 0)
|
||||
{
|
||||
EnemyLogic.Input(new EnemyLogic.Input.EnemyDefeated());
|
||||
GameEventDepot.OnEnemyDefeated(EnemyStatResource);
|
||||
}
|
||||
}
|
||||
|
||||
private void AnimationPlayer_AnimationFinished(StringName animName)
|
||||
{
|
||||
if (animName == "defeated")
|
||||
{
|
||||
GameEventDepot.OnEnemyDefeated(GlobalPosition, EnemyStatResource);
|
||||
QueueFree();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user