private void ApplyForceToBall()
 {
     if (!ballController.BallModel.IsMoving)
     {
         ballController.ApplyForceToBall(transform.forward, aiModel.Force * Random.Range(0.0f, 1.0f));
     }
 }
Exemplo n.º 2
0
        private void ApplyForceToBall()
        {
            if (Input.GetKeyUp(KeyCode.Space))
            {
                if (IsAnyBallMoving() || rewindController.IsRewinding)
                {
                    return;
                }

                ballController.ApplyForceToBall(transform.forward, playerModel.Force * pressedTimeReference.Value);

                if (audioController != null)
                {
                    audioController.PlaySwingQueueClip(pressedTimeReference.Value);
                }

                shotsReference.Value++;
                pressedTimeReference.Value = 0;

                playerSwingQueue.Raise();
            }
        }