game(scripts): refmt

This commit is contained in:
Mark Joshwel 2024-08-15 16:28:52 +08:00
parent 72596f0b07
commit c7242dbe58
2 changed files with 5 additions and 5 deletions

View file

@ -462,21 +462,21 @@ public void ClearInteractionPrompt()
public void ProperlyEndRun() public void ProperlyEndRun()
{ {
SetDisplayState(DisplayState.OverlayCompleteUnderTimeMenu); SetDisplayState(DisplayState.OverlayCompleteUnderTimeMenu);
var ui = guiCompletedMenuObject.GetComponent<UIDocument>()?.rootVisualElement; var ui = guiCompletedMenuObject.GetComponent<UIDocument>()?.rootVisualElement;
var timeLabel = ui.Q<Label>("FinalTimeLabel"); var timeLabel = ui.Q<Label>("FinalTimeLabel");
var timeScore = ui.Q<Label>("FinalScoreLabel"); var timeScore = ui.Q<Label>("FinalScoreLabel");
var timeGrade = ui.Q<Label>("FinalGradeLabel"); var timeGrade = ui.Q<Label>("FinalGradeLabel");
// calculate a score between 0-1000 and grade (S, A, B, C, D) // calculate a score between 0-1000 and grade (S, A, B, C, D)
// if you finish the run in 2.5 minutes, you get a 1000 // if you finish the run in 2.5 minutes, you get a 1000
// from 2.5 to 5 minutes, the score goes down to 0 // from 2.5 to 5 minutes, the score goes down to 0
// scoring parameters // scoring parameters
const float maxScore = 1000f; const float maxScore = 1000f;
const float maxTimeForMaxScore = 15f; // 2.5 minutes const float maxTimeForMaxScore = 15f; // 2.5 minutes
const float maxTimeForMinScore = 180f; // 5 minutes const float maxTimeForMinScore = 180f; // 5 minutes
var score = _elapsedRunTime switch var score = _elapsedRunTime switch
{ {
<= maxTimeForMaxScore => maxScore, <= maxTimeForMaxScore => maxScore,

View file

@ -46,7 +46,7 @@ public class LiftController : MonoBehaviour
/// the target position of the lift /// the target position of the lift
/// </summary> /// </summary>
private Vector3 _target; private Vector3 _target;
/// <summary> /// <summary>
/// initialisation function /// initialisation function