Ejemplo n.º 1
0
        public static T Spawn <T>() where T : class, IComponentBase, new()
        {
            var key = WorldUtilities.GetKey <T>();
            var obj = (T)PoolComponents.Spawn_INTERNAL(key);

            if (obj != null)
            {
                return(obj);
            }

            return(PoolInternalBase.Create <T>());
        }
Ejemplo n.º 2
0
        public static object Spawn(System.Type type)
        {
            var key      = WorldUtilities.GetKey(type);
            var instance = PoolComponents.Spawn_INTERNAL(type, key, out var pool);

            if (instance == null)
            {
                instance = (IComponent)System.Activator.CreateInstance(type);
                PoolInternalBase.CallOnSpawn(instance, pool);
            }

            return(instance);
        }
Ejemplo n.º 3
0
        public static object Spawn(System.Type type)
        {
            var key = WorldUtilities.GetKey(type);

            return(PoolComponents.Spawn_INTERNAL(key));
        }