mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-12 02:25:55 +00:00
Generic enemies
This commit is contained in:
parent
762666242e
commit
d99c773641
55 changed files with 968 additions and 204 deletions
16
Scripts/Components/FSM/Enemy/EnemyFSMAnimatedSprite.cs
Normal file
16
Scripts/Components/FSM/Enemy/EnemyFSMAnimatedSprite.cs
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
using Godot;
|
||||
|
||||
namespace Cirno.Scripts.Components.FSM.Enemy;
|
||||
|
||||
public partial class EnemyFSMAnimatedSprite : AnimatedSprite2D
|
||||
{
|
||||
public override void _Ready()
|
||||
{
|
||||
var enemyFsmProxy = this.GetParentOrNull<EnemyFSMProxy>();
|
||||
|
||||
if (enemyFsmProxy?.EnemyResource?.AnimationFrames != null)
|
||||
{
|
||||
this.SpriteFrames = enemyFsmProxy.EnemyResource.AnimationFrames;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1 @@
|
|||
uid://dathhlufbe6gr
|
||||
|
|
@ -27,6 +27,12 @@ public partial class EnemyFSMProxy : CharacterBody2D, IActivable
|
|||
|
||||
[Signal] public delegate void DeathEventHandler(EnemyFSMProxy enemy);
|
||||
|
||||
public void Init(EnemyResource enemyResource)
|
||||
{
|
||||
this.EnemyResource = enemyResource;
|
||||
|
||||
}
|
||||
|
||||
public void TriggerDeath()
|
||||
{
|
||||
EmitSignalDeath(this);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue