using System.Collections; using System.Collections.Generic; using UnityEngine; public class AnimControl : MonoBehaviour { public GameObject goHuman; Animator aniHuman; // Use this for initialization void Start () { aniHuman = goHuman.GetComponent(); } // Update is called once per frame void Update() { if (Input.GetKey("0")) { aniHuman.SetFloat("speed", 0); } if (Input.GetKey("1")) { aniHuman.SetFloat("speed", 1); } if (Input.GetKey("2")) { aniHuman.SetFloat("speed", 2); } } }