// UpdateSpeedAndRotationMultiplier void UpdateSpeedAndRotationScaleMultiplier() { float moveScaleMultiplier = 0.0f; PlayerController.GetMoveScaleMultiplier(ref moveScaleMultiplier); if (Input.GetKeyDown(KeyCode.Alpha7)) { moveScaleMultiplier -= SpeedRotationIncrement; } else if (Input.GetKeyDown(KeyCode.Alpha8)) { moveScaleMultiplier += SpeedRotationIncrement; } PlayerController.SetMoveScaleMultiplier(moveScaleMultiplier); float rotationScaleMultiplier = 0.0f; PlayerController.GetRotationScaleMultiplier(ref rotationScaleMultiplier); if (Input.GetKeyDown(KeyCode.Alpha9)) { rotationScaleMultiplier -= SpeedRotationIncrement; } else if (Input.GetKeyDown(KeyCode.Alpha0)) { rotationScaleMultiplier += SpeedRotationIncrement; } PlayerController.SetRotationScaleMultiplier(rotationScaleMultiplier); if (ShowVRVars == true) // limit gc { strSpeedRotationMultipler = System.String.Format("Spd.X: {0:F2} Rot.X: {1:F2}", moveScaleMultiplier, rotationScaleMultiplier); } }
void Update() { if (OVRInput.GetDown(OVRInput.Button.PrimaryIndexTrigger)) { controller.Jump(); } if (OVRInput.Get(OVRInput.Button.SecondaryIndexTrigger) && allowDoubleXSpeed) { controller.SetMoveScaleMultiplier(moveSpeedMultiplier * 2.0f); } else { controller.SetMoveScaleMultiplier(moveSpeedMultiplier); } if (OVRInput.GetDown(OVRInput.Button.One) && on) { light.SetActive(false); on = false; } else if (OVRInput.GetDown(OVRInput.Button.One) && !on) { light.SetActive(true); on = true; } }
/// <summary> /// Updates the speed and rotation scale multiplier. /// </summary> void UpdateSpeedAndRotationScaleMultiplier() { float moveScaleMultiplier = 0.0f; playerController.GetMoveScaleMultiplier(ref moveScaleMultiplier); if (Input.GetKeyDown(KeyCode.Alpha7)) { moveScaleMultiplier -= speedRotationIncrement; } else if (Input.GetKeyDown(KeyCode.Alpha8)) { moveScaleMultiplier += speedRotationIncrement; } playerController.SetMoveScaleMultiplier(moveScaleMultiplier); float rotationScaleMultiplier = 0.0f; playerController.GetRotationScaleMultiplier(ref rotationScaleMultiplier); if (Input.GetKeyDown(KeyCode.Alpha9)) { rotationScaleMultiplier -= speedRotationIncrement; } else if (Input.GetKeyDown(KeyCode.Alpha0)) { rotationScaleMultiplier += speedRotationIncrement; } playerController.SetRotationScaleMultiplier(rotationScaleMultiplier); }
void Update() { if (OVRInput.GetDown(OVRInput.Button.PrimaryIndexTrigger)) { controller.Jump(); } if (OVRInput.Get(OVRInput.Button.SecondaryIndexTrigger) && allowDoubleXSpeed) { controller.SetMoveScaleMultiplier(moveSpeedMultiplier * 2.0f); } else { controller.SetMoveScaleMultiplier(moveSpeedMultiplier); } }
//[SerializeField] //public GameObject highScoretxt; //public int highScore; //public int score; void Start() { controller = GetComponent <OVRPlayerController>(); controller.SetMoveScaleMultiplier(moveSpeedMultiplier); moveForward = new Vector3(transform.position.x, transform.position.y, transform.position.z + Zincrement); transform.position = Vector3.MoveTowards(transform.position, moveForward, speed * Time.deltaTime); }
// Update is called once per frame void Update() { moveForward = new Vector3(transform.position.x, transform.position.y, transform.position.z + Zincrement); transform.position = Vector3.MoveTowards(transform.position, moveForward, speed * Time.deltaTime); if (OVRInput.GetDown(OVRInput.Button.PrimaryIndexTrigger)) { controller.Jump(); } if (OVRInput.Get(OVRInput.Button.SecondaryIndexTrigger) && allowDoubleSpeed) { controller.SetMoveScaleMultiplier(moveSpeedMultiplier * 2.0f); } else { controller.SetMoveScaleMultiplier(moveSpeedMultiplier); } //score++; }
void Start() { controller = GetComponent<OVRPlayerController>(); controller.SetMoveScaleMultiplier(moveSpeedMultiplier); }