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