Tanoda
TriggerActionHelper.cs
Go to the documentation of this file.
1using System.Collections;
2using System.Collections.Generic;
3using NaughtyAttributes;
4using UnityEngine;
5#if !UNITY_WEBGL
6using ViveHandTracking;
7#endif
8
9public class TriggerActionHelper : MonoBehaviour
10{
11 [ReadOnly]
12 [SerializeField]
13 private TriggerAction ta;
14
15 public void SetTAParent(TriggerAction ta)
16 {
17 this.ta = ta;
18 }
19
20 private void OnTriggerEnter(Collider other)
21 {
23 //if (other.name.Contains("driver") || other.name.Contains("Just"))
24 //{
25 // return;
26 //}
27 //
28 //if (GameObject.Find("fake_csavarozas") || GameObject.Find("fake_csavarozas (1)"))
29 //{
30 // return;
31 //}
33#if !UNITY_WEBGL
34 if (!other.GetComponentInParent<HackedHand>())
35 {
36 return;
37 }
38
39 //if (other.GetComponentInParent<ModelRenderer>()?.statusLed?.activeSelf != true)
40 //{
41 // return;
42 //}
43#endif
44 if (ta)
45 {
46 ta.TriggerNow();
47 }
48 }
49
50 [Button]
51 private void DoTriggerNow()
52 {
53 ta.TriggerNow();
54 }
55}
UnityEngine.UI.Button Button
Definition: Pointer.cs:7
void SetTAParent(TriggerAction ta)