Browse Source

destroy visualization step if it is touched

Kenkart 2 years ago
parent
commit
57c5b2a09e
1 changed files with 6 additions and 0 deletions
  1. 6 0
      Assets/Scripts/TriggerDetector.cs

+ 6 - 0
Assets/Scripts/TriggerDetector.cs

@@ -16,6 +16,10 @@ public class TriggerDetector : MonoBehaviour
             bsv.wristLeftLate = false;
             Visualizer_FadeIn vfi = GetComponentInParent<Visualizer_FadeIn>();
             vfi.wristLeftTriggered = true;
+
+            // TODO: Destroy visualization step if it is touched (need to test)
+            Destroy(gameObject.transform.parent);
+
         } else if (other.CompareTag("WristRight"))
         {
             other.GetComponent<Renderer>().material.color = new Color(1, 1, 1);
@@ -24,6 +28,8 @@ public class TriggerDetector : MonoBehaviour
             bsv.wristRightLate = false;
             Visualizer_FadeIn vfi = GetComponentInParent<Visualizer_FadeIn>();
             vfi.wristRightTriggered = true;
+
+            Destroy(gameObject.transform.parent);
         }
     }
 }