void Update()
    {
        if (Input.GetKeyDown(KeyCode.Space))
        {
            bulletPool.GetObjectFromPool();
        }

        if (Input.GetKeyDown(KeyCode.J))
        {
            ReturnBulletToPool(Selection.activeGameObject.GetComponent <Bullet>());
        }
    }
예제 #2
0
        public static BaseTower GetTowerToBuild(TowerType towerType)
        {
            BaseTower result = null;

            switch (towerType)
            {
            case TowerType.Tower1:
                result = _tower1Pool.GetObjectFromPool();
                break;

            case TowerType.Tower2:
                result = _tower2Pool.GetObjectFromPool();
                break;

            case TowerType.Tower3:
                result = _tower3Pool.GetObjectFromPool();
                break;

            default:
                result = _tower1Pool.GetObjectFromPool();
                break;
            }
            return(result);
        }
예제 #3
0
 public BaseEnemy GetNewEnemy()
 {
     return(_enemyPool.GetObjectFromPool());
 }
예제 #4
0
 public static TowerBullet GetBullet()
 {
     return(_bulletPool.GetObjectFromPool());
 }