- 最后登录
- 2017-5-15
- 注册时间
- 2012-3-1
- 阅读权限
- 90
- 积分
- 32973
- 纳金币
- 32806
- 精华
- 12
|
var oldman_:GameObject;
var***n_Speed_:float=3.0;
var rotate_Speed_:float=3.0;
function Start()
{
oldman_=GameObject.Find("oldman");
var common***n_=animation["common***n"];
common***n_.layer=1;
common***n_.wrapMode=WrapMode.Loop;
}
function Update () {
var cc_ : CharacterController = GetComponent(CharacterController);
cc_.SimpleMove(transform.TransformDirection(Vector3.forward)***n_Speed_*Input.GetAxis("Vertical"));
cc_.transform.Rotate(0,Input.GetAxis("Horizontal")*rotate_Speed_,0);
}
复制代码
另外ad是位移的:
protected Vector3 move = Vector3.zero;
public float moveSpeed=3f;
protected CharacterController control;
control = GetComponent<CharacterController> ();
move =new Vector3(Input.GetAxis("Horizontal"),0,Input.GetAxis("Vertical"));
control.SimpleMove (move*moveSpeed); |
|