A Blazor/Razor UI component for a leaderboard selection menu. It displays three buttons: High Score, Best Time, and Back, and loads different SceneFile assets when each button is clicked.
@using Sandbox;
@using Sandbox.UI;
@inherits PanelComponent
@namespace Sandbox
<root>
<h2>LeaderBoard Select</h2>
<div class="options">
<div class="button" onclick=@HighScore>
High Score
</div>
<div class="button" onclick=@BestTime>
Best Time
</div>
<div class="button" onclick=@Back>
Back
</div>
</div>
</root>
@code
{
[Property] public SceneFile HSLeaderBoard { get; set; }
[Property] public SceneFile BTLeaderboard { get; set; }
[Property] public SceneFile MainMenu { get; set; }
void HighScore()
{
Scene.Load(HSLeaderBoard);
}
void BestTime()
{
Scene.Load(BTLeaderboard);
}
void Back()
{
Scene.Load(MainMenu);
}
/// <summary>
/// the hash determines if the system should be rebuilt. If it changes, it will be rebuilt
/// </summary>
}