Beispiel #1
0
 private void OnDestroyAllBalls()
 {
     transform.position = new Vector3(PoolBalls.NextPosition(), transform.position.y, transform.position.z);
     countBalls++;
     countBallsOnCurrentShoot = countBalls;
     canShoot = true;
 }
Beispiel #2
0
 private void InstantiateBall()
 {
     canShoot      = false;
     timeNextShoot = Time.time + coolDown;
     countBallsOnCurrentShoot--;
     if (PoolBalls.CountInactive() == 0)
     {
         GameObject newBall = Instantiate(ball, transform.position, transform.rotation);
         PoolBalls.Add(newBall);
     }
     else
     {
         PoolBalls.ActiveNext(transform.position, transform.rotation);
     }
 }
Beispiel #3
0
 private void DestroyBullet()
 {
     PoolBalls.Inactivate(gameObject);
 }