Resolve WES-43 "Minigame framework"
This commit is contained in:
@@ -4,13 +4,15 @@ using UnityEngine;
|
||||
|
||||
// JSON structure containing all themes/words
|
||||
[System.Serializable]
|
||||
public class ThemeList {
|
||||
public class ThemeList
|
||||
{
|
||||
public Theme[] themes;
|
||||
}
|
||||
|
||||
// Object representing part of the JSON containing word data
|
||||
[System.Serializable]
|
||||
public class Theme {
|
||||
public class Theme
|
||||
{
|
||||
public string name;
|
||||
public string description;
|
||||
public string[] words;
|
||||
@@ -19,7 +21,8 @@ public class Theme {
|
||||
public class ThemeLoader : MonoBehaviour
|
||||
{
|
||||
// Loads the JSON file containing all of the themes
|
||||
public static ThemeList loadJson() {
|
||||
public static ThemeList LoadJson()
|
||||
{
|
||||
TextAsset themeJson = Resources.Load<TextAsset>("SpellingBee/words");
|
||||
return JsonUtility.FromJson<ThemeList>(themeJson.text);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user