update
This commit is contained in:
@@ -12,11 +12,16 @@ namespace Ichni.RhythmGame.UI
|
||||
public class GameUICanvas : UIPageBase
|
||||
{
|
||||
public Button pauseButton;
|
||||
|
||||
public TMP_Text difficultyNameText;
|
||||
public TMP_Text difficultyValueText;
|
||||
|
||||
public TMP_Text readyText;
|
||||
public TMP_Text accuracyText;
|
||||
public TMP_Text comboText;
|
||||
|
||||
public Image progressBar;
|
||||
|
||||
public GamePauseInterface pauseInterface;
|
||||
|
||||
[Title("Debug")]
|
||||
@@ -26,16 +31,28 @@ namespace Ichni.RhythmGame.UI
|
||||
{
|
||||
pauseButton.onClick.AddListener(()=>
|
||||
{
|
||||
GameManager.instance.audioManager.songPlayer.PauseSong();
|
||||
pauseButton.interactable = false;
|
||||
pauseInterface.FadeIn(0.5f, true);
|
||||
if (GameManager.instance.audioManager.isPlaying)
|
||||
{
|
||||
GameManager.instance.audioManager.songPlayer.PauseSong();
|
||||
pauseButton.interactable = false;
|
||||
pauseInterface.FadeIn(0.5f, true);
|
||||
}
|
||||
});
|
||||
|
||||
difficultyNameText.text = InformationTransistor.instance.difficulty.difficultyName;
|
||||
difficultyNameText.color = InformationTransistor.instance.difficulty.color / 2f;
|
||||
difficultyValueText.text = InformationTransistor.instance.difficulty.difficultyValue.ToString();
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
fpsText.text = (1.0f / Time.unscaledDeltaTime).ToString("F2");
|
||||
}
|
||||
if (GameManager.instance.audioManager.isPlaying)
|
||||
{
|
||||
float songLength = GameManager.instance.songInformation.songLength;
|
||||
progressBar.fillAmount = songLength > 0 ? GameManager.instance.songTime / songLength : 0f; // 如果歌曲长度为0,填充量为0
|
||||
}
|
||||
}
|
||||
|
||||
public void UpdateAccuracy(float accuracy)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user