Esempio n. 1
0
 /// <summary>
 /// Creates an instance of a ball object and gives it an initial velocity.
 /// </summary>
 public void CreateBall()
 {
     if (currentNumberOfBalls < maxNumberOfBalls)
     {
         Rigidbody newBallInstance = ballManager.CreateNewBall(fireTransform.position, fireTransform.rotation);
         newBallInstance.velocity = ballSpeed * fireTransform.forward;
     }
 }
Esempio n. 2
0
 /// <summary>
 /// Creates an instance of a ball object and gives it an initial velocity
 /// </summary>
 void CreateBall()
 {
     if ((currentNumberOfBalls < maxNumberOfBalls) && (isPlayerWithinRange == true) && (playerHealth.currentHealth > 0))
     {
         Rigidbody newBallInstance = ballManager.CreateNewBall(fireTransform.position, fireTransform.rotation);
         newBallInstance.velocity = ballSpeed * fireTransform.forward;
         BallStates ballStateInstance = newBallInstance.gameObject.GetComponent <BallStates>();
         ballStateInstance.ChangeBallState(2);
     }
 }