Platformer example started

This commit is contained in:
ThomasCharester committed 2026-02-22 13:59:04 +03:00
1 parent efcfaae647
commit 9f026b76d6
325 files changed
+23540 -270

No files matched your search

@@ -0,0 +1,40 @@
using System;
using System.Collections.Generic;
using Code.Infrastructure.UI;
using DG.Tweening;
using TMPro;
using UnityEngine;
using UnityEngine.UI;
namespace Code.Example.Race.UI
{
public class PlayerScores : UIPanel
{
[SerializeField] private Image image;
[SerializeField] private TMP_Text scoreText;
[SerializeField] private Color shownColor;
[SerializeField] private Color hiddenColor;
public void SetText(List<RaceData> scores)
{
scoreText.text = "";
foreach (var score in scores)
{
var t = TimeSpan.FromSeconds(score.raceTimeSeconds);
scoreText.text += $@"{score.place} место за {t:mm\:ss\:fff}\n";
}
}
public override void Open(Action callback = null)
{
image.DOColor(shownColor, 1f);
scoreText.DOColor(shownColor, 1f).onComplete = () => callback?.Invoke();
}
public override void Close(Action callback = null)
{
image.DOColor(hiddenColor, 1f);
scoreText.DOColor(hiddenColor, 1f).onComplete = () => callback?.Invoke();
}
}
}