mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-12 05:05:54 +00:00
Enemy blinking
This commit is contained in:
parent
79cac3ebae
commit
e5a60a6ccd
11 changed files with 172 additions and 30 deletions
|
|
@ -1,20 +1,30 @@
|
|||
using Cirno.Scripts.Resources;
|
||||
using Cirno.Scripts.Components.Actors._3D;
|
||||
using Cirno.Scripts.Resources;
|
||||
using Godot;
|
||||
|
||||
namespace Cirno.Scripts.Components.FSM.Enemy._3D;
|
||||
|
||||
public partial class EnemyFSMAnimatedSprite3D : AnimatedSprite3D
|
||||
[Tool]
|
||||
public partial class EnemyFSMAnimatedSprite3D : AnimatedShaderSprite3D
|
||||
{
|
||||
[Export] public EnemyProxy3D EnemyProxy { get; private set; }
|
||||
//[Export] public EnemyProxy3D EnemyProxy { get; private set; }
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
base._Ready();
|
||||
//EnemyProxy.Initialized += EnemyFsmProxyOnInitialized;
|
||||
this.SpriteFrames = EnemyProxy.EnemyResource.AnimationFrames;
|
||||
if (!Engine.IsEditorHint())
|
||||
{
|
||||
var enemyProxy = GetParent<EnemyProxy3D>();
|
||||
this.SpriteFrames = enemyProxy.EnemyResource.AnimationFrames;
|
||||
|
||||
HandleFrameChanged();
|
||||
}
|
||||
}
|
||||
|
||||
private void EnemyFsmProxyOnInitialized(EnemyResource resource)
|
||||
{
|
||||
if (Engine.IsEditorHint()) return;
|
||||
this.SpriteFrames = resource.AnimationFrames;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue