public static T Spawn <T>() where T : class, IComponentBase, new() { var key = WorldUtilities.GetKey <T>(); var obj = (T)PoolRegistries.Spawn_INTERNAL(key); if (obj != null) { return(obj); } return(PoolInternalBase.Create <T>()); }
public static StructRegistryBase Spawn <T>() where T : struct, IStructComponent { var key = WorldUtilities.GetAllComponentTypeId <T>(); var obj = (StructComponents <T>)PoolRegistries.Spawn_INTERNAL(key, out var pool); if (obj != null) { return(obj); } return(PoolInternalBase.Create <StructComponents <T> >(pool)); }
public static object Spawn(System.Type type) { var key = WorldUtilities.GetKey(type); return(PoolRegistries.Spawn_INTERNAL(key)); }