-
Notifications
You must be signed in to change notification settings - Fork 0
/
testMonster.cs
47 lines (37 loc) · 1.36 KB
/
testMonster.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class testMonster : MonoBehaviour
{
Animator animationController;
MyInputSystem control;
private void Awake()
{
control = new MyInputSystem();
animationController = transform.GetComponent<Animator>();
control.Test.satu.performed += context => animationController.SetTrigger("attack1"); //1
control.Test.dua.performed += context => animationController.SetTrigger("attack2"); //2
control.Test.tiga.performed += context => animationController.SetTrigger("attack3"); //5
control.Test.getHit.performed += context => animationController.SetTrigger("getHit"); //3
control.Test.die.performed += context => animationController.SetTrigger("die"); //4
control.Test.walk.performed += context => animationController.SetBool("walk", true); //up
control.Test.stop.performed += context => animationController.SetBool("walk", false); //down
}
private void OnEnable()
{
control.Test.Enable();
}
//used for MyInputSystem
private void OnDisable()
{
control.Test.Disable();
}
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
}
}