mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-09 12:45:55 +00:00
Teleporter animation
This commit is contained in:
parent
eb1d74ee63
commit
50c111ee28
10 changed files with 111 additions and 52 deletions
|
|
@ -23,6 +23,8 @@ public partial class Teleporter : Activable
|
|||
|
||||
private double _particleTimer;
|
||||
|
||||
private AnimatedSprite2D _animatedSprite;
|
||||
|
||||
// [Export]
|
||||
// public GpuParticles2D Particles { get; set; }
|
||||
|
||||
|
|
@ -31,10 +33,20 @@ public partial class Teleporter : Activable
|
|||
public override void _Ready()
|
||||
{
|
||||
_particles = GetNode<GpuParticles2D>("./Particles");
|
||||
_animatedSprite = GetNode<AnimatedSprite2D>("AnimatedSprite2D");
|
||||
|
||||
IsPrimed = true;
|
||||
_particles.Emitting = false;
|
||||
_particleTimer = 0;
|
||||
|
||||
if (IsEnabled)
|
||||
{
|
||||
_animatedSprite.Play("Active");
|
||||
}
|
||||
else
|
||||
{
|
||||
_animatedSprite.Play("Default");
|
||||
}
|
||||
}
|
||||
|
||||
public override void _Process(double delta)
|
||||
|
|
@ -60,9 +72,11 @@ public partial class Teleporter : Activable
|
|||
case ActivationType.Enable:
|
||||
// Enables Teleporter
|
||||
IsEnabled = true;
|
||||
_animatedSprite.Play("Active");
|
||||
break;
|
||||
case ActivationType.Disable:
|
||||
IsEnabled = false;
|
||||
_animatedSprite.Play("Default");
|
||||
// Disables Teleporter
|
||||
break;
|
||||
case ActivationType.Use:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue