u3d animation運用明細


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

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM