45 lines
1.2 KiB
C#
45 lines
1.2 KiB
C#
using UnityEngine;
|
|
|
|
/// <summary>
|
|
/// ThemeSelectionScreen scene manager
|
|
/// </summary>
|
|
public class ThemeSelectionScreen : MonoBehaviour
|
|
{
|
|
/// <summary>
|
|
/// Theme prefab
|
|
/// </summary>
|
|
public GameObject themePrefab;
|
|
|
|
/// <summary>
|
|
/// Reference to container holding all theme-buttons
|
|
/// </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()
|
|
{
|
|
Minigame minigame = minigameList.minigames[minigameList.currentMinigameIndex];
|
|
ThemeList themeList = minigame.themeList;
|
|
|
|
for (int i = 0; i < themeList.themes.Count; i++)
|
|
{
|
|
Theme theme = themeList.themes[i];
|
|
|
|
// First, you need to create a new button game object
|
|
GameObject instance = GameObject.Instantiate(themePrefab, themesContainer);
|
|
|
|
// Dynamically load appearance
|
|
ThemeItem item = instance.GetComponent<ThemeItem>();
|
|
item.theme = theme;
|
|
//item.startGameCallback = () => OnButtonClick(theme.name);
|
|
}
|
|
}
|
|
}
|