public void SetDefaultParkingCenterData(int sceneID)
        {
            //LogWarp.LogError("   SetDefaultParkingCenterData  " + this.currSceneID);
            ParkingCenterData_MS parkingCenterData = new ParkingCenterData_MS
            {
                parkingSpaceLevel         = 1,
                parkingProfitLevel        = 1,
                parkingEnterCarSpawnLevel = 1,
                sceneID = sceneID,
            };

            parkingCenterDataList.Add(parkingCenterData);
        }
Exemplo n.º 2
0
        private static void SingleSceneDataToMultiSceneData_Parking(PlayerData playerData)
        {
            if (!IsSingleSceneDataToMultiSceneData_Parking(playerData))
            {
                return;
            }
            ParkingCenterData_MS parkingCenterData_MS = new ParkingCenterData_MS
            {
                parkingEnterCarSpawnLevel = playerData.playerZoo.parkingCenterData.parkingEnterCarSpawnLevel,
                parkingProfitLevel        = playerData.playerZoo.parkingCenterData.parkingProfitLevel,
                parkingSpaceLevel         = playerData.playerZoo.parkingCenterData.parkingSpaceLevel,
                sceneID = GameConst.First_SceneID,
            };

            playerData.playerZoo.parkingCenterDataList.Clear();
            playerData.playerZoo.parkingCenterDataList.Add(parkingCenterData_MS);
            playerData.playerZoo.parkingCenterData.ClearData();
        }
        public ParkingCenterData_MS GetParkingCenterDataIDIndexOfDataIdx(int sceneID = -1)
        {
            if (sceneID == -1)
            {
                sceneID = GlobalDataManager.GetInstance().playerData.playerZoo.currSceneID;
            }
            ParkingCenterData_MS parkingCenterData = null;
            var parkingCenterDataList = GlobalDataManager.GetInstance().playerData.playerZoo.parkingCenterDataList;

            for (int i = 0; i < parkingCenterDataList.Count; i++)
            {
                parkingCenterData = parkingCenterDataList[i];
                if (parkingCenterData.sceneID == sceneID)
                {
                    return(parkingCenterData);
                }
            }
            string e = string.Format("场景为{0}的停车场数据为空", sceneID);

            throw new System.Exception(e);
            return(null);
        }