Tanoda
SimpleHandAnimHelper.cs
Go to the documentation of this file.
1using System.Collections;
2using System.Collections.Generic;
3using NaughtyAttributes;
4using UnityEngine;
5
6[RequireComponent(typeof(Animator))]
7public class SimpleHandAnimHelper : MonoBehaviour
8{
9
10 [Button]
11 public void SetAnimPinch()
12 {
13 StopAllCoroutines();
14 GetComponent<Animator>().enabled = true;
15 GetComponent<Animator>().SetTrigger("pinch");
16 }
17
18 [Button]
19 public void SetAnimFist()
20 {
21 StopAllCoroutines();
22 GetComponent<Animator>().enabled = true;
23 GetComponent<Animator>().SetTrigger("fist");
24 }
25
26 [Button]
27 public void SetAnimIdle()
28 {
29 GetComponent<Animator>().SetTrigger("idle");
30 StartCoroutine(DelayedAnimOff());
31 }
32
33 IEnumerator DelayedAnimOff()
34 {
35 GetComponent<Animator>().enabled = true;
36 GetComponent<Animator>().SetTrigger("idle");
37 yield return new WaitForSeconds(0.6f);
38 GetComponent<Animator>().enabled = false;
39 }
40
41 [Button]
42 public void SetScrewdriver()
43 {
44 StopAllCoroutines();
45 GetComponent<Animator>().enabled = true;
46 GetComponent<Animator>().SetTrigger("screwdriver");
47 }
48
49 [Button]
50 public void SetSeegerPlier()
51 {
52 StopAllCoroutines();
53 GetComponent<Animator>().enabled = true;
54 GetComponent<Animator>().SetTrigger("seegerPlier");
55 }
56}
UnityEngine.UI.Button Button
Definition: Pointer.cs:7