TriggerDetectorSeries.cs 1.1 KB

12345678910111213141516171819202122232425262728
  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. }
  17. else if (other.CompareTag("WristRight"))
  18. {
  19. other.GetComponent<Renderer>().material.color = new Color(1, 1, 1);
  20. other.GetComponent<LineRenderer>().startColor = new Color(1, 1, 1);
  21. BodySourceView bsv = other.GetComponentInParent<BodySourceView>();
  22. bsv.wristRightLate = false;
  23. Visualizer_FadeInSeries vfi = GetComponentInParent<Visualizer_FadeInSeries>();
  24. vfi.wristRightTriggered = true;
  25. }
  26. }
  27. }