public parkingCell getCell(int key) { parkingCell t = null; this.AllData.TryGetValue(key.ToString(), out t); return(t); }
public parkingCell getCell(string key) { parkingCell t = null; this.AllData.TryGetValue(key, out t); return(t); }
/// <summary> /// 监听停车场的停车位的数量升级 /// </summary> /// <param name="obj"></param> private void OnBroadcastParkingSpaceLevelOfPlayerData(Message obj) { var _msg = obj as BroadcastValueOfPlayerData; //查看新的等级有没有导致停车场外观变化 int oldLevel = _msg.currVal - _msg.deltaVal; int currLevel = _msg.currVal; var allData = Config.parkingConfig.getInstace().AllData; Config.parkingCell parkingCell = GlobalDataManager.GetInstance().logicTableParkingData.GetParkingCell(sceneID); int oldResIdx = FindLevelRangIndex(parkingCell.openlv, oldLevel); int currResIdx = FindLevelRangIndex(parkingCell.openlv, currLevel); if (oldResIdx != currResIdx) { //卸载旧的,加载新的 LoadParkingScene(currResIdx); } //重新计算总量,并更新显示牌 int oldNumMaxParking = numMaxParking; CalcMaxParkingNum(); numShowParking += (numMaxParking - oldNumMaxParking); //LogWarp.LogErrorFormat(" 测试: 小汽车刷新速度:{0} 停车场总停车的数量={1} 现在显示的数量={2}", enterCarSpawnInterval, numMaxParking, numShowParking); //numShowParking = numMaxParking - numUnderParkingCar - numGroundParkingCar; ShowLeftParkingNum(numShowParking); //检查地面停车场数量是否增加 int numSpace = GetGroundParkingNumber(this.playerData.GetParkingCenterDataIDIndexOfDataIdx().parkingSpaceLevel); //LogWarp.LogError("测试:检查地面停车场数量是否增加 numSpace=" + numSpace); int numGroup = numSpace / globalConfig.getInstace().NumGroundParkingGroupSpace; int oldnumGroup = this.groundParking.groupParkingSpaceDic.Count; for (int i = oldnumGroup; i < numGroup; i++) { var group = new GroupParkingSpace(i, globalConfig.getInstace().NumGroundParkingGroupSpace); groundParking.groupParkingSpaceDic.Add(i, group); } }
private void SetPackingToClickCallbacks(int sceneID) { var allParkingData = Config.parkingConfig.getInstace().AllData; Config.parkingCell parkingCell = null; foreach (var item in allParkingData.Values) { if (item.scene == sceneID) { parkingCell = item; break; } } if (!clickCallbacks.ContainsKey(Config.globalConfig.getInstace().ParkingButton)) { clickCallbacks.Add(Config.globalConfig.getInstace().ParkingButton, OnClickParking); } }
/// <summary> /// 初始化属性数值 /// </summary> private void InitData( ) { //LogWarp.LogError(" 测试: InitData "); currSceneID = playerData.playerZoo.currSceneID; parkingCell = GlobalDataManager.GetInstance().logicTableParkingData.GetParkingCell(currSceneID); parkingProfitMaxGrade = parkingCell.lvmax; parkingSpaceMaxGrade = parkingCell.spacemaxlv; parkingEnterCarSpawnMaxGrade = parkingCell.touristmaxlv; InitCoin(); int idx = PlayerDataModule.FindLevelRangIndex(parkingCell.lvshage, profitLevel); maxGrade = parkingCell.lvshage[idx]; oldMaxGrade = parkingCell.lvshage[idx - 1]; starLevelReached = PlayerDataModule.FindLevelRangIndex01(parkingCell.lvshage, profitLevel); if (profitLevel >= parkingProfitMaxGrade) { starLevelReached = PlayerDataModule.FindLevelRangIndex01(parkingCell.lvshage, profitLevel); } InitCompent(); }
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); } }