少年修仙传客户端代码仓库
client_linchunjie
2019-03-14 eebcc6e6cd1edd71945dc90cc697ffe013123466
6340  【前端】【2.0】境界改版开发单
4个文件已修改
202 ■■■■ 已修改文件
System/Realm/RealmHeartMagicBehaviour.cs 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Realm/RealmLevelUpBehaviour.cs 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Realm/RealmWin.cs 86 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Utility/UIHelper.cs 96 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Realm/RealmHeartMagicBehaviour.cs
@@ -8,7 +8,7 @@
{
    public class RealmHeartMagicBehaviour : MonoBehaviour
    {
        [SerializeField] Image m_BossName;
        [SerializeField] Text m_BossName;
        [SerializeField] Text m_FightPower;
        [SerializeField] RawImage m_RawBoss;
        [SerializeField] Button m_Goto;
@@ -35,16 +35,17 @@
        void DisplayBase()
        {
            var config = RealmConfig.Get(realmLevel);
            var config = RealmConfig.Get(realmLevel - 1);
            var fightPower = PlayerDatas.Instance.baseData.FightPoint;
            var satisfy = fightPower >= config.FightPower;
            var label = UIHelper.AppendColor(satisfy ? TextColType.Green : TextColType.Red, fightPower.ToString());
            m_FightPower.text = StringUtility.Contact(label, "/", config.FightPower);
            var label = UIHelper.AppendColor(satisfy ? TextColType.LightGreen : TextColType.Red, fightPower.ToString());
            m_FightPower.text = StringUtility.Contact(UIHelper.AppendColor(TextColType.LightGreen,
                Language.Get("RolePromoteBetterFight")), label, "/", config.FightPower);
        }
        void DisplayBoss()
        {
            var config = RealmConfig.Get(realmLevel);
            var config = RealmConfig.Get(realmLevel - 1);
            m_RawBoss.gameObject.SetActive(true);
            UI3DModelExhibition.Instance.ShowNPC(m_RawBoss, new UI3DNPCExhibitionData()
            {
@@ -54,6 +55,7 @@
            });
            var npcConfig = NPCConfig.Get(config.BossID);
            m_BossName.text = npcConfig.charName;
            var npcModel = UI3DModelExhibition.Instance.NpcModelPet;
            if (npcModel != null)
System/Realm/RealmLevelUpBehaviour.cs
@@ -128,8 +128,8 @@
            m_Condition.text = Language.Get("RealmConditionLevel", config.NeedLV);
            var level = PlayerDatas.Instance.baseData.LV;
            var satisfy = level >= config.NeedLV;
            var levelLabel = UIHelper.AppendColor(satisfy ? TextColType.Green : TextColType.Red, level.ToString());
            m_Progress.text = StringUtility.Contact(levelLabel, "/", config.NeedLV);
            m_Progress.text = StringUtility.Contact(level, "/", config.NeedLV);
            m_Progress.color = satisfy ? UIHelper.s_LightGreen : UIHelper.s_DarkRedColor;
        }
        public void DisplayBoss(int realmLevel)
@@ -137,8 +137,8 @@
            var config = RealmConfig.Get(realmLevel);
            m_Condition.text = Language.Get("RealmConditionBoss", config.Name);
            var progress = model.isBossPass ? 1 : 0;
            var label = UIHelper.AppendColor(model.isBossPass ? TextColType.Green : TextColType.Red, progress.ToString());
            m_Progress.text = StringUtility.Contact(label, "/", 1);
            m_Progress.text = StringUtility.Contact(progress, "/", 1);
            m_Progress.color = model.isBossPass ? UIHelper.s_LightGreen : UIHelper.s_DarkRedColor;
        }
        public void SetActive(bool active)
System/Realm/RealmWin.cs
@@ -14,14 +14,47 @@
    public class RealmWin : Window
    {
        [SerializeField] Transform m_ContainerRealmUp;
        [SerializeField] RealmBriefBehaviour m_RealmBrief;
        [SerializeField] RealmLevelUpBehaviour m_RealmLevelUp;
        [SerializeField] RealmAnimationBehaviour m_RealmAnimation;
        [SerializeField] RealmStageBehaviour[] m_RealmStages;
        [SerializeField] Transform m_ContainerBoss;
        [SerializeField] RealmHeartMagicBehaviour m_RealmHeartMagic;
        [SerializeField] Button m_RealmRestraint;
        [SerializeField] Button m_GotoBoss;
        [SerializeField] Button m_Close;
        RealmState m_RealmState = RealmState.LevelUp;
        RealmState realmState
        {
            get { return m_RealmState; }
            set
            {
                if (m_RealmState != value)
                {
                    switch (m_RealmState)
                    {
                        case RealmState.LevelUp:
                            HideRealmUp();
                            break;
                        case RealmState.Boss:
                            HideRealmBoss();
                            break;
                    }
                    m_RealmState = value;
                    switch (m_RealmState)
                    {
                        case RealmState.LevelUp:
                            DisplayRealmUp();
                            break;
                        case RealmState.Boss:
                            DisplayRealmBoss();
                            break;
                    }
                }
            }
        }
        RealmModel model
        {
@@ -40,7 +73,7 @@
        protected override void AddListeners()
        {
            m_Close.onClick.AddListener(CloseClick);
            m_Close.onClick.AddListener(OnBack);
            m_GotoBoss.AddListener(GotoBoss);
        }
@@ -53,7 +86,10 @@
        protected override void OnActived()
        {
            base.OnActived();
            Display();
            m_RealmState = RealmState.LevelUp;
            HideRealmBoss();
            DisplayRealmUp();
        }
        protected override void OnAfterOpen()
@@ -75,8 +111,10 @@
        }
        #endregion
        void Display()
        void DisplayRealmUp()
        {
            m_ContainerRealmUp.gameObject.SetActive(true);
            var realmLevel = PlayerDatas.Instance.baseData.realmLevel;
            if (realmLevel < model.realmMaxLevel)
            {
@@ -90,6 +128,27 @@
            DisplayRealmLevelUp();
            DisplayRealmStages();
            DisplayRealmBrief();
        }
        void HideRealmUp()
        {
            m_ContainerRealmUp.gameObject.SetActive(false);
            foreach (var item in m_RealmStages)
            {
                item.Dispose();
            }
        }
        void DisplayRealmBoss()
        {
            m_ContainerBoss.gameObject.SetActive(true);
            m_RealmHeartMagic.Display(model.selectRealm);
        }
        void HideRealmBoss()
        {
            m_ContainerBoss.gameObject.SetActive(false);
            m_RealmHeartMagic.Dispose();
        }
        void DisplayRealmStages()
@@ -151,9 +210,28 @@
            DisplayRealmLevelUp();
        }
        private void OnBack()
        {
            if (realmState == RealmState.Boss)
            {
                realmState = RealmState.LevelUp;
                return;
            }
            CloseClick();
        }
        private void GotoBoss()
        {
            dungeonModel.SingleChallenge(RealmModel.REALM_DUNGEON_ID, 0);
            if (realmState == RealmState.LevelUp)
            {
                realmState = RealmState.Boss;
            }
        }
        public enum RealmState
        {
            LevelUp,
            Boss,
        }
    }
Utility/UIHelper.cs
@@ -31,21 +31,21 @@
    public static string GetSuitNameByName(string attrName)
    {
        string suitStr = "";
        for(int i = 0; i < attrName.Length; i++)
        for (int i = 0; i < attrName.Length; i++)
        {
            if(i != attrName.Length - 1)
            if (i != attrName.Length - 1)
            {
                if (attrName.Length == 2)
                {
                    suitStr = StringUtility.Contact(suitStr,attrName[i],"        ");
                    suitStr = StringUtility.Contact(suitStr, attrName[i], "        ");
                }
                else if(attrName.Length == 3)
                else if (attrName.Length == 3)
                {
                    suitStr = StringUtility.Contact(suitStr,attrName[i], "  ");
                    suitStr = StringUtility.Contact(suitStr, attrName[i], "  ");
                }
                else
                {
                    suitStr = StringUtility.Contact(suitStr,attrName[i]);
                    suitStr = StringUtility.Contact(suitStr, attrName[i]);
                }
            }
            else
@@ -54,7 +54,7 @@
            }
        }
        return suitStr;
    }
    public static void SetItemBackGround(this Image _image, int itemColor)
