1using System.Collections;
2using System.Collections.Generic;
5using Valve.VR.InteractionSystem;
10 private List<ThrowableCanDisable> tcds =
new List<ThrowableCanDisable>();
14 StartCoroutine(SlowUpdate());
17 private void OnDisable()
21 IEnumerator SlowUpdate()
25 yield
return new WaitForSeconds(0.5f);
29 foreach (var item
in tcds)
31 var interactable = item.interactable;
33 if (interactable.attachedToHand !=
null)
43 private void OnTriggerEnter(Collider other)
50 var interactable = other.GetComponentInParent<Interactable>();
52 if (interactable && tcd)
54 if (interactable.attachedToHand !=
null)
57 if (!tcds.Contains(tcd)) tcds.Add(tcd);
62 private void OnTriggerExit(Collider other)
68 var interactable = other.GetComponentInParent<Interactable>();
70 if (interactable && tcd)
72 if (interactable.attachedToHand !=
null)
75 if (!tcds.Contains(tcd)) tcds.Add(tcd);
80 private void OnTriggerStay(Collider other)
86 var interactable = other.GetComponentInParent<Interactable>();
88 if (interactable && tcd)
90 if (interactable.attachedToHand !=
null)
93 if (!tcds.Contains(tcd)) tcds.Add(tcd);