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();
        }
    }
}
