长音符再修复 加入了关卡连接 优化了一些默认加载

This commit is contained in:
FloatGaming
2026-01-13 11:22:39 +08:00
parent 2738089af1
commit 2f9d4aae0c
426 changed files with 299413 additions and 1050 deletions
+24
View File
@@ -113,5 +113,29 @@ public class loadDlcListPrefab : MonoBehaviour
if (b != null)
b.ResolveDlcData();
}
// Restore last selected DLC button from PlayerPrefs and simulate a click on it
int savedIndex = PlayerPrefs.GetInt("dlc_selected_index", 0);
if (allButtons != null && allButtons.Length > 0)
{
if (savedIndex < 0) savedIndex = 0;
if (savedIndex >= allButtons.Length) savedIndex = 0;
var savedBtn = allButtons[savedIndex];
if (savedBtn != null)
{
// simulate a user clicking the button: this will Select() and display its songs
savedBtn.OnButtonClicked_ShowSongs();
Debug.Log($"loadDlcListPrefab: restored and clicked saved dlc button index={savedIndex} name={savedBtn.gameObject.name}");
}
else
{
Debug.LogWarning($"loadDlcListPrefab: saved dlc button at index {savedIndex} was null");
}
}
else
{
Debug.LogWarning("loadDlcListPrefab: no dlc buttons found after RefreshUI");
}
}
}