using UnityEngine; using UnityEngine.UI; public class VRChooseHand : MonoBehaviour { public bool leftHand; public Toggle toggle; private void OnEnable() { if (toggle == null) { toggle = GetComponent(); } if ((bool)GlobalSettings.Instance && leftHand == VRControllersManager.Instance.IsLeftHanded()) { toggle.isOn = true; } } public void ValueChanged() { if (toggle.isOn) { if (leftHand != VRControllersManager.Instance.IsLeftHanded()) { VRControllersManager.Instance.SetLeftHanded(leftHand); } VRManager.Instance.pointerInputParent.GetComponent().SetActiveController(leftHand ? OVRInput.Controller.LTouch : OVRInput.Controller.RTouch); } } }