修复了选曲的问题 优化了ui

This commit is contained in:
FloatGaming
2026-01-08 21:04:36 +08:00
parent e7f4ac72d5
commit 2738089af1
414 changed files with 60357 additions and 5279 deletions
+84
View File
@@ -0,0 +1,84 @@
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.SceneManagement;
public class selected_songInfo : MonoBehaviour
{
public Image t_songCoverImage;
public Image btm_songCoverImage;
public Text songNameText;
[Header("")]
public List<Button> difficultyButtons = new List<Button>();
[Header("enter detail page")]
public Button enterDetailPageButton;
void Start()
{
if (enterDetailPageButton != null)
{
enterDetailPageButton.onClick.AddListener(OnEnterDetailPageClicked);
}
UpdateSelectedSongDisplay();
}
public void UpdateSelectedSongDisplay()
{
if (SongDataHolder.SelectedSongData != null)
{
var song = SongDataHolder.SelectedSongData;
if (t_songCoverImage != null && song.right_pic_top_image != null)
{
t_songCoverImage.sprite = song.right_pic_top_image;
t_songCoverImage.enabled = true;
}
else
{
t_songCoverImage.enabled = false;
}
if (btm_songCoverImage != null && song.right_pic_bottom_image != null)
{
btm_songCoverImage.sprite = song.right_pic_bottom_image;
btm_songCoverImage.enabled = true;
}
else
{
btm_songCoverImage.enabled = false;
}
if (songNameText != null)
{
songNameText.text = song.songName;
}
}
else
{
// Clear display if no song selected
if (t_songCoverImage != null)
{
t_songCoverImage.sprite = null;
t_songCoverImage.enabled = false;
}
if (btm_songCoverImage != null)
{
btm_songCoverImage.sprite = null;
btm_songCoverImage.enabled = false;
}
if (songNameText != null)
{
songNameText.text = "δѡÔñ¸èÇú";
}
}
}
private void OnEnterDetailPageClicked()
{
if (SongDataHolder.SelectedSongData != null)
{
SceneManager.LoadScene("Songs_Select");
}
else
{
Debug.LogWarning("No song selected, cannot enter detail page.");
}
}
}