You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

46 lines
1018 B

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class anim01 : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
float j = Input.GetAxis("Jump");
if (j > 0.1f)
{
GetComponent<Animator>().SetInteger("Jump", 1);
}
else
{
GetComponent<Animator>().SetInteger("Jump", 0);
}
float h = Input.GetAxis("Horizontal");
Debug.Log(h);
float v = Input.GetAxis("Vertical");
if (v > 0.1f)
{
GetComponent<Animator>().SetFloat("Speed", v);
GetComponent<Animator>().SetFloat("Blend", h);
}
if(Input.GetKeyDown(KeyCode.E)) {
GetComponent<Animator>().SetBool("wave", true);
}
if(Input.GetKeyUp(KeyCode.E))
{
GetComponent<Animator>().SetBool("wave", false);
}
}
}