Example #1
0
 private void Update()
 {
     // Aimed throw
     if (
         mStateMachine.GetState() == PlayerStateMachine.PlayerState.Throw &&
         Input.GetButtonDown("Fire3"))
     {
         mThrowVector = (mCameraController.GetCameraThrowLookAt().position - mCameraController.GetCameraThrowPosition().position).normalized * mThrowStrength;
         Throw(
             mCameraController.GetCameraThrowPosition().position,
             mThrowVector,
             true);
     }
     // Free throw
     else if (
         mStateMachine.GetState() == PlayerStateMachine.PlayerState.Walk &&
         Input.GetButtonDown("Fire3"))
     {
         mThrowVector = (mCameraController.GetCameraFreeThrowLookAt().position - mCameraController.GetCameraFreeThrowPosition().position).normalized * mThrowStrength;
         Throw(
             mCameraController.GetCameraFreeThrowPosition().position,
             mThrowVector,
             true);
     }
 }