/// <summary> /// 刷新主界面的数据 /// </summary> /// <param name="arg1"></param> /// <param name="arg2"></param> private void RefreshUIShowData(int arg1, IntCD arg2) { incomeCoinMS = PlayerDataModule.CurrScenePerMinCoin(true); earningsText.text = MinerBigInt.ToDisplay(incomeCoinMS) + GetL10NString("Ui_Text_67"); arg2.Reset(); arg2.Run(); }
public override void Enter(int preStateName) { base.Enter(preStateName); var entity = (this.fsmCtr as FSMMachineVisitor).ownerEntity; DebugFile.GetInstance().WriteKeyFile(entity.entityID, "{0} StateVisitorGotoExitGateEntryQueue.Enter", entity.entityID); DebugFile.GetInstance().MarkGameObject(entity.mainGameObject, "visitor_{0}_{1}_{2}", entity.entityID, (VisitorState)this.preStateName, (VisitorState)this.stateName); MessageManager.GetInstance().Regist((int)UFrameBuildinMessage.Arrived, this.OnArrived); MessageManager.GetInstance().Regist((int)GameMessageDefine.BroadcastAfterExtendSceneAndModifiedPath, this.OnBroadcastAfterExtendSceneAndModifiedPath); MessageManager.GetInstance().Regist((int)GameMessageDefine.BroadcastForwardOneStepInExitGateQueue, this.OnBroadcastForwardOneStepInExitGateQueue); MessageManager.GetInstance().Regist((int)GameMessageDefine.SendExitGateCheckinCDFinishReply, this.OnSendExitGateCheckinCDFinishReply); finishQueueStep = 0; GoToOrgPosOfQueue(entity); if (checkInCD == null) { checkInCD = new IntCD(0); } checkInCD.Stop(); LogWarp.LogFormat("{0} GoToOrgPosOfQueue step = {1}", entity.entityID, finishQueueStep); DebugFile.GetInstance().WriteKeyFile(entity.entityID, "{0} GoToOrgPosOfQueue step = {1}", entity.entityID, finishQueueStep); }
public override void Release() { MessageManager.GetInstance().UnRegist((int)GameMessageDefine.SetParkingProfitLevelOfPlayerData, this.OnSetParkingProfitLevelOfPlayerData); MessageManager.GetInstance().UnRegist((int)GameMessageDefine.SetParkingSpaceLevelOfPlayerData, this.OnSetParkingSpaceLevelOfPlayerData); MessageManager.GetInstance().UnRegist((int)GameMessageDefine.SetParkingEnterCarSpawnLevelOfPlayerData, this.OnSetParkingEnterCarSpawnLevelOfPlayerData); //MessageManager.GetInstance().UnRegist((int)GameMessageDefine.SetCoinOfPlayerData, this.OnSetCoinOfPlayerData); MessageManager.GetInstance().UnRegist((int)GameMessageDefine.AddCoinOfPlayerDataMSSC, this.OnSetCoinOfPlayerDataMSSC); MessageManager.GetInstance().UnRegist((int)GameMessageDefine.SetDiamondOfPlayerData, this.OnSetDiamondOfPlayerData); MessageManager.GetInstance().UnRegist((int)GameMessageDefine.SetStarOfPlayerData, this.OnSetStarOfPlayerData); MessageManager.GetInstance().UnRegist((int)GameMessageDefine.SetLittleZooTicketsLevelPlayerData, this.OnSetLittleZooTicketsLevelPlayerData); MessageManager.GetInstance().UnRegist((int)GameMessageDefine.SetLittleZooVisitorLocationLevelOfPlayerData, this.OnSetLittleZooVisitorLocationLevelOfPlayerData); MessageManager.GetInstance().UnRegist((int)GameMessageDefine.SetLittleZooEnterVisitorSpawnLevelOfPlayerData, this.OnSetLittleZooEnterVisitorSpawnLevelOfPlayerData); MessageManager.GetInstance().UnRegist((int)GameMessageDefine.OpenNewLittleZoo, this.OnOpenNewLittleZoo); MessageManager.GetInstance().UnRegist((int)GameMessageDefine.VisitorVisitCDFinshedReply, OnVisitorVisitCDFinshedReply); MessageManager.GetInstance().UnRegist((int)GameMessageDefine.EntryGateCheckInCDFinshedReply, OnEntryGateCheckGoToZoo); MessageManager.GetInstance().UnRegist((int)GameMessageDefine.SetAnimalLevel, this.OnSetAnimalLevelData); MessageManager.GetInstance().UnRegist((int)GameMessageDefine.SetEntryGateLevelOfPlayerData, this.OnSetEntryGateLevelOfPlayerData); MessageManager.GetInstance().UnRegist((int)GameMessageDefine.SetEntryGatePureLevelOfPlayerData, this.OnSetEntryGatePureLevelOfPlayerData); MessageManager.GetInstance().UnRegist((int)GameMessageDefine.SetEntryGateNumOfPlayerData, this.OnSetEntryGateNumOfPlayerData); MessageManager.GetInstance().UnRegist((int)GameMessageDefine.IncreaseCrossRoadStageID, this.OnIncreaseCrossRoadStageID); trigerLoadLittleZooIDs.Clear(); if (leaveSceneCD != null) { leaveSceneCD.Stop(); leaveSceneCD = null; } Stop(); }
protected void Callback_SpawnCar(IntCD CD, IVoidParam spawnCarParam) { SpawnCarParam _spawnCarParam = spawnCarParam as SpawnCarParam; var car = EntityManager.GetInstance().GenEntityGameObject(1, EntityFuncType.CrossRoadCar) as EntityCrossRoadCar; //var car = EntityManager.GetInstance().GetRandomEntity(ResType.Car, EntityFuncType.CrossRoadCar) as EntityCrossRoadCar; car.Init(_spawnCarParam.startPos, _spawnCarParam.endPos, _spawnCarParam.speed); //重要:Entity取出后先设置位置,再把Collider设置成true,防止在未设置位置时触发碰撞 car.position = _spawnCarParam.startPos; try { car.GetTrans().Find("Collider").gameObject.SetActive(true); } catch (System.Exception e) { #if UNITY_EDITOR throw new System.Exception(string.Format("汽车 {0} 取Collider 失败", car.mainGameObject.name)); #endif } car.LookAt(_spawnCarParam.endPos); car.Active(); CrossRoadModelManager.GetInstance().entityModel.AddToEntityMovables(car); if (CD != null) { CD.Reset(); CD.Run(); } }
public ZooEntry(int entryID, int cd, string entryPathNameFromCar, int maxNumOfQueues) { this.entryID = entryID; this.entryCD = new IntCD(cd); this.entryCD.Run(); this.entryPathNameFromCar = entryPathNameFromCar; this.maxNumOfQueues = maxNumOfQueues; }
protected void OnLittleZooDataReply(Message msg) { var _msg = msg as LittleZooDataReply; var entity = (this.fsmCtr as FSMMachineVisitor).ownerEntity; //LogWarp.LogErrorFormat("{0}, {1}", _msg != null, entity != null); if (_msg.entityID != entity.entityID) { return; } int cdVal = _msg.littleZoo.visitCDValue; var playerData = GlobalDataManager.GetInstance().playerData; if (playerData.playerZoo.buffVisitCDVal != UFrame.Const.Invalid_Float) { int buffVisitCDVal = Math_F.FloatToInt1000(playerData.playerZoo.buffVisitCDVal); cdVal = Mathf.Min(cdVal, buffVisitCDVal); } if (visitCD == null) { visitCD = new IntCD(cdVal); } else { visitCD.ResetOrg(cdVal); } if (!GlobalDataManager.GetInstance().playerData.playerZoo.isGuide) { GetSceneUIGameObject(); } visitCD.Run(); isRevCDVal = true; //cd时间太短就执行idle if (cdVal < Math_F.FloatToInt1000(Config.globalConfig.getInstace().VisitorMinAnimLen)) { entity.PlayActionAnim(Config.globalConfig.getInstace().VisitorIdle); return; } var cell = entity.PlayActionAnim(); if (cell.effectresid > 0) { effID = cell.effectresid; var pool = PoolManager.GetInstance().GetGameObjectPool(effID); effGo = pool.New(); effTrans = effGo.transform; effTrans.SetParent(GlobalDataManager.GetInstance().zooGameSceneData.littleZooParentNode, false); effPos = entity.position; effPos.y = cell.effectY; effTrans.position = effPos; effTrans.rotation = entity.rotation; } }
void CallbackStrengthCD(int arg1, IntCD intCD) { if (playerdata.playerLittleGame.strength < maxStrength) { ++playerdata.playerLittleGame.strength; MessageManager.GetInstance().Send((int)GameMessageDefine.BroadcastChangedStrength); OnAddMultiCD(); } }
protected void OnGetEntryGateDataReply(Message msg) { var _msg = msg as GetEntryGateDataReply; var entity = (this.fsmCtr as FSMMachineVisitor).ownerEntity; //LogWarp.LogErrorFormat("{0}, {1}", _msg != null, entity != null); if (_msg.entityID != entity.entityID) { return; } int cdVal = _msg.entryGate.checkInCDVal; #if UNITY_EDITOR if (cdVal <= 0) { string e = string.Format("cdVal = {0}", cdVal); throw new System.Exception(e); } #endif var playerData = GlobalDataManager.GetInstance().playerData; if (playerData.playerZoo.buffEntryGateCDVal != UFrame.Const.Invalid_Float) { int buffCD = Math_F.FloatToInt1000(playerData.playerZoo.buffEntryGateCDVal); cdVal = Mathf.Min(cdVal, buffCD); } if (checkInCD == null) { checkInCD = new IntCD(cdVal); } else { checkInCD.ResetOrg(cdVal); } if (!GlobalDataManager.GetInstance().playerData.playerZoo.isGuide) { GetSceneUIGameObject(); } checkInCD.Run(); isRecvCDVal = true; }
public override void Enter(int preStateName) { base.Enter(preStateName); isSendFinished = false; isClosed = false; //playerData = GlobalDataManager.GetInstance().playerData; sceneID = (fsmCtr as FSMGameLoad).sceneID; waitCD = new IntCD(100); waitCD.Stop(); LoadAnimalInLittleZoo(); ////SendLoadFinised(); //if (playerData.playerLittleGame.stageID > 0) //{ // SendLoadFinised(); // return; //} EnterCrossRoad(); }
private void Test02(int arg1, IntCD arg2) { LogWarp.LogErrorFormat("BBBBBBBBBBBBBBBBB {0} {1}", arg1, arg2.org); arg2.Reset(); arg2.Run(); }
protected void InitCD() { CDVal = Config.globalConfig.getInstace().LeaveSceneCoinCD * 1000; CD = new IntCD(CDVal); CD.Run(); }
/// <summary> /// 广告按钮显示——动物栏观光速度 /// </summary> /// <param name="arg1"></param> /// <param name="arg2"></param> private void Begin_AdsButtonShow_Visit(int arg1, IntCD arg2) { visitButton.gameObject.SetActive(true); }
/// <summary> /// 广告按钮显示——加快大门乘车速度 /// </summary> /// <param name="arg1"></param> /// <param name="arg2"></param> private void Begin_AdsButtonShow_Ticket(int arg1, IntCD arg2) { ticketButton.gameObject.SetActive(true); }
/// <summary> /// 广告按钮显示——加快大门乘车速度 /// </summary> /// <param name="arg1"></param> /// <param name="arg2"></param> private void AdsButtonShow_Ticket(int arg1, IntCD arg2) { ticketButton.gameObject.SetActive(true); ticketIntCD = arg2; }
/// <summary> /// 广告按钮显示——游轮 /// </summary> /// <param name="arg1"></param> /// <param name="arg2"></param> private void Begin_AdsButtonShow_Tourist(int arg1, IntCD arg2) { //LogWarp.LogErrorFormat("测试: Begin_AdsButtonShow_Tourist {0} ", arg1); touristButton.gameObject.SetActive(true); }
/// <summary> /// 广告按钮显示——动物栏观光速度 /// </summary> /// <param name="arg1"></param> /// <param name="arg2"></param> private void AdsButtonShow_Visit(int arg1, IntCD arg2) { visitButton.gameObject.SetActive(true); visitIntCD = arg2; }
/// <summary> /// 广告按钮显示——游轮 /// </summary> /// <param name="arg1"></param> /// <param name="arg2"></param> private void AdsButtonShow_Tourist(int arg1, IntCD arg2) { touristButton.gameObject.SetActive(true); touristIntCD = arg2; }
public void Realse() { visitorQueue.Clear(); entryCD = null; }
protected void InitLeaveSceneCD() { levelSceneCDVal = Config.globalConfig.getInstace().LeaveSceneCoinCD * 1000; leaveSceneCD = new IntCD(levelSceneCDVal); leaveSceneCD.Run(); }
void Start() { DragSmoothCD = new IntCD(dragSmoothDurationMS); DragSmoothCD.Stop(); Init(); }