void OnMouseUp()
 {
     if (canShoot && !Pause.Paused)
     {
         shootSound.Play();
         SS.Shoot(shootPower);
         canShoot = false;
     }
 }
Exemple #2
0
 private void ProcessAimingPhaseInput(Vector2 positionInWorldSpace, TouchPhase touchPhase)
 {
     // While the player is holding down the button/finger, update slingshot ball position
     if (touchPhase == TouchPhase.Moved)
     {
         slingshot.Aim(positionInWorldSpace);
     }
     else
     {
         // Shoot the ball when player releases button
         if (touchPhase == TouchPhase.Ended)
         {
             slingshot.Shoot();
             state = States.ballReleased;
         }
     }
 }