少年修仙传客户端代码仓库
client_Wu Xijin
2018-11-15 402b14c0c3858963aad23a6371dfe20a2b93e507
4805 【1.3】【前端】loading图增加等级显示
2个文件已添加
4个文件已修改
235 ■■■■ 已修改文件
Core/GameEngine/Model/Config/LoadingBackGroundConfig.cs 50 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/GameEngine/Model/Config/LoadingBackGroundConfig.cs.meta 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/GameEngine/Model/Config/MapResourcesConfig.cs 61 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/GameEngine/Model/Config/MapResourcesConfig.cs.meta 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/GameEngine/Model/ConfigManager.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Loading/LoadingWin.cs 108 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/GameEngine/Model/Config/LoadingBackGroundConfig.cs
New file
@@ -0,0 +1,50 @@
//--------------------------------------------------------
//    [Author]:            第二世界
//    [  Date ]:           Thursday, November 15, 2018
//--------------------------------------------------------
using UnityEngine;
using System;
namespace TableConfig {
    public partial class LoadingBackGroundConfig : ConfigBase {
        public int id { get ; private set ; }
        public string[] icons;
        public string levelLimit { get ; private set; }
        public string name { get ; private set; }
        public string description { get ; private set; }
        public override string getKey()
        {
            return id.ToString();
        }
        public override void Parse() {
            try
            {
                id=IsNumeric(rawContents[0]) ? int.Parse(rawContents[0]):0;
                icons = rawContents[1].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries);
                levelLimit = rawContents[2].Trim();
                name = rawContents[3].Trim();
                description = rawContents[4].Trim();
            }
            catch (Exception ex)
            {
                DebugEx.Log(ex);
            }
        }
    }
}
Core/GameEngine/Model/Config/LoadingBackGroundConfig.cs.meta
New file
@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 791645468791ce74c84280782740fa99
timeCreated: 1542267123
licenseType: Pro
MonoImporter:
  serializedVersion: 2
  defaultReferences: []
  executionOrder: 0
  icon: {instanceID: 0}
  userData:
  assetBundleName:
  assetBundleVariant:
Core/GameEngine/Model/Config/MapResourcesConfig.cs
@@ -1,14 +1,14 @@
//--------------------------------------------------------
//    [Author]:            第二世界
//    [  Date ]:           Friday, May 18, 2018
//--------------------------------------------------------
using UnityEngine;
using System;
namespace TableConfig {
//--------------------------------------------------------
//    [Author]:            第二世界
//    [  Date ]:           Thursday, November 15, 2018
//--------------------------------------------------------
using UnityEngine;
using System;
namespace TableConfig {
    public partial class MapResourcesConfig : ConfigBase {
        public int ID { get ; private set ; }
@@ -22,17 +22,14 @@
        public Vector3 MapOffset { get ; private set; } 
        public int[] Effect;
        public int Music { get ; private set ; }
        public string[] LoadingBG;
        public string LoadName { get ; private set; }
        public string LoadDescription { get ; private set; }
        public int ShowBOSSTime { get ; private set ; }
        public override string getKey()
        {
            return ID.ToString();
        }
        public override void Parse() {
        }
        public override void Parse() {
            try
            {
                ID=IsNumeric(rawContents[0]) ? int.Parse(rawContents[0]):0; 
@@ -62,24 +59,18 @@
            
                Music=IsNumeric(rawContents[10]) ? int.Parse(rawContents[10]):0; 
            
                LoadingBG = rawContents[11].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries);
                LoadName = rawContents[12].Trim();
                LoadDescription = rawContents[13].Trim();
                ShowBOSSTime=IsNumeric(rawContents[14]) ? int.Parse(rawContents[14]):0;
                ShowBOSSTime=IsNumeric(rawContents[11]) ? int.Parse(rawContents[11]):0;
            }
            catch (Exception ex)
            {
                DebugEx.Log(ex);
            }
        }
    }
}
            }
        }
    }
}
Core/GameEngine/Model/Config/MapResourcesConfig.cs.meta
@@ -1,6 +1,6 @@
fileFormatVersion: 2
guid: 8f17a96ef841bb74dafcec974bb4e7f5
timeCreated: 1526625853
timeCreated: 1542269954
licenseType: Pro
MonoImporter:
  serializedVersion: 2
