Particles system
This commit is contained in:
parent
30266b36cf
commit
0e5dee50f7
46 changed files with 643 additions and 200 deletions
|
|
@ -1,4 +1,5 @@
|
|||
using Godot;
|
||||
using Newlon.Components.Level;
|
||||
using Newlon.Systems.Effects;
|
||||
|
||||
namespace Newlon.Components;
|
||||
|
|
@ -17,6 +18,8 @@ public partial class LinearProjectile : Area2D, IProjectile
|
|||
private Effect _impactEffect;
|
||||
[Export]
|
||||
private Utility.DamageTypes _damageType = Utility.DamageTypes.PHYSICAL;
|
||||
[Export]
|
||||
private PackedScene particles;
|
||||
private int _line;
|
||||
private bool used = false;
|
||||
public int Line { get => _line; set { _line = value; } }
|
||||
|
|
@ -37,6 +40,9 @@ public partial class LinearProjectile : Area2D, IProjectile
|
|||
used = true;
|
||||
if (entity is IEffectHandler effectHandler && _impactEffect != null)
|
||||
effectHandler.GiveEffect(_impactEffect);
|
||||
|
||||
PoolContainer.Instance.SpawnParticles(particles, GlobalPosition);
|
||||
|
||||
QueueFree();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue