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); } }
void localClickStart(ButtonClick click) { if (click.button == EasyInputConstants.CONTROLLER_BUTTON.AButton) { EasyInputHelper.resetMotion(); } }
void localClickStart(ButtonClick button) { if (button.button == EasyInputConstants.CONTROLLER_BUTTON.GearVRTrigger) { EasyInputHelper.resetMotion(); } }
void initiateThrow(ButtonClick click) { if (click.button == EasyInputConstants.CONTROLLER_BUTTON.GearVRTrigger && !preventThrowAgain) { //reset the motion variables EasyInputHelper.resetMotion(); throwInProcess = true; follow.stopFollow(); } }