internal static void ScanAssembly(Assembly assembly) { foreach (Type t in assembly.GetTypes()) { EntityComponent.TryRegister(t); BehaviorTreeNodeFactory.TryRegister(t); } }
internal static void ScanAssembly(Assembly assembly) { var registeredTypes = new List <Type>(); foreach (Type t in assembly.GetTypes()) { if (typeof(EntityComponent).IsAssignableFrom(t) && t != typeof(object) && t.Assembly == assembly && !registeredTypes.Contains(t)) { RegisterComponent(t, ref registeredTypes); } if (typeof(BehaviorTreeNodeBase).IsAssignableFrom(t) && !t.IsAbstract) { BehaviorTreeNodeFactory.TryRegister(t); } } }