u3d的動作legacy模式,經測試得出
using UnityEngine; using System.Collections; public class AnimateCon : MonoBehaviour { // Use this for initialization void Start () { } // Update is called once per frame void Update () { if (Input.GetKeyDown(KeyCode.A)) { animation.Play("Wait"); Debug.Log("key a"); } if (Input.GetKeyDown(KeyCode.B)) { animation.Play("right"); Debug.Log("key b"); } if (Input.GetKeyDown(KeyCode.C)) { animation.Play("left"); Debug.Log("key c"); } if (Input.GetKeyDown(KeyCode.D)) { animation.Stop(); } } }
1.在播放動作a的時候,你按下鍵,還是播放a,如果此時a動作沒播放結束,那么繼續播放a動作,既不起反應
2.在播放動作a的時候,你按下鍵,播放b動作,那么此時,結束動作a的播放,開始播放b動作
3.在播放動作a的時候,你按鍵發送animation.Stop();,那么此時 ,a動作不管有沒有播放完,立即停在按鍵的那一時刻,擺個pos