using System.Collections; using System.Collections.Generic; using UnityEngine; public class change : MonoBehaviour { private Animator m_Animator = null; // Start is called before the first frame update void Start() { m_Animator = GetComponent(); } // Update is called once per frame void Update() { //if (Input.GetKeyDown(KeyCode.LeftArrow)) //m_Animator.SetInteger("ActionID", 1); //if (Input.GetKeyDown(KeyCode.RightArrow)) // m_Animator.SetInteger("ActionID", 2); if (Input.GetKeyDown(KeyCode.Space) | Input.GetKeyDown(KeyCode.DownArrow)) m_Animator.SetInteger("ID", 1); if (Input.GetKeyUp(KeyCode.Space) | Input.GetKeyUp(KeyCode.DownArrow)) m_Animator.SetInteger("ID", 0); } }