Files
MovementTests/player_controller/PlayerUi.cs
Minimata 0b0163a0ac
All checks were successful
Create tag and build when new code gets to main / BumpTag (push) Successful in 18s
Create tag and build when new code gets to main / Export (push) Successful in 5m43s
finally managed to pin down the in game UI and control issues for keyboard
2025-11-14 12:32:03 +01:00

27 lines
621 B
C#

using Godot;
using System;
public partial class PlayerUi : Control
{
private TextureRect[] _dashIcons = new TextureRect[3];
public override void _Ready()
{
base._Ready();
_dashIcons[0] = GetNode<TextureRect>("%Dash1");
_dashIcons[1] = GetNode<TextureRect>("%Dash2");
_dashIcons[2] = GetNode<TextureRect>("%Dash3");
}
public void SetNumberOfDashesLeft(int numberOfDashes)
{
int index = 1;
foreach (var dashIcon in _dashIcons)
{
dashIcon.SetVisible(index <= numberOfDashes);
index++;
}
}
}