Resolve WES-80 "Data"
This commit is contained in:
@@ -15,15 +15,20 @@ public class ThemeSelectionScreen : MonoBehaviour
|
||||
/// </summary>
|
||||
public Transform themesContainer;
|
||||
|
||||
/// <summary>
|
||||
/// Reference to the minigamelist
|
||||
/// </summary>
|
||||
public MinigameList minigameList;
|
||||
|
||||
/// <summary>
|
||||
/// Start is called before the first frame update
|
||||
/// </summary>
|
||||
void Start()
|
||||
{
|
||||
// TODO: change to ScriptableObject
|
||||
ThemeList themeList = ThemeLoader.LoadJson();
|
||||
Minigame minigame = minigameList.minigames[minigameList.currentMinigameIndex];
|
||||
ThemeList themeList = minigame.themeList;
|
||||
|
||||
for (int i = 0; i < themeList.themes.Length; i++)
|
||||
for (int i = 0; i < themeList.themes.Count; i++)
|
||||
{
|
||||
Theme theme = themeList.themes[i];
|
||||
|
||||
@@ -32,19 +37,8 @@ public class ThemeSelectionScreen : MonoBehaviour
|
||||
|
||||
// Dynamically load appearance
|
||||
ThemeItem item = instance.GetComponent<ThemeItem>();
|
||||
item.themeTitle = theme.name;
|
||||
item.themeDescription = theme.description;
|
||||
item.startGameCallback = () => OnButtonClick(theme.name);
|
||||
item.theme = theme;
|
||||
//item.startGameCallback = () => OnButtonClick(theme.name);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Load the game with a specified theme
|
||||
/// </summary>
|
||||
/// <param name="clickedTheme">Name of the clicked theme</param>
|
||||
public void OnButtonClick(string clickedTheme)
|
||||
{
|
||||
PlayerPrefs.SetString("themeName", clickedTheme);
|
||||
SystemController.GetInstance().SwapScene(PlayerPrefs.GetString("gamePath"));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user