123456789101112131415161718192021222324252627282930313233343536373839 |
- 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 SteamVR_Action_Boolean teleport;
- private void Start()
- {
- grabPinch = SteamVR_Actions.default_GrabPinch;
- grabGrib = SteamVR_Actions.default_GrabGrip;
- teleport = SteamVR_Actions.default_Teleport;
- }
- // Update is called once per frame
- void Update()
- {
- if (grabPinch.GetStateDown(SteamVR_Input_Sources.Any))
- {
- playerReplay.AddJoints();
- }
- if (teleport.GetStateDown(SteamVR_Input_Sources.Any))
- {
- playerReplay.Save();
- }
- if (grabGrib.GetStateDown(SteamVR_Input_Sources.Any))
- {
- playerReplay.Load();
- }
- }
- }
|