@@ -255,16 +255,16 @@
    {
        _textBuilder.Length = 0;
        float hm = (float)Math.Round(num / 100000000, 2);
        if(hm >= 100)
        if (hm >= 100)
        {
            hm = (int)Math.Round(num / 100000000);
            _textBuilder.Append(hm);
            _textBuilder.Append(Language.Get("L1070"));
            return _textBuilder.ToString();
        }
        else if(hm >= 10)
        else if (hm >= 10)
        {
            hm = (float)Math.Round(num / 100000000,1);
            hm = (float)Math.Round(num / 100000000, 1);
            _textBuilder.Append(hm);
            _textBuilder.Append(Language.Get("L1070"));
            return _textBuilder.ToString();
@@ -275,7 +275,7 @@
            _textBuilder.Append(Language.Get("L1070"));
            return _textBuilder.ToString();
        }
        float tt = (float)Math.Round(num / 10000, 2);
        if (tt >= 100)
        {
@@ -284,14 +284,14 @@
            _textBuilder.Append(Language.Get("L1071"));
            return _textBuilder.ToString();
        }
        else if(tt >= 10)
        else if (tt >= 10)
        {
            tt = (float)Math.Round(num / 10000,1);
            tt = (float)Math.Round(num / 10000, 1);
            _textBuilder.Append(tt);
            _textBuilder.Append(Language.Get("L1071"));
            return _textBuilder.ToString();
        }
        else if(tt >= 1)
        else if (tt >= 1)
        {
            _textBuilder.Append(tt);
            _textBuilder.Append(Language.Get("L1071"));
@@ -300,7 +300,7 @@
        if (_textBuilder.Length == 0)
        {
            tt = (float)Math.Round(num,2);
            tt = (float)Math.Round(num, 2);
            _textBuilder.Append(tt);
        }
        return _textBuilder.ToString();
@@ -324,7 +324,7 @@
            sb.Append(Language.Get("L1070"));
            return sb.ToString();
        }
        else if(hm >= 1)
        else if (hm >= 1)
        {
            sb.Append(hm);
            sb.Append(Language.Get("L1070"));
@@ -339,7 +339,7 @@
            sb.Append(Language.Get("L1071"));
            return sb.ToString();
        }
        if (sb.Length == 0)
        {
            tt = (float)Math.Round(num, 2);
@@ -390,7 +390,7 @@
    public static string GetColorNameByItemColor(int itemColor)
    {
        switch(itemColor)
        switch (itemColor)
        {
            case 1:
                return Language.Get("Market_Text_42");
@@ -411,21 +411,21 @@
    #endregion
    #region 文字色值
    public static readonly Color32 s_BrightPinkColor = new Color32(246, 64, 141, 255);
    public static readonly Color32 s_BrightRedColor = new Color32(255, 3, 3, 255);
    public static readonly Color32 s_BrightPurpleColor = new Color32(218, 72, 213, 255);
    public static readonly Color32 s_BrightBlueColor = new Color32(0, 107, 227, 255); //006BE3FF
    public static readonly Color32 s_BrightOrangeColor = new Color32(255, 103, 1, 255); //FF6701FF
    public static readonly Color32 s_BrightWhiteColor = new Color32(104, 104, 104, 255); //686868
    public static readonly Color32 s_BrightGreenColor = new Color32(16, 157, 6, 255); //109d06
    public static readonly Color s_BrightPinkColor = new Color32(246, 64, 141, 255);
    public static readonly Color s_BrightRedColor = new Color32(255, 3, 3, 255);
    public static readonly Color s_BrightPurpleColor = new Color32(218, 72, 213, 255);
    public static readonly Color s_BrightBlueColor = new Color32(0, 107, 227, 255); //006BE3FF
    public static readonly Color s_BrightOrangeColor = new Color32(255, 103, 1, 255); //FF6701FF
    public static readonly Color s_BrightWhiteColor = new Color32(104, 104, 104, 255); //686868
    public static readonly Color s_BrightGreenColor = new Color32(16, 157, 6, 255); //109d06
    public static readonly Color32 s_DarkPinkColor = new Color32(255, 124, 124, 255);
    public static readonly Color32 s_DarkRedColor = new Color32(250, 1, 1, 255);
    public static readonly Color32 s_DarkPurpleColor = new Color32(236, 75, 246, 255);
    public static readonly Color32 s_DarkBlueColor = new Color32(49, 206, 251, 255);
    public static readonly Color32 s_DarkOrangeColor = new Color32(248, 152, 59, 255);
    public static readonly Color32 s_DarkWhiteColor = new Color32(247, 247, 247, 255);
    public static readonly Color32 s_DarkGreenColor = new Color32(53, 225, 34, 255); //35e122
    public static readonly Color s_DarkPinkColor = new Color32(255, 124, 124, 255);
    public static readonly Color s_DarkRedColor = new Color32(250, 1, 1, 255);
    public static readonly Color s_DarkPurpleColor = new Color32(236, 75, 246, 255);
    public static readonly Color s_DarkBlueColor = new Color32(49, 206, 251, 255);
    public static readonly Color s_DarkOrangeColor = new Color32(248, 152, 59, 255);
    public static readonly Color s_DarkWhiteColor = new Color32(247, 247, 247, 255);
    public static readonly Color s_DarkGreenColor = new Color32(53, 225, 34, 255); //35e122
    public static readonly Color s_NavyBrown = new Color32(64, 28, 6, 255);//401c06
    public static readonly Color s_Black = new Color32(0, 0, 0, 255);
@@ -434,7 +434,7 @@
    public static readonly Color s_LightYellow = new Color32(255, 244, 205, 255); //fff4cd
    public static readonly Color s_Gray = new Color32(204, 204, 204, 255);
    public static readonly Color s_BrightDanLV0 = new Color32(102,102,102,255); //666666
    public static readonly Color s_BrightDanLV0 = new Color32(102, 102, 102, 255); //666666
    public static readonly Color s_BrightDanLV1 = new Color32(148, 96, 255, 255); //9460ff
    public static readonly Color s_BrightDanLV2 = new Color32(0, 102, 255, 255); //0066ff
    public static readonly Color s_BrightDanLV3 = new Color32(0, 179, 55, 255); //00b337
@@ -442,18 +442,18 @@
    public static readonly Color s_BrightDanLV5 = new Color32(255, 0, 0, 255); //ff0000
    public static readonly Color s_BrightDanLV6 = new Color32(255, 0, 246, 255); //ff00f6
    public static readonly Color s_GrayDanLV0 = new Color32(221,221, 221, 255); //dddddd
    public static readonly Color s_GrayDanLV1 = new Color32(121,153, 255, 255); //7999ff
    public static readonly Color s_GrayDanLV0 = new Color32(221, 221, 221, 255); //dddddd
    public static readonly Color s_GrayDanLV1 = new Color32(121, 153, 255, 255); //7999ff
    public static readonly Color s_GrayDanLV2 = new Color32(0, 198, 255, 255); //00c6ff
    public static readonly Color s_GrayDanLV3 = new Color32(102, 255, 0, 255); //66ff00
    public static readonly Color s_GrayDanLV4 = new Color32(255, 144, 0, 255); //ff9000
    public static readonly Color s_GrayDanLV5 = new Color32(255, 0, 0, 255); //ff0000
    public static readonly Color s_GrayDanLV6 = new Color32(240, 0, 255, 255); //f000ff
    public static Color GetDanLVColor(int danLv,bool bright = false)
    public static Color GetDanLVColor(int danLv, bool bright = false)
    {
        var crossDanLVConfig = CrossServerArenaConfig.Get(danLv);
        if(crossDanLVConfig != null)
        if (crossDanLVConfig != null)
        {
            switch (crossDanLVConfig.DanType)
            {
@@ -597,6 +597,8 @@
                return StringUtility.Contact("<color=#", "000000", ">", msg, "</color>");
            case TextColType.LightYellow:
                return StringUtility.Contact("<color=#", "fff4cd", ">", msg, "</color>");
            case TextColType.LightGreen:
                return StringUtility.Contact("<color=#", "8ddc11", ">", msg, "</color>");
        }
        return msg;
    }
@@ -633,7 +635,7 @@
        }
    }
    public static string GetRealmColorByLv(int realmLv,string msg, bool bright = false)
    public static string GetRealmColorByLv(int realmLv, string msg, bool bright = false)
    {
        var config = RealmConfig.Get(realmLv);
        if (config == null)
@@ -643,7 +645,7 @@
        switch (config.Quality)
        {
            case 1:
                return StringUtility.Contact("<color=#", bright ? "686868" : "f7f7f7", ">",msg, "</color>");
                return StringUtility.Contact("<color=#", bright ? "686868" : "f7f7f7", ">", msg, "</color>");
            case 2:
                return StringUtility.Contact("<color=#", bright ? "08d00a" : "08d00a", ">", msg, "</color>");
            case 3:
@@ -712,7 +714,7 @@
        {
            return 0;
        }
        foreach (var _key in _propertyDict.Keys)
        {
            PlayerPropertyConfig cfg = PlayerPropertyConfig.Get(_key);
@@ -723,7 +725,7 @@
                    Equation.Instance.AddKeyValue("MinAtk", _propertyDict[_key]);
                    Equation.Instance.AddKeyValue("MaxAtk", _propertyDict[_key]);
                }
                else if(_key == 24)
                else if (_key == 24)
                {
                    Equation.Instance.AddKeyValue("PetMinAtk", _propertyDict[_key]);
                    Equation.Instance.AddKeyValue("PetMaxAtk", _propertyDict[_key]);
@@ -732,17 +734,17 @@
                {
                    float attrValue = _propertyDict[_key];
                    int fightParm = GetFightPowerParmByAttrId(_key);
                    if(_key == 11)
                    if (_key == 11)
                    {
                        int playerLv = PlayerDatas.Instance.baseData.LV;
                        FightPowerParamConfig paramConfig = FightPowerParamConfig.Get(playerLv);
                        Equation.Instance.AddKeyValue("AtkSpeedParameter", paramConfig.AtkSpeedParameter);
                    }
                    else if(_key == 15)
                    else if (_key == 15)
                    {
                        int playerLv = PlayerDatas.Instance.baseData.LV;
                        FightPowerParamConfig paramConfig = FightPowerParamConfig.Get(playerLv);
                        Equation.Instance.AddKeyValue("LuckyHitParameter",paramConfig.LuckyHitParameter);
                        Equation.Instance.AddKeyValue("LuckyHitParameter", paramConfig.LuckyHitParameter);
                    }
                    else
                    {
@@ -754,7 +756,7 @@
                    Equation.Instance.AddKeyValue(cfg.Parameter, attrValue);
                }
            }
        }
        FuncConfigConfig funcCfg = FuncConfigConfig.Get(FightPowerFormula);
        return Equation.Instance.Eval<int>(funcCfg.Numerical1);
@@ -767,7 +769,7 @@
        PlayerPropertyConfig cfg = PlayerPropertyConfig.Get(attrId);
        if (paramConfig == null || cfg == null) return 0;
        switch(cfg.Parameter)
        switch (cfg.Parameter)
        {
            case "Hit":
                return paramConfig.Hit;
@@ -893,7 +895,7 @@
    #region 得到装备位对应的部位名称
    public static string GetEquipPlaceName(int place)
    {
        if(GeneralDefine.equipPlaceNameDict.ContainsKey(place))
        if (GeneralDefine.equipPlaceNameDict.ContainsKey(place))
        {
            return GeneralDefine.equipPlaceNameDict[place];
        }