Resolve WES-80 "Data"

This commit is contained in:
Helena Van Breugel
2023-03-18 22:32:36 +00:00
parent 8ff5c6c4c8
commit a19d89db03
1092 changed files with 18349 additions and 30118 deletions

View File

@@ -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"));
}
}