12345678910111213141516171819202122232425 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using Valve.VR;
- public class ViveBikeController : MonoBehaviour
- {
- public SteamVR_Action_Pose steerPose;
- public float multiplier = 40f;
- private BicycleController bicycleController;
-
- // Start is called before the first frame update
- void Start()
- {
- bicycleController = GetComponent<BicycleController>();
- }
- // Update is called once per frame
- void Update()
- {
- var rot = steerPose.localRotation.y;
- bicycleController.CurrentSteerAngle = rot * multiplier;
- }
- }
|