浏览代码

Update PlayerReplay.cs

Kenkart 2 年之前
父节点
当前提交
e2a9479838
共有 1 个文件被更改,包括 3 次插入2 次删除
  1. 3 2
      Assets/Scripts/PlayerReplay.cs

+ 3 - 2
Assets/Scripts/PlayerReplay.cs

@@ -297,11 +297,12 @@ public class PlayerReplay : MonoBehaviour
                 bc.endStepsPressed = false;
             }
 
+            // TODO: maybe need to check if body is null or not (after 6 seconds body is destroyed, destroy a destroyed gameobject error?)
+            Destroy(body);
+
             // Wait for input
             yield return ViveInput.WaitForControllerPress();
 
-            Destroy(body);
-
             if (finish)
                 break;
         }