Core/GameEngine/Model/ConfigManager.cs
@@ -205,6 +205,8 @@
        AddAsyncTask<GuardConfig>();
        AddAsyncTask<MarketQueryConfig>();
        AddAsyncTask<TreasureDungeonConfig>();
        AddAsyncTask<LoadingBackGroundConfig>();
        while (!AllCompleted())
        {
            var completedCount = 0;
System/Loading/LoadingWin.cs
@@ -9,6 +9,8 @@
using UnityEngine;
using UnityEngine.UI;
using TableConfig;
using LitJson;
using System.Text.RegularExpressions;
namespace Snxxz.UI
{
@@ -59,49 +61,87 @@
            }
            else
            {
                var playerLevel = PlayerDatas.Instance.baseData.LV == 0 ? PlayerDatas.Instance.loginInfo.LV : PlayerDatas.Instance.baseData.LV;
                var mapResConfig = Config.Instance.Get<MapResourcesConfig>(targetMapResId);
                if (mapResConfig != null && mapResConfig.LoadingBG.Length > 0)
                if (mapResConfig != null)
                {
                    var randomIndex = UnityEngine.Random.Range(0, mapResConfig.LoadingBG.Length > 1 ? mapResConfig.LoadingBG.Length + 1 : 1);
                    if (randomIndex == mapResConfig.LoadingBG.Length)
                    var loadingBackGroudConfig = Config.Instance.Get<LoadingBackGroundConfig>(mapResConfig.DataID);
                    if (loadingBackGroudConfig != null && loadingBackGroudConfig.icons.Length > 0)
                    {
                        m_BackGround.SetSprite(GeneralDefine.LoadLV);
                        m_ContainerFunctions.gameObject.SetActive(true);
                        var functions = GetShowFunctions(PlayerDatas.Instance.baseData.LV == 0 ? PlayerDatas.Instance.loginInfo.LV : PlayerDatas.Instance.baseData.LV);
                        for (int i = 0; i < m_FunctionShows.Length; i++)
                        var icons = new List<string>();
                        var json = JsonMapper.ToObject(loadingBackGroudConfig.levelLimit);
                        for (var i = 0; i < loadingBackGroudConfig.icons.Length; i++)
                        {
                            var show = m_FunctionShows[i];
                            show.Display(functions[i]);
                            var icon = loadingBackGroudConfig.icons[i];
                            if (json.Keys.Contains(icon))
                            {
                                var min = 0;
                                var max = int.MaxValue;
                                var levelLimit = json[icon].ToString();
                                var levelsMatch = Regex.Matches(levelLimit, "\\d+");
                                if (levelsMatch.Count > 0)
                                {
                                    min = int.Parse(levelsMatch[0].Value);
                                }
                                if (levelsMatch.Count > 1)
                                {
                                    max = int.Parse(levelsMatch[1].Value);
                                }
                                if (playerLevel > min && playerLevel < max)
                                {
                                    icons.Add(icon);
                                }
                            }
                            else
                            {
                                icons.Add(icon);
                            }
                        }
                    }
                    else
                    {
                        m_BackGround.SetSprite(mapResConfig.LoadingBG[randomIndex]);
                        m_ContainerFunctions.gameObject.SetActive(false);
                    }
                }
                if (mapResConfig != null && !string.IsNullOrEmpty(mapResConfig.LoadName))
                {
                    m_ContainerMapName.gameObject.SetActive(true);
                    m_MapName.SetSprite(mapResConfig.LoadName);
                }
                else
                {
                    m_ContainerMapName.gameObject.SetActive(false);
                }
                        var randomIndex = UnityEngine.Random.Range(0, loadingBackGroudConfig.icons.Length > 1 ? icons.Count + 1 : 1);
                        if (randomIndex == icons.Count)
                        {
                            m_BackGround.SetSprite(GeneralDefine.LoadLV);
                            m_ContainerFunctions.gameObject.SetActive(true);
                            var functions = GetShowFunctions(playerLevel);
                            for (int i = 0; i < m_FunctionShows.Length; i++)
                            {
                                var show = m_FunctionShows[i];
                                show.Display(functions[i]);
                            }
                        }
                        else
                        {
                            m_BackGround.SetSprite(icons[randomIndex]);
                            m_ContainerFunctions.gameObject.SetActive(false);
                        }
                if (mapResConfig != null && !string.IsNullOrEmpty(mapResConfig.LoadDescription))
                {
                    m_ContainerMapDescription.gameObject.SetActive(true);
                    m_MapDescription.SetSprite(mapResConfig.LoadDescription);
                }
                else
                {
                    m_ContainerMapDescription.gameObject.SetActive(false);
                        if (loadingBackGroudConfig != null && !string.IsNullOrEmpty(loadingBackGroudConfig.name))
                        {
                            m_ContainerMapName.gameObject.SetActive(true);
                            m_MapName.SetSprite(loadingBackGroudConfig.name);
                        }
                        else
                        {
                            m_ContainerMapName.gameObject.SetActive(false);
                        }
                        if (loadingBackGroudConfig != null && !string.IsNullOrEmpty(loadingBackGroudConfig.description))
                        {
                            m_ContainerMapDescription.gameObject.SetActive(true);
                            m_MapDescription.SetSprite(loadingBackGroudConfig.description);
                        }
                        else
                        {
                            m_ContainerMapDescription.gameObject.SetActive(false);
                        }
                    }
                }
            }
            if (Application.platform == RuntimePlatform.IPhonePlayer)
            {