using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Cilpcontrol : MonoBehaviour
{
Animator anim;
// Start is called before the first frame update
void Start()
{
anim = GetComponent<Animator>();
}
// Update is called once per frame
void Update()
{
if (Input.GetKeyDown(KeyCode.A))
{
anim.SetFloat("speed" ,2f);
}
if (Input.GetKeyUp(KeyCode.A))
{
anim.SetFloat("speed", 0f);
}
if (Input.GetKeyDown(KeyCode.D))
{
anim.SetFloat("speed", 2f);
}
if (Input.GetKeyUp(KeyCode.D))
{
anim.SetFloat("speed", 0f);
}
}
}
// cilpControl
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/30718.html
標籤:Unity3D
