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); } } } }
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); } } } }