particles/Particle.cs

22 lines
418 B
C#
Raw Normal View History

2021-12-26 15:56:57 -05:00
using Godot;
public class Particle : Node2D
{
private float _spriteHue;
private Sprite _spriteNode;
public float Hue
{
get => _spriteHue;
set
{
_spriteHue = Mathf.Clamp(value, 0, 1);
_spriteNode.Modulate = Color.FromHsv(_spriteHue, 1, 1);
}
}
public override void _Ready()
{
_spriteNode = GetNode<Sprite>("Sprite");
}
}