长音符再修复 加入了关卡连接 优化了一些默认加载
This commit is contained in:
@@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user