Exemple #1
0
 internal static void ScanAssembly(Assembly assembly)
 {
     foreach (Type t in assembly.GetTypes())
     {
         EntityComponent.TryRegister(t);
         BehaviorTreeNodeFactory.TryRegister(t);
     }
 }
Exemple #2
0
        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);
                }
            }
        }