TriggerDetectorSeries.cs 993 B

1234567891011121314151617181920212223242526
  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. BodySourceView bsv = other.GetComponentInParent<BodySourceView>();
  12. bsv.wristLeftLate = false;
  13. Visualizer_FadeInSeries vfi = GetComponentInParent<Visualizer_FadeInSeries>();
  14. vfi.wristLeftTriggered = true;
  15. }
  16. else if (other.CompareTag("WristRight"))
  17. {
  18. other.GetComponent<Renderer>().material.color = new Color(1, 1, 1);
  19. BodySourceView bsv = other.GetComponentInParent<BodySourceView>();
  20. bsv.wristRightLate = false;
  21. Visualizer_FadeInSeries vfi = GetComponentInParent<Visualizer_FadeInSeries>();
  22. vfi.wristRightTriggered = true;
  23. }
  24. }
  25. }