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; } } }
/// <summary> /// CD 结束 发送消息 /// </summary> protected void WhenCDFinished() { var entity = (this.fsmCtr as FSMMachineVisitor).ownerEntity; var msg = EntryGateCheckInCDFinshedApply.Send(entity.entityID, entity.zooEntryID); isSendCDFinshed = true; 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_15) { PageMgr.ShowPage <UIGuidePage>(); //开启新手引导UI } else if (uIGuidePage.newBieGuild_step < NewBieGuild.Step_15) { uIGuidePage.TAEvent_finish(); uIGuidePage.newBieGuild_step = NewBieGuild.Step_15; uIGuidePage.TAEvent_start(); //本阶段显示文本 uIGuidePage.TAEvent_process(); uIGuidePage.OnClickDialogBoxButton(); } } DebugFile.GetInstance().WriteKeyFile(entity.entityID, "{0} WhenCDFinished send {1}", entity.entityID, msg); }
public void OnClickZoo() { //判断当前动物栏的等级是否不为0 为0开启新的动物栏 int litteZooLevel = GlobalDataManager.GetInstance().playerData.GetLittleZooModuleData(int.Parse(nameID)).littleZooTicketsLevel; if (litteZooLevel > 0) { if (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); } //LogWarp.LogErrorFormat("测试: 新手引导步骤 动物栏点击 {0} ", uIGuidePage.procedure); if (uIGuidePage.newBieGuild_step != NewBieGuild.Step_20) { return; } else { //取消场景特效 进入场景点击事件 uIGuidePage.DestroyEffectChild(); uIGuidePage.TAEvent_finish(); uIGuidePage.TAEvent_start((int)uIGuidePage.newBieGuild_step + 1); uIGuidePage.TAEvent_process((int)uIGuidePage.newBieGuild_step + 1); uIGuidePage.SetCameraOnClickScene(sceneUIButtonPos); //uIGuidePage.TAEvent_finish(1); //uIGuidePage.TAEvent_start(2); } } //LogWarp.LogErrorFormat("ssssssssssssssss {0}", nameID); //显示UI PageMgr.ShowPage <UIZooPage>(nameID); //动物栏UI交互 iPage = new UIZooPage(); UITestToolWindowPage uITestToolWindowPage = PageMgr.GetPage <UITestToolWindowPage>(); if (uITestToolWindowPage != null) { uITestToolWindowPage.littleZooID = int.Parse(nameID); } SetMainPageHidePart(gameObject); } else { int idx = Config.buildupConfig.getInstace().getCell(nameID).affirmopen; if (GlobalDataManager.GetInstance().playerData.playerZoo.isGuide == true) { return; } if (idx == 0) { PromptText.CreatePromptText("Ui_Text_122"); return; } PageMgr.ShowPage <UIBuildOpenPage>(nameID); //开启新的动物园交互 iPage = new UIBuildOpenPage(); SetMainPageHidePart(gameObject); } }
public void OnClickEntry() { if (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_12) { return; } else { //取消场景特效 进入场景点击事件 uIGuidePage.DestroyEffectChild(); uIGuidePage.TAEvent_finish(); uIGuidePage.TAEvent_start((int)uIGuidePage.newBieGuild_step + 1); uIGuidePage.TAEvent_process((int)uIGuidePage.newBieGuild_step + 1); uIGuidePage.SetCameraOnClickScene(sceneUIButtonPos); } } PageMgr.ShowPage <UIEntryPage>(); //摆渡车UI交互 iPage = new UIEntryPage(); SetMainPageHidePart(gameObject); }
/// <summary> /// 争对新手引导阶段做些操作 /// </summary> private void DelayedOperationNewbieGuideStage() { //根据新手引导阶段的步骤显示对应的特效和隐藏对应的按钮点击事件 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_20) { //停车场停车位按钮处显示小手点击动画 effectNode = tickets_Button.transform.Find("effectNode"); Transform trans = null; trans = ResourceManager.GetInstance().LoadGameObject(Config.globalConfig.getInstace().GuideUiClickEffect).transform; trans.SetParent(effectNode, true); trans.localScale = UnityEngine.Vector3.one; trans.position = effectNode.position; trans.localPosition = new UnityEngine.Vector3( trans.localPosition.x, trans.localPosition.y + 4, trans.localPosition.z); } }
public override void Enter(int preStateName) { base.Enter(preStateName); var entity = (this.fsmCtr as FSMMachineVisitor).ownerEntity; DebugFile.GetInstance().WriteKeyFile(entity.entityID, "{0} StateVisitorStayVisitSeat.Enter", entity.entityID); DebugFile.GetInstance().MarkGameObject(entity.mainGameObject, "visitor_{0}_{1}_{2}", entity.entityID, (VisitorState)this.preStateName, (VisitorState)this.stateName); isToVisitorStateChoseLittleZoo = false; isToStateVisitorLeaveNonLittleZoo = false; shouldImmediateFinishVisitCD = false; effID = Const.Invalid_Int; effGo = null; isRevCDVal = false; if (visitCD != null) { visitCD.Stop(); } // LogWarp.LogFormat("-->Visitor enter tour state: littleZooId ={0}visitorId ={1}", entity.stayBuildingID, entity.entityID); // 观光游客面朝动物栏中心 entity.LookAt(LittleZooPosManager.GetInstance().GetPos(entity.stayBuildingID)); MessageManager.GetInstance().Regist((int)GameMessageDefine.LittleZooDataReply, OnLittleZooDataReply); MessageManager.GetInstance().Regist((int)GameMessageDefine.VisitorVisitCDFinshedReply, OnVisitorVisitCDFinshedReply); MessageManager.GetInstance().Regist((int)GameMessageDefine.ImmediateFinishVisitCD, OnImmediateFinishVisitCD); //模型到达动物栏等待位 调用新手引导的内容 显示步骤16 if (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); } //LogWarp.LogError("测试: uIGuidePage.procedure= " + uIGuidePage.procedure); if (uIGuidePage.newBieGuild_step == NewBieGuild.Step_16) { uIGuidePage.TAEvent_finish(); uIGuidePage.newBieGuild_step = NewBieGuild.Step_17; uIGuidePage.TAEvent_start(); //本阶段显示文本 uIGuidePage.TAEvent_process(); uIGuidePage.OnClickDialogBoxButton(); } else if (uIGuidePage.newBieGuild_step == NewBieGuild.Step_17) { PageMgr.ShowPage <UIGuidePage>(); //开启新手引导UI } } //进入这个状态开始计算游览cd LittleZooData.Send(entity.entityID, entity.stayBuildingID); }
public override void Enter(int preStateName) { base.Enter(preStateName); var entity = (this.fsmCtr as FSMMachineVisitor).ownerEntity; DebugFile.GetInstance().WriteKeyFile(entity.entityID, "{0} StateVisitorStayFirstPosInEntryQueue.Enter", entity.entityID); DebugFile.GetInstance().MarkGameObject(entity.mainGameObject, "visitor_{0}_{1}_{2}", entity.entityID, (VisitorState)this.preStateName, (VisitorState)this.stateName); DebugFile.GetInstance().WriteKeyFile(entity.entityID, "{0} Play {1}", entity.entityID, Config.globalConfig.getInstace().VisitorIdle); entity.PlayActionAnim(Config.globalConfig.getInstace().VisitorIdle); isToVisitorStateChoseLittleZoo = false; shouldImmediateFinishEntryGateCheckInCD = false; accumulativeUpdateUITime = 0; if (checkInCD != null) { checkInCD.Stop(); } isRecvCDVal = false; isSendCDFinshed = false; MessageManager.GetInstance().Regist((int)GameMessageDefine.GetEntryGateDataReply, OnGetEntryGateDataReply); MessageManager.GetInstance().Regist((int)GameMessageDefine.EntryGateCheckInCDFinshedReply, OnEntryGateCheckInCDFinshedReply); MessageManager.GetInstance().Regist((int)UFrameBuildinMessage.Arrived, this.OnArrived); MessageManager.GetInstance().Regist((int)GameMessageDefine.ImmediateFinishEntryGateCheckInCD, OnImmediateFinishEntryGateCheckInCD); /* 模型到达售票口 调用新手引导的内容 显示步骤10 */ if (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_10) { PageMgr.ShowPage <UIGuidePage>(); } else if (uIGuidePage.newBieGuild_step == NewBieGuild.Step_9) { uIGuidePage.TAEvent_finish(); uIGuidePage.newBieGuild_step = NewBieGuild.Step_10; uIGuidePage.TAEvent_start((int)uIGuidePage.newBieGuild_step); //本阶段显示文本 uIGuidePage.TAEvent_process((int)uIGuidePage.newBieGuild_step); uIGuidePage.OnClickDialogBoxButton(); } } //进入这个状态开始计算游览cd GetEntryGateDataApply.Send(entity.entityID, entity.zooEntryID); }
/// <summary> /// 延时,新手引导阶段的相机跟随赋值 /// </summary> private void DelayedOperationNewbieGuideStage(EntityGroundParkingCar entity) { float timeCount = 0.1f; DOTween.To(() => timeCount, a => timeCount = a, 0.1f, 0.1f).OnComplete(new TweenCallback(delegate { 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_2 && uIGuidePage.number == 0) { uIGuidePage.entity = entity; } })); }
protected void OnAddVisitorToEntryQueueApply(Message msg) { var _msg = msg as AddVisitorToEntryQueueApply; LogWarp.LogFormat("{0} EntryGateModule recv {1}", _msg.entityID, _msg); DebugFile.GetInstance().WriteKeyFile(_msg.entityID, "{0} EntryGateModule recv {1}", _msg.entityID, _msg); EntryGate entryGate = null; if (!this.entryGates.TryGetValue(_msg.entryID, out entryGate)) { #if UNITY_EDITOR string e = string.Format("{0} 找不到入口ID {1}", _msg.entityID, _msg.entryID); throw new System.Exception(e); #endif } int indexInQueue = entryGate.AddVisitorToQueue(_msg.entityID); #if UNITY_EDITOR if (indexInQueue == Const.Invalid_Int) { string e = string.Format("{0} AddVisitorToQueue {1} 失败", _msg.entityID, _msg.entryID); throw new System.Exception(e); } #endif AddVisitorToEntryQueueReply.Send(_msg.entityID, indexInQueue); if (_msg.entryID == 0 && GlobalDataManager.GetInstance().playerData.playerZoo.isGuide == true) { UIGuidePage uIGuidePage = PageMgr.GetPage <UIGuidePage>(); if (uIGuidePage != null && uIGuidePage.newBieGuild_step <= NewBieGuild.Step_10) { entryGate.checkInCDVal = (int)Config.globalConfig.getInstace().GuideTouristSpeed *1000; } else { entryGate.checkInCDVal = GetCheckinCDValMs(0, 1); } } }
protected void OnLetGroundParingCarLeave(Message msg) { var _msg = msg as MessageGroundParkingSpace; var parkingSpace = this.groundParking.GetSpace(_msg.groupID, _msg.idx); this.numShowParking++; ShowLeftParkingNum(numShowParking); parkingSpace.SetFree(); /*强制关闭新手引导*/ if (GlobalData.GlobalDataManager.GetInstance().playerData.playerZoo.isGuide) { UIGuidePage uIGuidePage = PageMgr.GetPage <UIGuidePage>(); if (uIGuidePage == null) { string e = string.Format("新手引导界面 PageMgr.allPages里 UIGuidePage 为空"); throw new System.Exception(e); } uIGuidePage.newBieGuild_step = NewBieGuild.Step_25; uIGuidePage.OnClickDialogBoxButton(); } }
private void RegistAllCompent() { GameObject camera = GlobalDataManager.GetInstance().zooGameSceneData.camera; //查找选择的相机 rotationCamera = camera.transform.Find("RotationCamera"); mainCamera = camera.transform.Find("main_camera"); buttonHide = AddCompentInChildren <Button>(buttonHide, "UIBg/UIShowGroup/OkButton"); buttonHide = RegistBtnAndClick("UIBg/UIShowGroup/OkButton", HideUI); buttonText = RegistCompent <Text>("UIBg/UIShowGroup/OkButton/ButtonText"); //GetTransPrefabText(buttonText); //新手引导手势组件 effectNode = RegistCompent <Transform>("UIBg/UIShowGroup/OkButton/effectNode"); if (GlobalDataManager.GetInstance().playerData.playerZoo.isGuide == true) { Transform trans = null; trans = ResourceManager.GetInstance().LoadGameObject(Config.globalConfig.getInstace().GuideUiClickEffect).transform; trans.SetParent(effectNode, true); trans.localScale = UnityEngine.Vector3.one; trans.position = effectNode.position; trans.localPosition = new UnityEngine.Vector3( trans.localPosition.x, trans.localPosition.y + 4, trans.localPosition.z); UIGuidePage uIGuidePage = PageMgr.GetPage <UIGuidePage>(); if (uIGuidePage == null) { string e = string.Format("新手引导界面 PageMgr.allPages里 UIGuidePage 为空"); throw new System.Exception(e); } uIGuidePage.TAEvent_finish((int)uIGuidePage.newBieGuild_step + 1); uIGuidePage.TAEvent_start((int)uIGuidePage.newBieGuild_step + 2); uIGuidePage.TAEvent_process((int)uIGuidePage.newBieGuild_step + 2); } }
/// <summary> /// 控件显示赋值 /// </summary> private void InitCompent() { //LogWarp.LogError(" 测试: InitCompent "); if (maxGrade >= parkingProfitMaxGrade) { maxGrade = parkingProfitMaxGrade; } lvText.text = string.Format(GetL10NString("Ui_Text_2"), profitLevel.ToString()); gradeSlider.value = AddPercentage(profitLevel - oldMaxGrade, maxGrade - oldMaxGrade); gradeText_2.text = profitLevel.ToString() + "/" + maxGrade.ToString(); //最大等级上限 //获取UI image = Config.itemCell itemCell = GradeSliderAwardImage(); gradeSlider_Image.sprite = ResourceManager.LoadSpriteFromPrefab(itemCell.icon); gradeSlider_Text.text = MinerBigInt.ToDisplay(itemCell.itemval); scoreNumTest.text = starLevelReached + "/" + parkingCell.starsum; profitCoins_Text_2.text = ParkingCenter.GetParkingProfit(profitLevel).ToString() + "%";//a.ToString("#0.0") profitCoins_Text_3.text = "+" + ParkingCenter.GetParkingProfit(profitLevel, 1).ToString() + "%"; profitCoins_LvText.text = profitLevel.ToString(); parkingSpace_Text2.text = ParkingCenter.GetParkingSpace(parkingSpaceLevel).ToString(); parkingSpace_Text3.text = "+" + (ParkingCenter.GetParkingSpace(parkingSpaceLevel, 1)).ToString(); parkingSpace_LvText.text = parkingSpaceLevel.ToString(); enterCarSpawn_Text2.text = ParkingCenter.GetParkingEnterCarSpawn_UI(enterCarSpawnLevel).ToString("f2") + GetL10NString("Ui_Text_67"); enterCarSpawn_Text3.text = "+" + ParkingCenter.GetParkingEnterCarSpawn(enterCarSpawnLevel, 1).ToString("f2"); enterCarSpawn_LvText.text = enterCarSpawnLevel.ToString(); profitCoins_Button_NeedGoldNum.text = MinerBigInt.ToDisplay(consumeProfitCoins).ToString(); //升级模式需要的金钱 profitCoins_Button_ButtonLvUpText.text = GetL10NString("Ui_Text_7"); parkingSpace_Button_NeedGoldNum.text = MinerBigInt.ToDisplay(consumeParkingSpaceCoins).ToString(); //升级模式需要的金钱 parkingSpace_Button_ButtonLvUpText.text = GetL10NString("Ui_Text_7"); enterCarSpawn_Button_NeedGoldNum.text = MinerBigInt.ToDisplay(consumeEnterCarSpawnCoins).ToString(); //升级模式需要的金钱 enterCarSpawn_Button_ButtonLvUpText.text = GetL10NString("Ui_Text_7"); SetGradeBool_Profit(); SetGradeBool_ParkingSpace(); SetGradeBool_EnterCarSpawn(); if (profitLevel >= parkingProfitMaxGrade) { profitCoins_Button_NeedGoldNum.text = GetL10NString("Ui_Text_47"); //升级模式需要的金钱 profitCoins_Button_ButtonLvUpText.text = GetL10NString("Ui_Text_46"); //升级模式要升的级数 lvText.text = parkingCell.lvmax.ToString(); //等级text profitCoins_Text_3.text = GetL10NString("Ui_Text_47"); //价格变化标签 SwitchButtonUnClickable(profitCoins_Button, false); } if (parkingSpaceLevel >= parkingSpaceMaxGrade) { parkingSpace_Button_NeedGoldNum.text = GetL10NString("Ui_Text_47"); //升级模式需要的金钱 parkingSpace_Button_ButtonLvUpText.text = GetL10NString("Ui_Text_46"); //升级模式要升的级数 parkingSpace_Text3.text = GetL10NString("Ui_Text_47"); //数量变化标签 SwitchButtonUnClickable(parkingSpace_Button, false); } if (enterCarSpawnLevel >= parkingEnterCarSpawnMaxGrade) { enterCarSpawn_Button_NeedGoldNum.text = GetL10NString("Ui_Text_47"); //升级模式需要的金钱 enterCarSpawn_Button_ButtonLvUpText.text = GetL10NString("Ui_Text_46"); //升级模式要升的级数 enterCarSpawn_Text3.text = GetL10NString("Ui_Text_47"); //速度变化标签 SwitchButtonUnClickable(enterCarSpawn_Button, false); } if (GlobalDataManager.GetInstance().playerData.playerZoo.isGuide) { 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_5) { SwitchButtonUnClickable(parkingSpace_Button, true); SwitchButtonUnClickable(profitCoins_Button, false); SwitchButtonUnClickable(enterCarSpawn_Button, false); } else if (uIGuidePage.newBieGuild_step == NewBieGuild.Step_8) { SwitchButtonUnClickable(parkingSpace_Button, false); SwitchButtonUnClickable(profitCoins_Button, false); SwitchButtonUnClickable(enterCarSpawn_Button, true); } } //else //{ // SwitchButtonUnclickable(parkingSpace_Button, true); // SwitchButtonUnclickable(profitCoins_Button, true); // SwitchButtonUnclickable(enterCarSpawn_Button, true); //} if (profitLevel >= parkingProfitMaxGrade) { lvText.text = string.Format(GetL10NString("Ui_Text_2"), GetL10NString("Ui_Text_126"));; gradeSlider.value = 1; gradeText_2.text = GetL10NString("Ui_Text_126"); //最大等级上限 gradeSlider_IconBg.gameObject.SetActive(false); scoreNumTest.text = GetL10NString("Ui_Text_126"); } else { gradeSlider_IconBg.gameObject.SetActive(true); } }
protected void SpawnInGroundParkingCar(EntityFuncType entityFuncType, ParkingSpace parkingSpace) { EntityGroundParkingCar entity = null; //if (isRandomCar) { entity = EntityManager.GetInstance().GetRandomEntity(ResType.Car, entityFuncType) as EntityGroundParkingCar; } //else //{ // entity = EntityManager.GetInstance().GenEntityGameObject(2, EntityFuncType.VisitorCar_EnterZoo) as EntityGroundParkingCar; //} DebugFile.GetInstance().MarkGameObject(entity.mainGameObject, "car_{0}_{1}_{2}", entity.mainGameObject.GetInstanceID(), entityFuncType, entity.entityID); DebugFile.GetInstance().WriteKeyFile(entity.entityID, "{0} 生成 {1}", entity.entityID, entity.mainGameObject.GetInstanceID()); DebugFile.GetInstance().WriteKeyFile(entity.mainGameObject.GetInstanceID(), "{0} 生成 {1}", entity.mainGameObject.GetInstanceID(), entity.entityID); EntityManager.GetInstance().AddToEntityMovables(entity); if (entity.anim == null) { entity.anim = new SimpleAnimation(); } entity.anim.Init(entity.mainGameObject); if (entity.followPath == null) { entity.followPath = new FollowPathSuperMarketSimply(); } //从表里取速度 entity.moveSpeed = Config.globalConfig.getInstace().ZooCarSpeed; if (GlobalDataManager.GetInstance().playerData.playerZoo.isGuide == true) { UIGuidePage uIGuidePage = PageMgr.GetPage <UIGuidePage>(); if (uIGuidePage == null && GlobalDataManager.GetInstance().playerData.GetLittleZooModuleData(1001).littleZooTicketsLevel < 5) { entity.moveSpeed = Config.globalConfig.getInstace().GuideZooCarSpeed; } else if (uIGuidePage == null && GlobalDataManager.GetInstance().playerData.GetLittleZooModuleData(1001).littleZooTicketsLevel >= 5) { GlobalDataManager.GetInstance().playerData.playerZoo.isGuide = false; } } entity.groundParkingGroupID = parkingSpace.groupID; entity.groundParkingIdx = parkingSpace.idx; string pathName = ""; switch (entityFuncType) { case EntityFuncType.GroundParkingCar: //pathName = globalConfig.getInstace().NaturalVisitorInto; pathName = string.Format("InGroundParking_{0}_{1}", parkingSpace.groupID, parkingSpace.idx); break; //case EntityFuncType.VisitorCar_LeaveZoo: // pathName = globalConfig.getInstace().NaturalVisitorOut_2; // break; default: string e = string.Format("car 没有这种功能类型{0}", entityFuncType); throw new System.Exception(e); } int sceneID = GlobalDataManager.GetInstance().playerData.playerZoo.currSceneID; Config.parkingCell parkingCell = GlobalDataManager.GetInstance().logicTableParkingData.GetParkingCell(sceneID); //var path = PathManager.GetInstance().GetPath(pathName); //var path = CalcPathManager.GenInGroundParkingSpacePath(ps.groupID, ps.idx, 8f, 5f, 7f, -1); var pathUnit = GroundParingSpacePathManager.GetInstance().GetPathUnit(parkingSpace.groupID, parkingSpace.idx); List <Vector3> path = null; if (!GroundParingSpacePathManager.IsExist(pathUnit.inPath)) { //path = GroundParingSpacePathManager.GenInPath(parkingSpace.groupID, parkingSpace.idx, 8f, 5f, 7f, -1); path = GroundParingSpacePathManager.GenInPath(parkingSpace.groupID, parkingSpace.idx, Config.globalConfig.getInstace().GroundParkingFristSpaceOffset, Config.globalConfig.getInstace().GroundParkingSpace, Config.globalConfig.getInstace().GroundParkingSpacePosOffset, parkingCell.openseatdir[parkingSpace.groupID]); GroundParingSpacePathManager.GetInstance().AddPath(GroundParingSpacePathType.InPath, pathUnit, path, null); } path = pathUnit.inPath; entity.position = path[0]; DebugFile.GetInstance().WriteKeyFile(entity.entityID, "{0} 移动位置到路径起点{1}, pos {2}", entity.entityID, entity.mainGameObject.GetInstanceID(), path[0]); DebugFile.GetInstance().WriteKeyFile(entity.mainGameObject.GetInstanceID(), "{0} 移动位置到路径起点{1}, pos {2}", entity.mainGameObject.GetInstanceID(), entity.entityID, path[0]); DebugFile.GetInstance().WriteKeyFile(entity.entityID, "{0} 沿着路径{1}出发", entity.entityID, pathName); //entity.followPath.Init(entity, path.ToArray(), path[0], 0, entity.moveSpeed, false); entity.followPath.Init(entity, parkingSpace.groupID, parkingSpace.idx, path, path[0], 0, entity.moveSpeed); entity.Active(); //ps.parkingCar = entity; //TracedCamera(entity); parkingSpace.SetBeLocked(entity); /*若是新手引导阶段,附加跟随对象 不调用步骤*/ if (GlobalDataManager.GetInstance().playerData.playerZoo.isGuide == true) { DelayedOperationNewbieGuideStage(entity); } }
protected void OnSpawnVisitorFromGroundParking(Message msg) { var _msg = msg as SpawnVisitorFromGroundParking; //path_touristcar_intoupline //"path_tourist_intoupline"; //var path = PathManager.GetInstance().GetPath("path_touristcar_intoupline"); //var carBaseLinePos = path[_msg.groupID]; //var lastCorner = carBaseLinePos - GlobalDataManager.GetInstance().SceneForward * (8 + _msg.idx * 5); //var visitorBaseLinePos = PathManager.GetInstance().GetPath("path_tourist_intoupline")[_msg.idx]; //LogWarp.LogErrorFormat("{0}-{1}:{2},{3}", _msg.groupID, _msg.idx, lastCorner, visitorBaseLinePos); EntityVisitor entity = null; //VisitorState defaultState = VisitorState.EnterZoo; //switch (_msg.stage) //{ // case VisitorStage.GotoZoo: // //defaultState = VisitorState.EnterZoo; // defaultState = VisitorState.GotoZooEntry; // break; // case VisitorStage.GotoParking: // defaultState = VisitorState.GotoParking; // break; // default: // string e = string.Format("VisitorStage 异常{0}", _msg.stage); // throw new System.Exception(e); //} if (isRandomSpawn) { //entity = EntityManager.GetInstance().GetRandomEntity( // ResType.Visitor, EntityFuncType.Visitor_From_Car) as EntityVisitor; entity = EntityManager.GetInstance().GetRandomEntity( ResType.Visitor, _msg.funcType) as EntityVisitor; } else { //entity = EntityManager.GetInstance().GenEntityGameObject( // 101, EntityFuncType.Visitor_From_Car) as EntityVisitor; entity = EntityManager.GetInstance().GenEntityGameObject( 101, _msg.funcType) as EntityVisitor; } entity.groundParkingGroupID = _msg.groupID; entity.groundParkingIdx = _msg.idx; //LogWarp.LogErrorFormat("{0} visitor SpawnModule groupID={1}, idx={2}", entity.entityID, // entity.groundParkingGroupID, entity.groundParkingIdx); DebugFile.GetInstance().MarkGameObject(entity.mainGameObject, "visitor_ground_{0}", entity.entityID); EntityManager.GetInstance().AddToEntityMovables(entity); if (entity.anim == null) { entity.anim = new SimpleAnimation(); } //entity.anim.Init(entity.mainGameObject); entity.InitAnim(); entity.moveSpeed = Config.globalConfig.getInstace().ZooVisitorSpeed; if (GlobalDataManager.GetInstance().playerData.playerZoo.isGuide == true) { UIGuidePage uIGuidePage = PageMgr.GetPage <UIGuidePage>(); if (uIGuidePage != null && uIGuidePage.newBieGuild_step <= NewBieGuild.Step_4) { entity.moveSpeed = Config.globalConfig.getInstace().GuideZooVisitorSpeed; } } if (entity.followPath == null) { entity.followPath = new FollowPath(); } if (entity.fsmMachine == null) { entity.fsmMachine = new FSMMachineVisitor(entity); //entity.fsmMachine.AddState(new StateVisitorEnterZoo((int)VisitorState.EnterZoo, // entity.fsmMachine)); entity.fsmMachine.AddState(new StateVisitorGotoZooEntry((int)VisitorState.GotoZooEntry, entity.fsmMachine)); entity.fsmMachine.AddState(new StateVisitorLeaveZooEntryQueueFull((int)VisitorState.LeaveZooEntryQueueFull, entity.fsmMachine)); entity.fsmMachine.AddState(new StateVisitorEntryQueue((int)VisitorState.EntryQueue, entity.fsmMachine)); entity.fsmMachine.AddState(new StateVisitorStayFirstPosInEntryQueue((int)VisitorState.StayFirstPosInEntryQueue, entity.fsmMachine)); entity.fsmMachine.AddState(new StateVisitorChoseLittleZoo((int)VisitorState.ChoseLittleZoo, entity.fsmMachine)); entity.fsmMachine.AddState(new StateVisitorEnterLittleZooApply((int)VisitorState.EnterLittleZooApply, entity.fsmMachine)); //entity.fsmMachine.AddState(new StateVisitorStayWaitSeat((int)VisitorState.StayWaitSeat, // entity.fsmMachine)); entity.fsmMachine.AddState(new StateVisitorStayVisitSeat((int)VisitorState.StayVisitSeat, entity.fsmMachine)); entity.fsmMachine.AddState(new StateVisitorLeaveNonLittleZoo((int)VisitorState.LeaveNonLittleZoo, entity.fsmMachine)); //entity.fsmMachine.AddState(new StateVisitorCrossGroupPath((int)VisitorState.CrossGroupPath, // entity.fsmMachine)); entity.fsmMachine.AddState(new StateVisitorLeaveFromZooEntry((int)VisitorState.LeaveFromZooEntry, entity.fsmMachine)); //entity.fsmMachine.AddState(new StateVisitorGotoStartOfExitGateEntryPath((int)VisitorState.GotoStartOfExitGateEntryPath, // entity.fsmMachine)); //entity.fsmMachine.AddState(new StateVisitorGotoExitGateEntryQueue((int)VisitorState.GotoExitGateEntryQueue, // entity.fsmMachine)); entity.fsmMachine.AddState(new StateVisitorGotoParking((int)VisitorState.GotoParking, entity.fsmMachine)); entity.fsmMachine.AddState(new StateVisitorGotoGroundParking((int)VisitorState.GotoGroundParking, entity.fsmMachine)); entity.fsmMachine.SetDefaultState((int)VisitorState.GotoZooEntry); } else { //LogWarp.LogError("pool游客"); //entity.fsmMachine.GotoState((int)VisitorState.GotoZooEntry); entity.fsmMachine.GotoState((int)VisitorState.GotoZooEntry); } entity.Active(); DebugFile.GetInstance().WriteKeyFile(entity.entityID, "{0} Play {1}", entity.entityID, Config.globalConfig.getInstace().VisitorWalk); entity.PlayActionAnim(Config.globalConfig.getInstace().VisitorWalk); }
public override void Enter(int preStateName) { //LogWarp.Log("VisitorGotoZooEntry.Enter"); base.Enter(preStateName); isToVisitorStateLeaveZooEntryQueueFull = false; isToVisitorStateEntryQueue = false; //isStartGotoEntry = false; isArrivedObservePos = false; var entity = (this.fsmCtr as FSMMachineVisitor).ownerEntity; DebugFile.GetInstance().WriteKeyFile(entity.entityID, "{0} VisitorGotoZooEntry.Enter", entity.entityID); DebugFile.GetInstance().MarkGameObject(entity.mainGameObject, "visitor_{0}_{1}_{2}", entity.entityID, (VisitorState)this.preStateName, (VisitorState)this.stateName); entity.Reset(); DebugFile.GetInstance().WriteKeyFile(entity.entityID, "{0} Play {1}, {2}, {3}", entity.entityID, Config.globalConfig.getInstace().VisitorWalk, entity.mainGameObject.GetInstanceID(), entity.anim.animation.gameObject.GetInstanceID() ); entity.PlayActionAnim(Config.globalConfig.getInstace().VisitorWalk); MessageManager.GetInstance().Regist((int)GameMessageDefine.AddVisitorToEntryQueuePlaceHolderReply, this.OnAddVisitorToEntryQueuePlaceHolderReply); MessageManager.GetInstance().Regist((int)UFrameBuildinMessage.Arrived, this.OnArrived); MessageManager.GetInstance().Regist((int)GameMessageDefine.BroadcastForwardOneStepInEntryGateQueue, OnBroadcastForwardOneStepInExitGateQueue); //去观察点 string pathName; EntityFuncType entityFuncType = (EntityFuncType)(entity.entityFuncType); switch (entityFuncType) { case EntityFuncType.Visitor_From_Ship: pathName = Config.globalConfig.getInstace().AdvertVisitorInto_2; EntityVisitor.GodownPath(entity, pathName, true); break; case EntityFuncType.Visitor_From_Car: pathName = Config.globalConfig.getInstace().EntryQueueObservePath; EntityVisitor.GodownPath(entity, pathName, true); break; case EntityFuncType.Visitor_From_GroundParking: //LogWarp.LogErrorFormat("entityID={0} StateVisitorGotoZooEntry groupID={1}, idx={2}", entity.entityID, entity.groundParkingGroupID, entity.groundParkingIdx); var pathUnit = GroundParingSpacePathManager.GetInstance().GetPathUnit(entity.groundParkingGroupID, entity.groundParkingIdx); List <Vector3> pathList = null; if (!GroundParingSpacePathManager.IsExist(pathUnit.entryObservePath)) { pathList = GroundParingSpacePathManager.GenObservePath(entity.groundParkingGroupID, entity.groundParkingIdx); GroundParingSpacePathManager.GetInstance().AddPath(GroundParingSpacePathType.EntryObservePath, pathUnit, pathList, null); } pathList = pathUnit.entryObservePath; entity.pathList.Clear(); entity.pathList.AddRange(pathList); EntityVisitor.GodownPath(entity, entity.pathList, true); ///*新手引导阶段 添加跟随对象 不做步骤调用(仅限于步骤9)*/ if (GlobalData.GlobalDataManager.GetInstance().playerData.playerZoo.isGuide == true) { UIGuidePage uIGuidePage = PageMgr.GetPage <UIGuidePage>(); if (uIGuidePage == null) { string e1 = string.Format("新手引导界面 PageMgr.allPages里 UIGuidePage 为空"); throw new System.Exception(e1); } //LogWarp.LogError("测试: entity.mainGameObject.name " + entity.mainGameObject.name+ " uIGuidePage.procedure= "+ uIGuidePage.procedure); if (uIGuidePage.newBieGuild_step == NewBieGuild.Step_9 && uIGuidePage.number == 0) { uIGuidePage.entity = entity; uIGuidePage.number = 1; } } break; default: string e = string.Format("没有这种游客类型{0}", entityFuncType); throw new System.Exception(e); } }