protected void OnOpenNewLittleZoo(Message msg)
        {
            //判定是不是最后,是否需要加载新地块,以及新加载地块上的动物栏
            var    _msg        = msg as OpenNewLittleZoo;
            int    littleZooID = _msg.littleZooID;
            string e;
            int    idx = GlobalDataManager.GetInstance().playerData.GetLittleZooIDIndexOfDataIdx(littleZooID);

            if (idx < 0)
            {
                //e = string.Format("开启的动物栏 {0} 在用户数据中没有", littleZooID);
                //throw new System.Exception(e);
                return;
            }

#if UNITY_EDITOR
            if (playerData.playerZoo.littleZooModuleDatasMSS[idx].littleZooTicketsLevel != 0)
            {
                //e = string.Format("开启的动物栏 {0} 在用户数据中等级!=0", littleZooID);
                //throw new System.Exception(e);
                return;
            }
#endif
            playerData.playerZoo.littleZooModuleDatasMSS[idx].sceneID = playerData.playerZoo.currSceneID;
            playerData.playerZoo.littleZooModuleDatasMSS[idx].littleZooTicketsLevel           = 1;
            playerData.playerZoo.littleZooModuleDatasMSS[idx].littleZooEnterVisitorSpawnLevel = 1;
            playerData.playerZoo.littleZooModuleDatasMSS[idx].littleZooVisitorSeatLevel       = 1;

            int  nextGroupID  = Const.Invalid_Int;
            bool trigerExtend = false;
            trigerLoadLittleZooIDs.Clear();
            if (GlobalDataManager.GetInstance().logicTableGroup.IsTrigerLoadNextGroupID(
                    playerData.playerZoo.currSceneID, littleZooID, ref nextGroupID))
            {
                //触发额外的地块,用户数据中加数据
                if (!GlobalDataManager.GetInstance().zooGameSceneData.IsExtendGroupContains(nextGroupID))
                {
                    trigerExtend = true;
                    var cell = Config.groupConfig.getInstace().getCell(nextGroupID);
                    trigerLoadLittleZooIDs.AddRange(cell.startid);

                    for (int i = 0; i < trigerLoadLittleZooIDs.Count; i++)
                    {
                        //playerData.playerZoo.littleZooLevels.Add(0);
                        LittleZooModuleDataMSS littleZooModuleData = new LittleZooModuleDataMSS
                        {
                            sceneID                         = playerData.playerZoo.currSceneID,
                            littleZooID                     = trigerLoadLittleZooIDs[i],
                            littleZooTicketsLevel           = 0,
                            littleZooVisitorSeatLevel       = 0,
                            littleZooEnterVisitorSpawnLevel = 0,
                        };
                        playerData.playerZoo.littleZooModuleDatasMSS.Add(littleZooModuleData);
                    }
                }
            }
            //LogWarp.LogError("测试:开启了littleZooID" + littleZooID);
            BroadcastOpenNewLittleZoo.Send(littleZooID, trigerExtend, nextGroupID, trigerLoadLittleZooIDs);
        }
Exemple #2
0
        private void OnBroadcastOpenNewLittleZoo(Message obj)
        {
            BroadcastOpenNewLittleZoo aa = obj as BroadcastOpenNewLittleZoo;

            CheckTasksProgressForOpenNewLittleZoo(aa.littleZooID);
        }