TriggerDetectorSeries.cs 1.3 KB

123456789101112131415161718192021222324252627282930313233
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. public class TriggerDetectorSeries : MonoBehaviour
  5. {
  6. private void OnTriggerEnter(Collider other)
  7. {
  8. if (other.CompareTag("WristLeft"))
  9. {
  10. //other.GetComponent<Renderer>().material.color = new Color(1, 1, 1);
  11. //other.GetComponent<LineRenderer>().startColor = new Color(1, 1, 1);
  12. //BodySourceView bsv = other.GetComponentInParent<BodySourceView>();
  13. //bsv.wristLeftLate = false;
  14. //Visualizer_FadeInSeries vfi = GetComponentInParent<Visualizer_FadeInSeries>();
  15. //vfi.wristLeftTriggered = true;
  16. // TODO: Destroy visualization step if it is touched (need to test)
  17. Destroy(gameObject.transform.parent);
  18. }
  19. else if (other.CompareTag("WristRight"))
  20. {
  21. //other.GetComponent<Renderer>().material.color = new Color(1, 1, 1);
  22. //other.GetComponent<LineRenderer>().startColor = new Color(1, 1, 1);
  23. //BodySourceView bsv = other.GetComponentInParent<BodySourceView>();
  24. //bsv.wristRightLate = false;
  25. //Visualizer_FadeInSeries vfi = GetComponentInParent<Visualizer_FadeInSeries>();
  26. //vfi.wristRightTriggered = true;
  27. Destroy(gameObject.transform.parent);
  28. }
  29. }
  30. }