Esempio n. 1
0
 public GameObject Spawn(PoolData pool, EScreenEdge screenEdge, float offsetFromScreenEdge = 5.0f)
 {
     return(PoolManager.Spawn(pool, GetRndPosOutsideScreen(screenEdge, offsetFromScreenEdge), Quaternion.identity));
 }
Esempio n. 2
0
 public EnemySpawnInfo(PoolData enemyPool, int pointsRequiredToSpawn)
 {
     EnemyPool             = enemyPool;
     SpawnAmount           = 1;
     PointsRequiredToSpawn = pointsRequiredToSpawn;
 }
Esempio n. 3
0
        public void SpawnAsteroid()
        {
            PoolData asteroidPool = asteroidPools[Random.Range(0, asteroidPools.Length)];

            GameEvents.SignalAsteroidSpawned(Spawn(asteroidPool));
        }
Esempio n. 4
0
 /// <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>();
Esempio n. 5
0
 /// <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>();
Esempio n. 6
0
 /// <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);
Esempio n. 7
0
 /// <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);