UI换了很多,spine主视觉停用
This commit is contained in:
@@ -212,14 +212,14 @@ public class SongDetailsUI : MonoBehaviour
|
||||
if (charterNameText != null) charterNameText.text = song.level_creator;
|
||||
if (dlcNameText != null) dlcNameText.text = song.belongsTo_whichDLC;
|
||||
if (songSerialNumberText != null) songSerialNumberText.text = song.songID.ToString();
|
||||
if (bpmText != null) bpmText.text = "BPM : " + song.bpm.ToString();
|
||||
if (bpmText != null) bpmText.text = LocalizationService.GetFormat("song.details.bpm", song.bpm);
|
||||
if (profound_image != null) profound_image.sprite = song.fullscreen_songPicture;
|
||||
if (timeSpentText != null) timeSpentText.text = "PlayTime: " + song.time_totalPlayingTime.ToString("F0") + "s";
|
||||
if (enterTimeText != null) enterTimeText.text = "PlayCount: " + song.game_enterTimes.ToString();
|
||||
if (timeSpentText != null) timeSpentText.text = LocalizationService.GetFormat("song.details.play_time", song.time_totalPlayingTime.ToString("F0"));
|
||||
if (enterTimeText != null) enterTimeText.text = LocalizationService.GetFormat("song.details.play_count", song.game_enterTimes);
|
||||
if (detail_informations_text != null)
|
||||
{
|
||||
detail_informations_text.text =
|
||||
$"{song.artistName} - {song.songName} | 曲绘: {song.painter} | 制谱: {song.level_creator} | DLC: {song.belongsTo_whichDLC}";
|
||||
detail_informations_text.text = LocalizationService.GetFormat("song.details.information",
|
||||
song.artistName, song.songName, song.painter, song.level_creator, song.belongsTo_whichDLC);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -261,19 +261,15 @@ public class SongDetailsUI : MonoBehaviour
|
||||
dlcNameText.text = currentSong.belongsTo_whichDLC;
|
||||
songSerialNumberText.text = currentSong.songID.ToString();
|
||||
|
||||
bpmText.text = "BPM : " + currentSong.bpm.ToString();
|
||||
bpmText.text = LocalizationService.GetFormat("song.details.bpm", currentSong.bpm);
|
||||
profound_image.sprite = currentSong.fullscreen_songPicture;
|
||||
|
||||
if (timeSpentText != null) timeSpentText.text = "PlayTime: " + currentSong.time_totalPlayingTime.ToString("F0") + "s";
|
||||
if (enterTimeText != null) enterTimeText.text = "PlayCount: " + currentSong.game_enterTimes.ToString();
|
||||
if (timeSpentText != null) timeSpentText.text = LocalizationService.GetFormat("song.details.play_time", currentSong.time_totalPlayingTime.ToString("F0"));
|
||||
if (enterTimeText != null) enterTimeText.text = LocalizationService.GetFormat("song.details.play_count", currentSong.game_enterTimes);
|
||||
|
||||
id_of_thisSong = currentSong.songID;
|
||||
detail_informations_text.text =
|
||||
$"{currentSong.artistName}" + " - " +
|
||||
$"{currentSong.songName}" + " | " +
|
||||
$"曲绘: {currentSong.painter}" + " | " +
|
||||
$"制谱: {currentSong.level_creator}" + " | " +
|
||||
$"DLC: {currentSong.belongsTo_whichDLC}";
|
||||
detail_informations_text.text = LocalizationService.GetFormat("song.details.information",
|
||||
currentSong.artistName, currentSong.songName, currentSong.painter, currentSong.level_creator, currentSong.belongsTo_whichDLC);
|
||||
if (currentSong.illustration != null)
|
||||
{
|
||||
//songImage.sprite = currentSong.illustration;
|
||||
@@ -281,7 +277,7 @@ public class SongDetailsUI : MonoBehaviour
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogWarning("歌曲封面为空:" + currentSong.songName);
|
||||
Debug.LogWarning(LocalizationService.GetFormat("song.details.no_song_cover", currentSong.songName));
|
||||
}
|
||||
|
||||
Debug.Log("加载歌曲数据: " + currentSong.songName);
|
||||
@@ -388,6 +384,7 @@ public class SongDetailsUI : MonoBehaviour
|
||||
|
||||
spawnedAskInstance = Instantiate(askTemplate, ResolveRoomSpawnParent(), false);
|
||||
PrepareSpawnedPanel(spawnedAskInstance);
|
||||
RegisterManagedOverlay(spawnedAskInstance, DestroyAskInstance);
|
||||
|
||||
roomAsk ask = spawnedAskInstance.GetComponent<roomAsk>();
|
||||
if (ask == null)
|
||||
@@ -440,6 +437,7 @@ public class SongDetailsUI : MonoBehaviour
|
||||
{
|
||||
existing.ConfigureRoomRanking(roomRankingPrefab, ResolveRoomSpawnParent());
|
||||
existing.Bind(roomService);
|
||||
RegisterManagedOverlay(spawnedRoomDetailsInstance, DestroyRoomDetailsInstance);
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -453,6 +451,7 @@ public class SongDetailsUI : MonoBehaviour
|
||||
|
||||
spawnedRoomDetailsInstance = Instantiate(roomTemplate, ResolveRoomSpawnParent(), false);
|
||||
PrepareSpawnedPanel(spawnedRoomDetailsInstance);
|
||||
RegisterManagedOverlay(spawnedRoomDetailsInstance, DestroyRoomDetailsInstance);
|
||||
|
||||
roomDetails details = spawnedRoomDetailsInstance.GetComponent<roomDetails>();
|
||||
if (details == null)
|
||||
@@ -469,6 +468,7 @@ public class SongDetailsUI : MonoBehaviour
|
||||
{
|
||||
if (spawnedAskInstance != null)
|
||||
{
|
||||
UIBackStack.Unregister(spawnedAskInstance);
|
||||
Destroy(spawnedAskInstance);
|
||||
spawnedAskInstance = null;
|
||||
}
|
||||
@@ -478,6 +478,7 @@ public class SongDetailsUI : MonoBehaviour
|
||||
{
|
||||
if (spawnedRoomDetailsInstance != null)
|
||||
{
|
||||
UIBackStack.Unregister(spawnedRoomDetailsInstance);
|
||||
Destroy(spawnedRoomDetailsInstance);
|
||||
spawnedRoomDetailsInstance = null;
|
||||
}
|
||||
@@ -559,6 +560,23 @@ public class SongDetailsUI : MonoBehaviour
|
||||
}
|
||||
}
|
||||
|
||||
private void RegisterManagedOverlay(GameObject panel, Action closeAction)
|
||||
{
|
||||
if (panel == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
UIBackStack.RegisterOrBump(
|
||||
panel,
|
||||
() => panel != null && panel.activeInHierarchy,
|
||||
() =>
|
||||
{
|
||||
closeAction?.Invoke();
|
||||
return true;
|
||||
});
|
||||
}
|
||||
|
||||
private Button FindButtonByName(string objectName)
|
||||
{
|
||||
Button[] buttons = Resources.FindObjectsOfTypeAll<Button>();
|
||||
|
||||
Reference in New Issue
Block a user