Beispiel #1
0
        private static void SingleSceneDataToMultiSceneData_EntryGate(PlayerData playerData)
        {
            if (!IsSingleSceneDataToMultiSceneData_EntryGate(playerData))
            {
                return;
            }

            List <GateData> gateList = new List <GateData>();

            for (int i = 0; i < playerData.playerZoo.entryGateList.Count; i++)
            {
                GateData gateData = new GateData {
                    entryID = playerData.playerZoo.entryGateList[i].entryID,
                    level   = playerData.playerZoo.entryGateList[i].level,
                };
                gateList.Add(gateData);
            }

            EntryGateData_MS entryGateData_MS = new EntryGateData_MS
            {
                entryGateList     = gateList,
                entryTicketsLevel = playerData.playerZoo.entryTicketsLevel,
                sceneID           = GameConst.First_SceneID
            };

            playerData.playerZoo.entryGateList_MS.Clear();
            playerData.playerZoo.entryGateList_MS.Add(entryGateData_MS);
            playerData.playerZoo.entryTicketsLevel = UFrame.Const.Invalid_Int;
            playerData.playerZoo.entryGateList.Clear();
        }
        /// <summary>
        /// 获取多场景的ID售票口对应的数据
        /// </summary>
        /// <param name="entryID"></param>
        /// <returns></returns>
        public GateData GetEntryGateIDIndexOfDataIdx(int entryID)
        {
            GateData entryGate     = null;
            var      entryGateList = GetEntryDateDataIDIndexOfDataIdx().entryGateList;

            for (int i = 0; i < entryGateList.Count; i++)
            {
                if (entryGateList[i].entryID == entryID)
                {
                    entryGate = entryGateList[i];
                    return(entryGate);
                }
            }
            string e = string.Format("售票口ID在用户数据中没找到{0}id", entryID);

            throw new System.Exception(e);
            return(null);
        }
        public void SetDefaultEntryGateData(int sceneID)
        {
            GlobalDataManager.GetInstance().logicTableEntryGate.AddScene(sceneID);
            var sortGateIDs = GlobalDataManager.GetInstance().logicTableEntryGate.GetSortGateIDs(sceneID);

            numEntryGate = 1;
            GateData entryGateData = new GateData
            {
                entryID = sortGateIDs[0],
                level   = 1
            };

            EntryGateData_MS entryGateData_MS = new EntryGateData_MS();

            entryGateData_MS.sceneID           = sceneID;
            entryGateData_MS.entryTicketsLevel = 1;
            entryGateData_MS.entryGateList.Add(entryGateData);
            this.entryGateList_MS.Add(entryGateData_MS);
        }