using System.Collections; using System.Collections.Generic; using UnityEngine; public class TriggerDetector : MonoBehaviour { private void OnTriggerEnter(Collider other) { if (other.CompareTag("WristLeft")) { Debug.Log("WristLeft triggered"); other.GetComponent().material.color = new Color(1, 1, 1); BodySourceView bsv = other.GetComponentInParent(); bsv.wristLeftLate = false; Visualizer_FadeIn vfi = GetComponentInParent(); vfi.wristLeftTriggered = true; } if (other.CompareTag("WristRight")) { Debug.Log("WristRight triggered"); other.GetComponent().material.color = new Color(1, 1, 1); BodySourceView bsv = other.GetComponentInParent(); bsv.wristRightLate = false; Visualizer_FadeIn vfi = GetComponentInParent(); vfi.wristRightTriggered = true; } } }