protected override void OnClear() { if (Connection.GetInstance().isHost) { VRChairSDK.GetInstance().Dispose(); } Global.instance.RemoveUpdateFunction(UpdateInput); }
protected override void OnInit() { if (Connection.GetInstance().isHost) { VRChairSDK.GetInstance().Init(); VRChairSDK.GetInstance().RegisterBtnChangeCallback(onBtnDown); } model = InputController.instance.GetModel <InputModel>(InputModel.name); Global.instance.AddUpdateFunction(UpdateInput); }
// Use this for initialization void Start() { VRChairSDK.GetInstance().Init(); VRChairSDK.GetInstance().RegisterBtnChangeCallback(OnBtnEvent); recv.text = "no data input.."; sliderArray[0].onValueChanged.AddListener(SetRX); sliderArray[1].onValueChanged.AddListener(SetDY); sliderArray[2].onValueChanged.AddListener(SetRZ); sliderArray[3].onValueChanged.AddListener(SetAttitudeY); sliderArray[4].onValueChanged.AddListener(SetAttitudeX); sliderArray[5].onValueChanged.AddListener(SetAttitudeZ); sliderArray[6].onValueChanged.AddListener(OnAxIndex); sliderArray[7].onValueChanged.AddListener(OnAxValue); SetAttitudeBtn.onClick.AddListener(SetAttitude); fanToggle.onValueChanged.AddListener(OnFanToggle); }
/// <summary> /// 风扇 /// </summary> public void OnFanToggle(bool isOpen) { VRChairSDK.GetInstance().SetFan(isOpen); }
public void SetAttitude() { VRChairSDK.GetInstance().SetAttitude(attitudeVector3.x, attitudeVector3.y, attitudeVector3.z); }
public void SetRZ(float value) { VRChairSDK.GetInstance().SetRZ(value); SetSliderValue(2); }
public void OnAxValue(float value) { this.ax_value = value; SetSliderValue(7); VRChairSDK.GetInstance().SetAx(this.ax_index, this.ax_value); }