using UnityEngine; using System.Collections; public class AttackState : FSMState { public AttackState() { stateID = FSMStateID.Attacking; } public override void Reason(Transform player, Transform npc) { if (npc.GetComponent<AIController>().stateInfo
1:添加unity自带的第一人称角色控制器,命名为hreo 2:添加第三人称角色控制器.这里是添加源文件Sources下面的.如箭头指示:而不是“3rd Person Controller”.并命名为NPC.并设置预设,和加上BOX碰撞器.产生多个NPC.结构图: 3:修改hreo自带的Mouse Look脚本 using UnityEngine; using System.Collections; /// MouseLook rotates the transform based on the