Files
ichni_Official/Assets/Scripts/GameUI/SummaryPageCanvas.cs
SoulliesOfficial 7580c4d87c 大更
2026-03-14 03:13:10 -04:00

92 lines
3.2 KiB
C#

using System.Collections;
using System.Collections.Generic;
using I2.Loc;
using UnityEngine;
using Ichni.UI;
using Michsky.MUIP;
using Sirenix.OdinInspector;
using TMPro;
using UnityEngine.UI;
namespace Ichni.RhythmGame
{
public class SummaryPageCanvas : UIPageBase
{
[Title("Song Information")]
public TMP_Text songNameText;
public TMP_Text composerText;
[Title("Illustration")]
public Image illustrationImage;
[Title("Character")]
public Image characterImage;
public TMP_Text characterNameText;
public TMP_Text sentenceText;
[Title("Difficulty")]
public TMP_Text difficultyText;
public TMP_Text levelText;
[Title("ChartInfo")]
public TMP_Text illustratorText;
public TMP_Text chartDesignerText;
public TMP_Text songLengthText;
public TMP_Text bpmText;
[Title("Accuracy")]
public TMP_Text accuracyText;
[Title("Game Records")]
public TMP_Text perfectCountText;
public TMP_Text goodCountText;
public TMP_Text badCountText;
public TMP_Text missCountText;
public TMP_Text maxComboText;
[Title("ResultGraph")]
public ResultGraph resultGraph;
[Title("Return")]
public Button shareButton;
public Button restartButton;
public Button backButton;
public void SetUpSummary()
{
InformationTransistor info = InformationTransistor.instance;
songNameText.text = info.song.songName;
composerText.text = info.song.composer;
illustrationImage.sprite = info.song.illustration;
characterNameText.GetComponent<Localize>().SetTerm("Characters/Soullies");
sentenceText.GetComponent<Localize>().SetTerm("Sentences/Soullies_Summary_Sentence_0");
difficultyText.text = info.difficulty.GetDifficultyName();
levelText.text = info.difficulty.difficultyValue.ToString();
chartDesignerText.text = info.difficulty.charterName;
illustratorText.text = info.song.illustratorName;
songLengthText.text = System.TimeSpan.FromSeconds(info.songLength).ToString(@"m\:ss");
bpmText.text = info.bpm.ToString("F1");
PlayingRecorder recorder = GameManager.Instance.playingRecorder;
perfectCountText.text = recorder.perfectCount.ToString();
goodCountText.text = recorder.goodCount.ToString();
badCountText.text = recorder.badCount.ToString();
missCountText.text = recorder.missCount.ToString();
accuracyText.text = recorder.accuracy.ToString("F2") + "%";
maxComboText.text = recorder.maxCombo.ToString();
resultGraph.Initialize(recorder.resultData);
restartButton.onClick.RemoveAllListeners();
restartButton.onClick.AddListener(GameManager.RestartGame);
backButton.onClick.RemoveAllListeners();
backButton.onClick.AddListener(GameManager.ReturnToMenu);
}
}
}