Files
ichni_Official/Assets/Scripts/Game/UI/SummaryPageCanvas.cs

92 lines
3.2 KiB
C#
Raw Normal View History

2025-07-08 14:28:40 -04:00
using System.Collections;
using System.Collections.Generic;
2025-08-11 14:04:06 -04:00
using I2.Loc;
2025-07-08 14:28:40 -04:00
using UnityEngine;
using Ichni.UI;
using Michsky.MUIP;
using Sirenix.OdinInspector;
using TMPro;
using UnityEngine.UI;
2025-08-11 14:04:06 -04:00
namespace Ichni.RhythmGame
2025-07-08 14:28:40 -04:00
{
public class SummaryPageCanvas : UIPageBase
{
[Title("Song Information")]
public TMP_Text songNameText;
public TMP_Text composerText;
2025-08-11 14:04:06 -04:00
[Title("Illustration")]
public Image illustrationImage;
[Title("Character")]
public Image characterImage;
public TMP_Text characterNameText;
public TMP_Text sentenceText;
[Title("Difficulty")]
2025-07-08 14:28:40 -04:00
public TMP_Text difficultyText;
2025-08-11 14:04:06 -04:00
public TMP_Text levelText;
[Title("ChartInfo")]
public TMP_Text illustratorText;
2025-07-08 14:28:40 -04:00
public TMP_Text chartDesignerText;
2025-08-11 14:04:06 -04:00
public TMP_Text songLengthText;
public TMP_Text bpmText;
[Title("Accuracy")]
public TMP_Text accuracyText;
2025-07-08 14:28:40 -04:00
[Title("Game Records")]
public TMP_Text perfectCountText;
public TMP_Text goodCountText;
public TMP_Text badCountText;
public TMP_Text missCountText;
public TMP_Text maxComboText;
2025-08-11 14:04:06 -04:00
[Title("ResultGraph")]
public ResultGraph resultGraph;
[Title("Return")]
public Button shareButton;
2025-07-08 14:28:40 -04:00
public Button restartButton;
public Button backButton;
2025-07-21 05:42:20 -04:00
public void SetUpSummary()
{
InformationTransistor info = InformationTransistor.instance;
songNameText.text = info.song.songName;
composerText.text = info.song.composer;
2025-08-11 14:04:06 -04:00
illustrationImage.sprite = info.song.illustration;
characterNameText.GetComponent<Localize>().SetTerm("Characters/Soullies");
sentenceText.GetComponent<Localize>().SetTerm("Sentences/Soullies_Summary_Sentence_0");
2025-07-21 05:42:20 -04:00
difficultyText.text = info.difficulty.GetDifficultyName();
2025-08-11 14:04:06 -04:00
levelText.text = info.difficulty.difficultyValue.ToString();
2025-07-21 05:42:20 -04:00
chartDesignerText.text = info.difficulty.charterName;
2025-08-11 14:04:06 -04:00
illustratorText.text = info.song.illustratorName;
songLengthText.text = System.TimeSpan.FromSeconds(info.songLength).ToString(@"m\:ss");
bpmText.text = info.bpm.ToString("F1");
2025-07-21 05:42:20 -04:00
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();
2025-08-11 14:04:06 -04:00
resultGraph.Initialize(recorder.resultData);
2025-07-21 05:42:20 -04:00
restartButton.onClick.RemoveAllListeners();
restartButton.onClick.AddListener(GameManager.RestartGame);
backButton.onClick.RemoveAllListeners();
backButton.onClick.AddListener(GameManager.ReturnToMenu);
}
2025-07-08 14:28:40 -04:00
}
}