add initial project files and configurations, including EventBus, systems, and resources
This commit is contained in:
27
Code/UI/LiftProgressBar.cs
Normal file
27
Code/UI/LiftProgressBar.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user