mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-09 15:35:53 +00:00
Teleporter visualizer
This commit is contained in:
parent
ba481a5914
commit
1a8e88f719
6 changed files with 78 additions and 17 deletions
|
|
@ -8,6 +8,7 @@ using GTweensGodot.Extensions;
|
|||
|
||||
namespace Cirno.Scripts.Activables;
|
||||
|
||||
[Tool]
|
||||
public partial class Teleporter : Activable
|
||||
{
|
||||
[Export]
|
||||
|
|
@ -41,30 +42,25 @@ public partial class Teleporter : Activable
|
|||
|
||||
public override void _Ready()
|
||||
{
|
||||
_particles = GetNode<GpuParticles2D>("./Particles");
|
||||
_animatedSprite = GetNode<AnimatedSprite2D>("AnimatedSprite2D");
|
||||
|
||||
_animatedSprite.Play(IsEnabled ? "Active" : "Default");
|
||||
if (Engine.IsEditorHint()) return;
|
||||
|
||||
_particles = GetNode<GpuParticles2D>("./Particles");
|
||||
|
||||
IsPrimed = true;
|
||||
_particles.Emitting = false;
|
||||
_particleTimer = 0;
|
||||
|
||||
this.Visible = !Invisible;
|
||||
|
||||
if (IsEnabled)
|
||||
{
|
||||
_animatedSprite.Play("Active");
|
||||
}
|
||||
else
|
||||
{
|
||||
_animatedSprite.Play("Default");
|
||||
}
|
||||
|
||||
|
||||
_teleportStartSound = GetNodeOrNull<AudioStreamPlayer2D>("TeleportStart");
|
||||
_teleportEndSound = GetNodeOrNull<AudioStreamPlayer2D>("TeleportEnd");
|
||||
}
|
||||
|
||||
public override void _Process(double delta)
|
||||
{
|
||||
if (Engine.IsEditorHint()) return;
|
||||
if (!_particles.Emitting) return;
|
||||
|
||||
_particleTimer += delta;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue