public LittleZooModuleDataMSS GetLittleZooModuleData(int littleZooID)
        {
            int idx = GlobalDataManager.GetInstance().playerData.GetLittleZooIDIndexOfDataIdx(littleZooID);

            if (idx < 0)
            {
                string e = string.Format("动物栏ID在用户数据中没找到{0}", littleZooID);
                throw new System.Exception(e);
            }
            return(playerZoo.littleZooModuleDatasMSS[idx]);
        }
        /// <summary>
        /// 获取当前场景在多数据列表里面的下标
        /// </summary>
        /// <returns></returns>
        public int GetSceneIDGoToEntryDataListSubscript()
        {
            var entryGateList_MS = GlobalDataManager.GetInstance().playerData.playerZoo.entryGateList_MS;
            int sceneID          = GlobalDataManager.GetInstance().playerData.playerZoo.currSceneID;

            for (int i = 0; i < entryGateList_MS.Count; i++)
            {
                if (entryGateList_MS[i].sceneID == sceneID)
                {
                    return(i);
                }
            }
            return(0);
        }
        public static int GetcurrSceneIDByStar(PlayerData playerData)
        {
            var sceneDataList = GlobalDataManager.GetInstance().logicTableSceneData.sceneDataList;

            for (int i = 0; i < sceneDataList.Count; i++)
            {
                if (playerData.playerZoo.star < sceneDataList[i].openStar)
                {
                    return(sceneDataList[i - 1].sceneID);
                }
            }

            return(playerData.playerZoo.currSceneID);
        }
        public bool GetOpenedLittleZooIDIndexOfData(int littleZooID, ref int idx)
        {
            idx = Const.Invalid_Int;
            var littleZooModuleDatas = GlobalDataManager.GetInstance().playerData.playerZoo.littleZooModuleDatasMSS;

            for (int i = 0; i < littleZooModuleDatas.Count; i++)
            {
                var littleZooModuleData = littleZooModuleDatas[i];
                if (littleZooModuleData.littleZooID == littleZooID && littleZooModuleData.littleZooTicketsLevel > 0)
                {
                    idx = i;
                    return(true);
                }
            }

            return(false);
        }
Beispiel #5
0
        public static PlayerData Load()
        {
            LogWarp.Log("PlayerData.Load");
            var playerData = GlobalDataManager.GetInstance().playerData;

            if (playerData == null)
            {
                LogWarp.Log("PlayerData.LoadFromPlayerPrefs");
                playerData = LoadFromPlayerPrefs();
                GlobalDataManager.GetInstance().playerData = playerData;
            }

            //playerData.leftNumResetPoker = GameConst.Default_LeftNumResetPoker;
            //playerData.leftNumTips = GameConst.Default_LeftNumTips;

            return(playerData);
        }
        public int GetLittleZooIDIndexOfDataIdx(int littleZooID)
        {
            int number = Const.Invalid_Int;
            var littleZooModuleDatas = GlobalDataManager.GetInstance().playerData.playerZoo.littleZooModuleDatasMSS;

            for (int i = 0; i < littleZooModuleDatas.Count; i++)
            {
                if (littleZooModuleDatas[i].littleZooID == littleZooID)
                {
                    number = i;
                }
            }
            if (number < 0)
            {
                string e = string.Format("动物栏ID在用户数据中没找到{0}", littleZooID);
                throw new System.Exception(e);
            }
            return(number);
        }
        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);
        }
        public void SetDefaultlittleZooData(int sceneID)
        {
            int openLittleZoo        = 0;
            int defaultOpenGroup     = Config.globalConfig.getInstace().DefaultOpenGroup;
            int defaultLoadGroup     = defaultOpenGroup + Config.globalConfig.getInstace().ExtendLoadGroup;
            int defaultOpenLittleZoo = Config.globalConfig.getInstace().DefaultOpenLittleZoo;

#if NO_BIGINT
            defaultLoadGroup     = 8;
            defaultOpenLittleZoo = 19;
#endif
            var sortedGroupIDs = GlobalDataManager.GetInstance().logicTableGroup.GetSortedGroupIDs(sceneID);
            for (int i = 0; i < defaultLoadGroup; i++)
            {
                int groupID         = sortedGroupIDs[i];
                var cfgLittleZooIDs = GlobalDataManager.GetInstance().logicTableGroup.GetSortedLittleZooIDs(sceneID, groupID);
                for (int j = 0; j < cfgLittleZooIDs.Count; j++)
                {
                    LittleZooModuleDataMSS littleZooModuleData = new LittleZooModuleDataMSS();
                    littleZooModuleDatasMSS.Add(littleZooModuleData);
                    littleZooModuleData.littleZooID = cfgLittleZooIDs[j];

                    littleZooModuleData.sceneID = sceneID;

                    if (openLittleZoo < defaultOpenLittleZoo)
                    {
                        littleZooModuleData.littleZooTicketsLevel     = 1;
                        littleZooModuleData.littleZooVisitorSeatLevel = 1;
#if NO_BIGINT
                        littleZooModuleData.littleZooVisitorSeatLevel = 10;
#endif
                        littleZooModuleData.littleZooEnterVisitorSpawnLevel = 1;
                        ++openLittleZoo;
                    }
                    else
                    {
                        littleZooModuleData.littleZooTicketsLevel           = 0;
                        littleZooModuleData.littleZooVisitorSeatLevel       = 0;
                        littleZooModuleData.littleZooEnterVisitorSpawnLevel = 0;
                    }
                }
            }
        }
        public Vector3 GetEntryGateGroupFocusPoint()
        {
            var dinst       = GlobalDataManager.GetInstance();
            var sortGateIDs = dinst.logicTableEntryGate.GetSortGateIDs(dinst.playerData.playerZoo.currSceneID);

            Config.ticketCell ticketCell  = Config.ticketConfig.getInstace().getCell(sortGateIDs[0]);
            Vector3           ret         = Vector3.zero;
            Transform         centerTrans = null;
            GameObject        go          = GameObject.Find("damen");

            if (go != null)
            {
                ret         = go.transform.position;
                centerTrans = go.transform.Find(ticketCell.prefabsname + "/Center");
            }
            if (centerTrans != null)
            {
                ret = centerTrans.position;
            }
            return(ret);
        }
        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);
        }
        /// <summary>
        /// 获取多场景数据结构中的当前售票口数据Data
        /// </summary>
        /// <returns></returns>
        public EntryGateData_MS GetEntryDateDataIDIndexOfDataIdx(int sceneID = -1)
        {
            if (sceneID == -1)
            {
                sceneID = GlobalDataManager.GetInstance().playerData.playerZoo.currSceneID;
            }
            EntryGateData_MS entryGateData_MS = null;
            var entryGateList_MS = GlobalDataManager.GetInstance().playerData.playerZoo.entryGateList_MS;

            for (int i = 0; i < entryGateList_MS.Count; i++)
            {
                entryGateData_MS = entryGateList_MS[i];
                if (entryGateData_MS.sceneID == sceneID)
                {
                    return(entryGateData_MS);
                }
            }

            string e = string.Format("场景为{0}的售票口数据为空", sceneID);

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