12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using Valve.VR;
- public class ViveInput : MonoBehaviour
- {
- public PlayerReplay playerReplay;
- private SteamVR_Action_Boolean grabPinch;
- private SteamVR_Action_Boolean grabGrib;
- //private void Awake()
- //{
- // actionBoolean = SteamVR_Actions._default.GrabPinch;
- //}
- //// Start is called before the first frame update
- //void Start()
- //{
- // actionSet.Activate(SteamVR_Input_Sources.Any, 0, true);
- //}
- private void Start()
- {
- grabPinch = SteamVR_Actions.default_GrabPinch;
- grabGrib = SteamVR_Actions.default_GrabGrip;
- }
- // Update is called once per frame
- void Update()
- {
- if (grabPinch.GetStateDown(SteamVR_Input_Sources.Any))
- {
- Debug.Log("grab pinch down");
- playerReplay.Save();
- }
- if (grabGrib.GetStateDown(SteamVR_Input_Sources.Any))
- {
- Debug.Log("grab grib down");
- playerReplay.Load();
- }
- }
- }
|