public void attackPlayer(int index) { //状态设置为追踪 state[index] = 1; run[index] = PatrolRunAction.GetRunAction(); //以跑步状态进行追踪 this.RunAction(patrols[index].getGameObject(), run[index], this); }
public static PatrolRunAction GetRunAction() { PatrolRunAction run = CreateInstance <PatrolRunAction>(); //追踪对象目标是玩家 run.target = SSDirector.getInstance().currentSceneController.player.getPlayer().transform.position; return(run); }