cirnogodot/Scripts/Components/FSM/Enemy/3D/EnemyFSMAnimatedSprite3D.cs

30 lines
844 B
C#
Raw Normal View History

2025-06-26 14:03:36 +02:00
using Cirno.Scripts.Components.Actors._3D;
using Cirno.Scripts.Resources;
2025-06-21 16:44:44 +02:00
using Godot;
2025-06-21 15:41:29 +02:00
namespace Cirno.Scripts.Components.FSM.Enemy._3D;
2025-06-26 14:03:36 +02:00
[Tool]
public partial class EnemyFSMAnimatedSprite3D : AnimatedShaderSprite3D
2025-06-21 15:41:29 +02:00
{
2025-06-26 14:03:36 +02:00
//[Export] public EnemyProxy3D EnemyProxy { get; private set; }
2025-06-21 16:44:44 +02:00
2025-06-21 15:41:29 +02:00
public override void _Ready()
{
2025-06-26 14:03:36 +02:00
base._Ready();
2025-06-21 16:44:44 +02:00
//EnemyProxy.Initialized += EnemyFsmProxyOnInitialized;
2025-06-26 14:03:36 +02:00
if (!Engine.IsEditorHint())
{
var enemyProxy = GetParent<EnemyProxy3D>();
this.SpriteFrames = enemyProxy.EnemyResource.AnimationFrames;
HandleFrameChanged();
}
2025-06-21 16:44:44 +02:00
}
private void EnemyFsmProxyOnInitialized(EnemyResource resource)
{
2025-06-26 14:03:36 +02:00
if (Engine.IsEditorHint()) return;
2025-06-21 16:44:44 +02:00
this.SpriteFrames = resource.AnimationFrames;
2025-06-21 15:41:29 +02:00
}
}