27 lines
496 B
C#
27 lines
496 B
C#
using Godot;
|
|
using MaxEffort.Code.Core;
|
|
|
|
namespace MaxEffort.Code.UI;
|
|
|
|
[GlobalClass]
|
|
public partial class LiftProgressBar : ProgressBar
|
|
{
|
|
public override void _Ready()
|
|
{
|
|
EventBus.OnLiftProgress += UpdateProgress;
|
|
|
|
MinValue = 0;
|
|
MaxValue = 1;
|
|
Value = 0;
|
|
}
|
|
|
|
public override void _ExitTree()
|
|
{
|
|
EventBus.OnLiftProgress -= UpdateProgress;
|
|
}
|
|
|
|
private void UpdateProgress(float progress)
|
|
{
|
|
Value = progress;
|
|
}
|
|
} |