mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-07 09:25:55 +00:00
Bullet resource
This commit is contained in:
parent
76221ca7a6
commit
07f6e58ebd
19 changed files with 236 additions and 50 deletions
27
Scripts/Components/AutodeleteParticle.cs
Normal file
27
Scripts/Components/AutodeleteParticle.cs
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
using Godot;
|
||||
|
||||
namespace Cirno.Scripts.Components;
|
||||
|
||||
public partial class AutodeleteParticle : GpuParticles2D
|
||||
{
|
||||
|
||||
[Export]
|
||||
public double LifeTime { get; private set; }
|
||||
|
||||
private double _timer = 0;
|
||||
|
||||
public void Init()
|
||||
{
|
||||
this.Emitting = true;
|
||||
}
|
||||
|
||||
public override void _Process(double delta)
|
||||
{
|
||||
_timer += delta;
|
||||
|
||||
if (_timer >= LifeTime || this.Emitting == false)
|
||||
{
|
||||
QueueFree();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -91,6 +91,7 @@ public class BulletInfo
|
|||
//public double Time { get; set; }
|
||||
public float Spread { get; set; }
|
||||
public PackedScene BulletScene { get; set; }
|
||||
public PackedScene DestructionParticlesScene { get; set; }
|
||||
public IBulletModifier Modifier { get; set; }
|
||||
public List<TimeModifier> TimeModifiers { get; set; } = new List<TimeModifier>();
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue