Example #1
0
 /// <summary>
 /// Pre-loads our pools
 /// </summary>
 private void PreloadPools()
 {
     // Loop through all items we want to pre-load
     foreach (PoolItemInfo poolItemInfo in PoolItemsToPreload)
     {
         // Preload the item
         Pooling.Preload(poolItemInfo.PoolItem, poolItemInfo.PreloadQuantity);
     }
 }
Example #2
0
 // Use this for initialization
 void Start()
 {
     paused          = false;
     playerDead      = false;
     timer           = 0;
     pop             = 0;
     currentWave     = 1;
     currentWaveSize = initialWaveSize;
     Pooling.Preload(knight, 5);
     Pooling.Preload(ogre, 5);
     Pooling.Preload(glider, 5);
 }
Example #3
0
    // Use this for initialization
    void Start()
    {
        gamePaused  = false;
        gameStarted = false;
        view.Init();

        //Initialize the pool
        obstaclePool.OnPoolingReady += OnObstaclePoolingFinished;
        birdPool.OnPoolingReady     += OnBirdPoolingFinished;

        StartCoroutine(obstaclePool.Preload(obstacleNB));
        StartCoroutine(birdPool.Preload(obstacleNB));
    }
Example #4
0
    void Start()
    {
        shotSpawnPos     = shotSpawn.transform.position;
        gameStateManager = GameObject.FindGameObjectWithTag("GameController").GetComponent <GameStateManager> ();

        Physics2D.IgnoreLayerCollision(gameObject.layer, LayerMask.NameToLayer("Shot"));
        //Ignores the shot layer so the player doesn't get pushed around by the shots
        paused = false;

        mainCam = Camera.main;

        for (int i = 0; i < 3; i++)
        {
            Pooling.Preload(Shots [i], 20);
        }
        //temp
        Pooling.Preload(Shots [4], 20);
        Pooling.Preload(Shots [5], 20);
        Pooling.Preload(Stalags, 20);
        Pooling.Preload(Shots [9], 20);
        Pooling.Preload(Lavas, 20);
    }