25 lines
510 B
C#
25 lines
510 B
C#
|
using Godot;
|
||
|
|
||
|
public class ParticleNode : Node2D
|
||
|
{
|
||
|
private Sprite _spriteNode;
|
||
|
private Label _labelNode;
|
||
|
|
||
|
public int SimulationId;
|
||
|
|
||
|
public override void _Ready()
|
||
|
{
|
||
|
_spriteNode = GetNode<Sprite>("Sprite");
|
||
|
_labelNode = GetNode<Label>("Label");
|
||
|
}
|
||
|
|
||
|
public void SetLabelText(string text)
|
||
|
{
|
||
|
_labelNode.Text = text;
|
||
|
}
|
||
|
|
||
|
public void SetColor(float hue, float saturation)
|
||
|
{
|
||
|
_spriteNode.Modulate = Color.FromHsv(hue, saturation, 1);
|
||
|
}
|
||
|
}
|