纳金网
标题:
控制3d max 人物模型动作全过程_代码
[打印本页]
作者:
她。
时间:
2012-6-1 14:32
标题:
控制3d max 人物模型动作全过程_代码
脚本如下:
var gameobj:GameObject;
function Update () {
gameobj=GameObject.Find("laotaitai");
if(Input.GetKey(KeyCode.W))
{
gameobj.transform.Translate(Vector3.forward*Time.deltaTime*2);
animation.Play("***n");
}
else if(Input.GetKey(KeyCode.S))
{
gameobj.transform.Translate(Vector3.forward*Time.deltaTime*-2);
animation.Play("***n");
}
else if(Input.GetKey(KeyCode.A))
{
gameobj.transform.Rotate(Vector3.up*Time.deltaTime*-60);
animation.Play("***n");
}
else if(Input.GetKey(KeyCode.D))
{
gameobj.transform.Rotate(Vector3.up*Time.deltaTime*60);
animation.Play("***n");
}
//there is no animation,please playing "idle"
if(!animation.isPlaying)
{
animation.Play("idle");
}
// key "downArrow"
if(Input.GetKey(KeyCode.DownArrow))
{
//animation.CrossFade("fight");
animation.Play("fight",PlayMode.StopSameLayer);
}
}
欢迎光临 纳金网 (http://old.narkii.com/club/)
Powered by Discuz! X2.5