Esempio n. 1
0
 private void GetRuleGenerators()
 {
     Type[] types = ReflectionHelper.FindTypes("AbstractRuleGenerator");
     foreach (Type type in types)
     {
         if (_ruleGeneratorTypes.Add(type))
         {
             try
             {
                 List <Type>      seenTypes = new List <Type>();
                 ModRuleGenerator generator;
                 do
                 {
                     generator = ModRuleGenerator.GetRuleGenerator(type.Assembly, seenTypes);
                     if (generator != null)
                     {
                         _modRuleGenerators.Add(generator);
                     }
                 } while (generator != null);
             }
             catch (Exception ex)
             {
                 UnityEngine.Debug.LogFormat("Could not generate rules using the provided AbstractRuleGenerator due to an Exception:\n{0}\n{1}", ex.Message, ex.StackTrace);
             }
         }
     }
 }
Esempio n. 2
0
 private void GetRuleGenerators()
 {
     Type[] types = ReflectionHelper.FindTypes("AbstractRuleGenerator");
     foreach (Type type in types)
     {
         if (_ruleGeneratorTypes.Add(type))
         {
             try
             {
                 _modRuleGenerators.Add(ModRuleGenerator.GetRuleGenerator(type.Assembly));
             }
             catch (Exception ex)
             {
                 UnityEngine.Debug.LogFormat("Could not generate rules using the provided AbstractRuleGenerator due to an Exception:\n{0}\n{1}", ex.Message, ex.StackTrace);
             }
         }
     }
 }