TriggerDetectorSeries.cs 508 B

12345678910111213141516171819
  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. // Destroy visualization step if it is touched
  11. Destroy(gameObject.transform.parent.gameObject);
  12. }
  13. else if (other.CompareTag("WristRight"))
  14. {
  15. Destroy(gameObject.transform.parent.gameObject);
  16. }
  17. }
  18. }