Browse Source

Update ViveInput.cs

Kenkart 2 years ago
parent
commit
14a867e229
1 changed files with 13 additions and 7 deletions
  1. 13 7
      Assets/Scripts/ViveInput.cs

+ 13 - 7
Assets/Scripts/ViveInput.cs

@@ -27,17 +27,23 @@ public class ViveInput : MonoBehaviour
     {
         if (grabPinch.GetStateDown(SteamVR_Input_Sources.Any))
         {
-            Debug.Log("Recording...");
-            isRecording = true;
+            
         }
 
         if (teleport.GetStateDown(SteamVR_Input_Sources.Any))
         {
-            Debug.Log("Saving...");
-            isRecording = false;
-            recordingTime = 0;
-            playerReplay.Save();
-            playerReplay.ResetRecording();
+            if (!isRecording)
+            {
+                Debug.Log("Recording...");
+                isRecording = true;
+            } else
+            {
+                Debug.Log("Saving...");
+                isRecording = false;
+                recordingTime = 0;
+                playerReplay.Save();
+                playerReplay.ResetRecording();
+            }
         }
 
         if (grabGrib.GetStateDown(SteamVR_Input_Sources.Any))