Tanoda
HandSwitcher.cs
Go to the documentation of this file.
1using System;
2using System.Collections;
3using System.Collections.Generic;
4using UnityEngine;
6
7public class HandSwitcher : MonoBehaviour
8{
9 public static HandSwitcher instance;
10
11 private void Awake()
12 {
13 instance = this;
14 }
15
16 public UnityEvent OnDefault, OnSkeleton, OnV1, OnV2, OnV3;
17
18 internal void HandSwitcher_Triggered(object sender, Collider e)
19 {
20 if (sender is TriggerRemoteEvent tre)
21 {
22 if (tre.name == "Default")
23 {
24 OnDefault.Invoke();
25 }
26 else if (tre.name == "Skeleton")
27 {
28 OnSkeleton.Invoke();
29 }
30 else if (tre.name == "V1")
31 {
32 OnV1.Invoke();
33 }
34 else if (tre.name == "V2")
35 {
36 OnV2.Invoke();
37 }
38 else if (tre.name == "V3")
39 {
40 OnV3.Invoke();
41 }
42 }
43 }
44}
UnityEvent OnV2
Definition: HandSwitcher.cs:16
UnityEvent OnDefault
Definition: HandSwitcher.cs:16
UnityEvent OnSkeleton
Definition: HandSwitcher.cs:16
UnityEvent OnV3
Definition: HandSwitcher.cs:16
static HandSwitcher instance
Definition: HandSwitcher.cs:9
UnityEvent OnV1
Definition: HandSwitcher.cs:16