#pragma warning restore 0649

    public static IEnumerable <Adjective> Load(string filename)
    {
        string jsonStr = File.ReadAllText(filename);

        AdjectiveLoader loader = JsonUtility.FromJson <AdjectiveLoader>(jsonStr);

        for (int i = 0; i < loader.adjectives.Length; i++)
        {
            yield return(CreateAdjective(loader.adjectives[i]));
        }
    }
 public static void LoadAdjectivesFile(string filename)
 {
     foreach (Adjective adjective in AdjectiveLoader.Load(filename))
     {
         if (Adjectives.ContainsKey(adjective.Id))
         {
             Adjectives[adjective.Id] = adjective;
         }
         else
         {
             Adjectives.Add(adjective.Id, adjective);
         }
     }
 }
Beispiel #3
0
 private void Awake()
 {
     Instance = this;
 }