void Update() { if (Input.GetKeyDown(KeyCode.Space)) { bulletPool.GetObjectFromPool(); } if (Input.GetKeyDown(KeyCode.J)) { ReturnBulletToPool(Selection.activeGameObject.GetComponent <Bullet>()); } }
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); }
public BaseEnemy GetNewEnemy() { return(_enemyPool.GetObjectFromPool()); }
public static TowerBullet GetBullet() { return(_bulletPool.GetObjectFromPool()); }