Exemple #1
0
        // 战场初始化数据
        public void InitLoadingPlayerFrameInfo(IntPtr ptrParam, int nLen)
        {
            IntPtrVaArgParseHelper helper = new IntPtrVaArgParseHelper(ptrParam, nLen);

            cmd_Camp_Count cmdCount = helper.get <cmd_Camp_Count>();

            int nMatchType = cmdCount.nMatchType;
            int nMapId     = cmdCount.nMapID;
            int nSelfCamp  = 0;

            // 自己皮肤列表
            List <int> self_hero_skin_list = new List <int>();
            // 友方皮肤列表
            List <int> friend_hero_skin_list = new List <int>();
            // 敌方皮肤列表
            List <int> enemy_hero_skin_list = new List <int>();
            // XP技能列表
            List <int> hero_xp_list = new List <int>();

            // 有效玩家数据列表,吃鸡地图只加载右方信息
            List <cmd_match_load_scene_playerinfo> player_info_list = new List <cmd_match_load_scene_playerinfo>();

            foreach (int nCampCount in cmdCount.vCampCount)
            {
                for (int i = 0; i < nCampCount; ++i)
                {
                    cmd_match_load_scene_playerinfo data = helper.get <cmd_match_load_scene_playerinfo>();
                    // 有效的英雄ID,有效皮肤ID
                    if (data.nHeroID <= 0 || data.nSkinID <= 0)
                    {
                        continue;
                    }

                    // 自己皮肤
                    if (data.nSelfInfo == 1)
                    {
                        self_hero_skin_list.Add(data.nSkinID);
                        nSelfCamp = data.nSelfCamp;
                    }
                    // 友方
                    else if (data.nSelfCamp == data.nCamp)
                    {
                        friend_hero_skin_list.Add(data.nSkinID);
                    }
                    // 敌方
                    else
                    {
                        enemy_hero_skin_list.Add(data.nSkinID);
                    }

                    // 有效XP
                    if (data.nXPSkillID > 0)
                    {
                        hero_xp_list.Add(data.nXPSkillID);
                    }

                    // 吃鸡模式只加右方,其他模式全加
                    if (nMatchType == (int)EMMatchType.MatchType_MultiCampMatch)
                    {
                        if (data.nSelfCamp == data.nCamp)
                        {
                            player_info_list.Add(data);
                        }
                    }
                    else
                    {
                        player_info_list.Add(data);
                    }
                }
            }

            // 设置显示数据
            m_wndView.SetData(nMatchType, nMapId, nSelfCamp, cmdCount.vCampCount, player_info_list);

            List <SkinPreLoadInfo> skins        = new List <SkinPreLoadInfo>();
            List <int>             self_skins   = new List <int>();
            List <int>             friend_skins = new List <int>();
            List <int>             enemy_skins  = new List <int>();

            // 预加载皮肤
            foreach (int nSkinID in self_hero_skin_list)
            {
                SkinPreLoadInfo info = new SkinPreLoadInfo();
                info.skinID = nSkinID;
                info.nMask |= (int)CachePriority.PRIORITY_VERY_HIGH;
                List <SkinPreLoadInfo> relateSkinList = SkinHelper.PreLoadPlayerSkin(info);
                skins.AddRange(relateSkinList);

                foreach (SkinPreLoadInfo peri in relateSkinList)
                {
                    self_skins.Add(peri.skinID);
                }
            }
            foreach (int nSkinID in friend_hero_skin_list)
            {
                SkinPreLoadInfo info = new SkinPreLoadInfo();
                info.skinID = nSkinID;
                info.nMask |= (int)CachePriority.PRIORITY_HIGH;
                List <SkinPreLoadInfo> relateSkinList = SkinHelper.PreLoadPlayerSkin(info);
                skins.AddRange(relateSkinList);

                foreach (SkinPreLoadInfo peri in relateSkinList)
                {
                    friend_skins.Add(peri.skinID);
                }
            }
            foreach (int nSkinID in enemy_hero_skin_list)
            {
                SkinPreLoadInfo info = new SkinPreLoadInfo();
                info.skinID = nSkinID;
                info.nMask |= (int)CachePriority.PRIORITY_MEDIUM;
                List <SkinPreLoadInfo> relateSkinList = SkinHelper.PreLoadPlayerSkin(info);
                skins.AddRange(relateSkinList);

                foreach (SkinPreLoadInfo peri in relateSkinList)
                {
                    enemy_skins.Add(peri.skinID);
                }
            }

            SkinHelper.PreLoadMonsterSkin(nMapId);

            LightingEffectFactory.Instance.AcitvieLoadingSceneQueue();

            // 预加载皮肤对应的光效
            EffectHelper.LoadPreLights(nMapId, ASpeedGame.Data.Scheme.LightType.ActorSkin, self_skins, CachePriority.PRIORITY_VERY_HIGH);
            EffectHelper.LoadPreLights(nMapId, ASpeedGame.Data.Scheme.LightType.ActorSkin, friend_skins, CachePriority.PRIORITY_HIGH);
            EffectHelper.LoadPreLights(nMapId, ASpeedGame.Data.Scheme.LightType.ActorSkin, enemy_skins, CachePriority.PRIORITY_MEDIUM);

            // 预加载XP技能对应的光效
            EffectHelper.LoadPreLights(nMapId, ASpeedGame.Data.Scheme.LightType.XP, hero_xp_list, CachePriority.PRIORITY_LOW);

            LightingEffectFactory.Instance.UnAcitvieLoadingSceneQueue();
        }