8,304
社区成员
发帖
与我相关
我的任务
分享
[RPC] // 告诉UNITY这是一个远程方法
void PlayState(string animName)
{
animation.CrossFade(animName, 0.2f);
}
void Update () {
float h = Input.GetAxis("Horizontal"); // 取得水平轴的值
float v = Input.GetAxis("Vertical"); // 取得垂直轴的值
if (Mathf.Abs(h) > 0.1f || Mathf.Abs(v) > 0.05f)
{
networkView.RPC("PlayState", RPCMode.All, "Walk");
}
}