Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections.Generic;
- using UnityEngine;
- [CreateAssetMenu(fileName = "Dictionary", menuName = "Dictionary")]
- public class WordDictionary : ScriptableObject
- {
- public LayerStructure[] Layers;
- public List<Dictionary<string, string[]>> Layer = new List<Dictionary<string, string[]>>();
- public void Init()
- {
- Layer.Clear();
- foreach (var layer in Layers)
- {
- layer.FillDictionary();
- Layer.Add(layer.Words);
- }
- }
- [System.Serializable]
- public struct LayerStructure
- {
- public WordStructure[] Vocabular;
- public Dictionary<string, string[]> Words;
- public Dictionary<string, string[]> FillDictionary()
- {
- Words = new Dictionary<string, string[]>();
- foreach (var word in Vocabular) Words.Add(word.Key, word.Words);
- return Words;
- }
- }
- [System.Serializable]
- public struct WordStructure
- {
- public string Key;
- public string[] Words;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement