标签:接口 rri oss control player osi war targe component
1.移动
public override void Act(Transform player, Transform npc) { destPos =player.position; //旋转方向????? Quaternion targetRotation =Quaternion.LookRotation(destPos-npc.position); npc.rotation = Quaternion.Slerp(npc.rotation,targetRotation,Time.deltaTime*curRotSpeed); //移动 CharacterController controller = npc.GetComponent<CharacterController>(); controller.SimpleMove(npc.transform.forward*Time.deltaTime*curSpeed); //播放动画 Animation anim = npc.GetComponent<Animation>(); anim.CrossFade("Run"); }
2.simpleMove受重力影响
3.类引用一个接口
标签:接口 rri oss control player osi war targe component
原文地址:https://www.cnblogs.com/xiaomao21/p/9189147.html