TriggerDetector.cs 961 B

123456789101112131415161718192021222324252627
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. public class TriggerDetector : 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_FadeIn vfi = GetComponentInParent<Visualizer_FadeIn>();
  14. vfi.wristLeftTriggered = true;
  15. } else if (other.CompareTag("WristRight"))
  16. {
  17. other.GetComponent<Renderer>().material.color = new Color(1, 1, 1);
  18. BodySourceView bsv = other.GetComponentInParent<BodySourceView>();
  19. bsv.wristRightLate = false;
  20. Visualizer_FadeIn vfi = GetComponentInParent<Visualizer_FadeIn>();
  21. vfi.wristRightTriggered = true;
  22. }
  23. }
  24. }