public GameObject Spawn(PoolData pool, EScreenEdge screenEdge, float offsetFromScreenEdge = 5.0f) { return(PoolManager.Spawn(pool, GetRndPosOutsideScreen(screenEdge, offsetFromScreenEdge), Quaternion.identity)); }
public EnemySpawnInfo(PoolData enemyPool, int pointsRequiredToSpawn) { EnemyPool = enemyPool; SpawnAmount = 1; PointsRequiredToSpawn = pointsRequiredToSpawn; }
public void SpawnAsteroid() { PoolData asteroidPool = asteroidPools[Random.Range(0, asteroidPools.Length)]; GameEvents.SignalAsteroidSpawned(Spawn(asteroidPool)); }
/// <summary> /// Spawns a gameobject from the specified pool. This will use GetComponent() to get the wanted component. /// </summary> /// <param name="poolData">The pool to spawn from.</param> /// <param name="parent">The transform to make the spawned object a child of.</param> /// <typeparam name="T">Which component to return.</typeparam> /// <returns>The component of type <typeparamref name="T"/> from the gameobject that was spawned from the pool.</returns> public static T Spawn <T>(PoolData poolData, Transform parent) where T : Object => Instance.GetPool(poolData).Spawn(parent).GetComponent <T>();
/// <summary> /// Spawns a gameobject from the specified pool. This will use GetComponent() to get the wanted component. /// </summary> /// <param name="poolData">The pool to spawn from.</param> /// <param name="position">The position to place the gameobject at.</param> /// <param name="rotation">The rotation to place the gameobject on.</param> /// <typeparam name="T">Which component to return.</typeparam> /// <returns>The component of type <typeparamref name="T"/> from the gameobject that was spawned from the pool.</returns> public static T Spawn <T>(PoolData poolData, Vector3 position, Quaternion rotation) where T : Object => Instance.GetPool(poolData).Spawn(position, rotation).GetComponent <T>();
/// <summary> /// Spawns a gameobject from the specified pool. /// </summary> /// <param name="poolData">The pool to spawn from.</param> /// <param name="parent">The transform to make the spawned object a child of.</param> /// <returns>The gameobject that was spawned from the pool.</returns> public static GameObject Spawn(PoolData poolData, Transform parent) => Instance.GetPool(poolData).Spawn(parent);
/// <summary> /// Spawns a gameobject from the specified pool. /// </summary> /// <param name="poolData">The pool to spawn from.</param> /// <param name="position">The position to place the gameobject at.</param> /// <param name="rotation">The rotation to place the gameobject on.</param> /// <returns>The gameobject that was spawned from the pool.</returns> public static GameObject Spawn(PoolData poolData, Vector3 position, Quaternion rotation) => Instance.GetPool(poolData).Spawn(position, rotation);