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