file refactor
This commit is contained in:
parent
da5a3e874b
commit
bffb012a26
175 changed files with 1086 additions and 1107 deletions
22
scripts/particles/StandardParticles.cs
Normal file
22
scripts/particles/StandardParticles.cs
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
using Godot;
|
||||
|
||||
public partial class StandardParticles : Node2D
|
||||
{
|
||||
private int counter = 0;
|
||||
private int counterMax = 0;
|
||||
public override void _Ready()
|
||||
{
|
||||
foreach (GpuParticles2D emitter in GetChildren())
|
||||
{
|
||||
emitter.Emitting = true;
|
||||
counterMax += 1;
|
||||
emitter.Finished += MarkForDestruction;
|
||||
}
|
||||
}
|
||||
public void MarkForDestruction()
|
||||
{
|
||||
if (Engine.IsEditorHint()) return;
|
||||
if (++counter < counterMax) return;
|
||||
QueueFree();
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue