Пример #1
0
        void endThrow(ButtonClick click)
        {
            if (click.button == EasyInputConstants.CONTROLLER_BUTTON.GearVRTrigger && !preventThrowAgain)
            {
                //reset the motion variables
                EasyInputHelper.resetMotion();
                throwInProcess    = false;
                preventThrowAgain = true;
                temp               = transform.position;
                temp.y             = .5f;
                transform.position = temp;

                //here we do the throw after some sanity checks
                myRigidbody.AddRelativeForce(currentThrow, ForceMode.Impulse);
                myRigidbody.AddRelativeTorque(currentTorque, ForceMode.Impulse);


                //the sudden drop of the ball makes it want to bounce off the alley prevent this in the rigidbody
                temp   = myRigidbody.velocity;
                temp.y = 0f;
                myRigidbody.velocity = temp;

                //start clock to reset the scene
                Invoke("resetScene", 8f);
            }
        }
Пример #2
0
 void localClickStart(ButtonClick click)
 {
     if (click.button == EasyInputConstants.CONTROLLER_BUTTON.AButton)
     {
         EasyInputHelper.resetMotion();
     }
 }
Пример #3
0
 void localClickStart(ButtonClick button)
 {
     if (button.button == EasyInputConstants.CONTROLLER_BUTTON.GearVRTrigger)
     {
         EasyInputHelper.resetMotion();
     }
 }
Пример #4
0
 void initiateThrow(ButtonClick click)
 {
     if (click.button == EasyInputConstants.CONTROLLER_BUTTON.GearVRTrigger && !preventThrowAgain)
     {
         //reset the motion variables
         EasyInputHelper.resetMotion();
         throwInProcess = true;
         follow.stopFollow();
     }
 }