protected void OnArrived(Message msg) { var _msg = (MessageArrived)msg; var entity = (this.fsmCtr as FSMMachineVisitor).ownerEntity; //自己的entity if (_msg.followPath.ownerEntity.entityID != entity.entityID) { return; } //到达终点, 游客消失,地上游客地上发车,地下游客地下发车,广告游客什么车都不发 if (_msg.followPath.isArrivedEnd) { if (entity.entityFuncType == (int)EntityFuncType.Visitor_From_Car) { DebugFile.GetInstance().WriteKeyFile("FromUnder_", "{0}", entity.entityID); MessageManager.GetInstance().Send((int)GameMessageDefine.SpawnVisitorCarLeaveZoo); } else if (entity.entityFuncType == (int)EntityFuncType.Visitor_From_GroundParking) { MessageGroundParkingSpace.Send((int)GameMessageDefine.BroadcastLetGroundParingCarLeave, entity.groundParkingGroupID, entity.groundParkingIdx); } // 回POOL EntityManager.GetInstance().RemoveFromEntityMovables(entity); } }
public override void Enter(int preStateName) { base.Enter(preStateName); var follow = (this.fsmCtr as FSMFollowPathSuperMarketSimply).owner; var entity = follow.ownerEntity as EntityGroundParkingCar; entity.anim.Stop(); //LogWarp.LogErrorFormat("{0} car StateFollowPathSuperMarketSimply_StayParking {1}, {2}", entity.entityID, // entity.groundParkingGroupID, entity.groundParkingIdx); MessageGroundParkingSpace.Send((int)GameMessageDefine.ParkingCarInGroundParking, entity.groundParkingGroupID, entity.groundParkingIdx); SpawnVisitorFromGroundParking.Send(VisitorStage.GotoParking, EntityFuncType.Visitor_From_GroundParking, entity.groundParkingGroupID, entity.groundParkingIdx); /* 新手引导阶段 进行步骤4 添加跟随对象 */ if (GlobalData.GlobalDataManager.GetInstance().playerData.playerZoo.isGuide == true) { UIGuidePage uIGuidePage = PageMgr.GetPage <UIGuidePage>(); if (uIGuidePage == null) { string e = string.Format("新手引导界面 PageMgr.allPages里 UIGuidePage 为空"); throw new System.Exception(e); } if (uIGuidePage.newBieGuild_step == NewBieGuild.Step_3) { PageMgr.ShowPage <UIGuidePage>(); //开启新手引导UI uIGuidePage.entity = entity; } } }
protected void OnArrived(Message msg) { var _msg = (MessageArrived)msg; var entity = (this.fsmCtr as FSMMachineVisitor).ownerEntity; //自己的entity if (_msg.followPath.ownerEntity.entityID != entity.entityID) { return; } if (_msg.followPath.isArrivedEnd && !isFinishedBasePath) { isFinishedBasePath = true; //构建去地面停车场的路 List <Vector3> pathList = null; var pathUnit = GroundParingSpacePathManager.GetInstance().GetPathUnit(entity.groundParkingGroupID, entity.groundParkingIdx); if (!GroundParingSpacePathManager.IsExist(pathUnit.visitorBackPath)) { pathList = GroundParingSpacePathManager.GenVisitorBackPath(entity.groundParkingGroupID, entity.groundParkingIdx); GroundParingSpacePathManager.GetInstance().AddPath(GroundParingSpacePathType.VisitorBackPath, pathUnit, pathList, null); } pathList = pathUnit.visitorBackPath; EntityVisitor.GodownPath(entity, pathList); return; } if (_msg.followPath.isArrivedEnd) { MessageGroundParkingSpace.Send((int)GameMessageDefine.BroadcastLetGroundParingCarLeave, entity.groundParkingGroupID, entity.groundParkingIdx); // 回POOL EntityManager.GetInstance().RemoveFromEntityMovables(entity); } }
public override void WhenArrivedEnd() { var follow = (this.fsmCtr as FSMFollowPathSuperMarketSimply).owner; if (!isFinishedBack) { isFinishedBack = true; //LogWarp.LogError("完成倒车,准备离开"); //生成离开的路 var pathUnit = GroundParingSpacePathManager.GetInstance().GetPathUnit(follow.groupID, follow.idx); List <Vector3> outPath = null; List <RightAnglesControllNode> outRac = null; if (!GroundParingSpacePathManager.IsExist(pathUnit.outPath)) { outPath = GroundParingSpacePathManager.GenOutPath(follow.groupID, follow.idx); GroundParingSpacePathManager.GetInstance().AddPath(GroundParingSpacePathType.OutPath, pathUnit, outPath, null); outRac = GroundParingSpacePathManager.GenRAC(outPath, follow.turnOffset); GroundParingSpacePathManager.GetInstance().AddPath(GroundParingSpacePathType.OutPathRac, pathUnit, null, outRac); } follow.pathPosList = pathUnit.outPath; follow.ctrList = pathUnit.outPathRac; follow.idxCtr = 0; //设置方向为反 follow.isForward = true; MessageGroundParkingSpace.Send((int)GameMessageDefine.LetGroundParingCarLeave, follow.groupID, follow.idx); return; } // 回POOL EntityManager.GetInstance().RemoveFromEntityMovables(follow.ownerEntity); }