問題描述
在用 組件,調(diào)用 播動(dòng)畫,
使用 Play( , [.(“-1”)] int layer, [.(“float.”)] float ) 函數(shù)時(shí)最新qq空間動(dòng)畫代碼怎么用,
出現(xiàn)了 does not have an 報(bào)錯(cuò)。
報(bào)錯(cuò)翻譯過來是 動(dòng)畫沒有動(dòng)畫控制器最新qq空間動(dòng)畫代碼怎么用,但我加了 組件。
下面是原代碼:
player.Play(animNma, 0, 0.01f);
player.SetFloat("speed", 1.0f);
方法一:
百度之后,找到一個(gè)方法,是設(shè)置 上的物體是顯示狀態(tài)。但我是了沒用。
下面是這個(gè)方法的代碼。
if (anim.gameObject.activeself){
anim.Play("fire");
}
方法二:
使用函數(shù),刷新那個(gè)時(shí)間的動(dòng)畫。示例代碼如下
player. Update(0);
player.Play(animNma, 0, 1.0f/ ReadFile.one.timeAll+0.01f);
player.SetFloat("speed", 1.0f);
函數(shù)的定義:
//
// 摘要:
// Evaluates the animator based on deltaTime.
//
// 參數(shù):
// deltaTime:
// The time delta.
[NativeMethod("UpdateWithDelta")]
public void Update(float deltaTime);
是指的你要播的動(dòng)畫。