少年修仙传客户端代码仓库
client_linchunjie
2019-01-10 387e23c3ec5cf027f9f87af7162a5e49c65e4906
Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_scripts
3个文件已修改
109 ■■■■■ 已修改文件
System/KnapSack/Logic/ItemInfoWin.cs 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/KnapSack/Logic/ModelShowPerfab.cs 87 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UI/Common/UI3DShowHero.cs 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/KnapSack/Logic/ItemInfoWin.cs
@@ -180,6 +180,11 @@
                    mountSkillDict = itemTipsModel.GetMountSkillDict(itemTipsModel.curAttrData.itemConfig.EffectValueA1);
                    modelShow.SetModelShow(horseConfig.Model, ModelShowType.mount, Language.Get("TreasureEffect103"), horseConfig.ShowFightPower);
                    break;
                case 83:
                    bgObj.anchoredPosition3D = new Vector3(197, 0, 0);
                    modelShow.gameObject.SetActive(true);
                    modelShow.SetModelShow(itemTipsModel.curAttrData.itemConfig.EffectValueA1, ModelShowType.FashionDress, Language.Get("TreasureEffect103"));
                    break;
                default:
                    modelShow.gameObject.SetActive(false);
                    bgObj.anchoredPosition3D = Vector3.zero;
System/KnapSack/Logic/ModelShowPerfab.cs
@@ -1,6 +1,7 @@
using UnityEngine;
using UnityEngine.UI;
using TableConfig;
using System.Collections.Generic;
namespace Snxxz.UI
{
@@ -12,6 +13,11 @@
        [SerializeField] public GameObject fightImg;
        ModelShowType showType;
        FashionDressModel fashionDressModel { get { return ModelCenter.Instance.GetModel<FashionDressModel>(); } }
        MagicianModel godWeaponModel
        {
            get { return ModelCenter.Instance.GetModel<MagicianModel>(); }
        }
        public void OnDisable()
        {
@@ -31,6 +37,7 @@
        {
            titleText.text = title;
            this.showType = showType;
            var job = PlayerDatas.Instance.baseData.Job;
            switch (showType)
            {
                case ModelShowType.treasure:
@@ -42,6 +49,9 @@
                case ModelShowType.pet:
                    var config = Config.Instance.Get<NPCConfig>(id);
                    UI3DModelExhibition.Instance.ShowNPC(id, config.UIModeLOffset, config.UIModelRotation, modelImg);
                    break;
                case ModelShowType.FashionDress:
                    UI3DModelExhibition.Instance.ShowOtherPlayer(modelImg,SetFashionDressData(id));
                    break;
            }
@@ -57,12 +67,87 @@
                fightPowerText.text = fightValue.ToString();
            }
        }
        public UI3DPlayerExhibitionData SetFashionDressData(int fashionId)
        {
            var job = PlayerDatas.Instance.baseData.Job;
            var playerPack = ModelCenter.Instance.GetModel<PlayerPackModel>();
            var clothes = playerPack.GetItemModelByIndex(PackType.rptEquip, (int)RoleEquipType.retClothes);
            var clothesId = clothes == null ? 0 : (int)clothes.itemInfo.ItemID;
            var weapon = playerPack.GetItemModelByIndex(PackType.rptEquip, (int)RoleEquipType.retWeapon);
            var weaponId = weapon == null ? 0 : (int)weapon.itemInfo.ItemID;
            var wings = playerPack.GetItemModelByIndex(PackType.rptEquip, (int)RoleEquipType.retWing);
            var wingsId = wings == null ? 0 : (int)wings.itemInfo.ItemID;
            var secondary = playerPack.GetItemModelByIndex(PackType.rptEquip, (int)RoleEquipType.retWeapon2);
            var secondaryId = secondary == null ? 0 : (int)secondary.itemInfo.ItemID;
            FashionDress fashionDress = null;
            bool isFashion = fashionDressModel.TryGetFashionDress(fashionId,out fashionDress);
            if(isFashion)
            {
                int itemId = fashionDress.requireLevelUpItem;
                var itemConfig = Config.Instance.Get<ItemConfig>(itemId);
                switch(fashionDress.fashionDressType)
                {
                    case 1:
                        clothesId = fashionDress.GetEquipItemId();
                        break;
                    case 2:
                        weaponId = fashionDress.GetEquipItemId();
                        break;
                    case 3:
                        secondaryId = fashionDress.GetEquipItemId();
                        break;
                }
            }
            int _suitLevel = 0;
            if (clothes != null)
            {
                if (clothes.itemInfo.IsSuite == 1)
                {
                    if (clothes.GetUseDataModel(30) != null && clothes.GetUseDataModel(30)[0] != 0)
                    {
                        _suitLevel = clothes.GetUseDataModel(30)[0];
                    }
                }
            }
            Dictionary<int, int> dict = new Dictionary<int, int>();
            for (int i = 0; i < godWeaponModel.godWeaponTypes.Count; i++)
            {
                var type = godWeaponModel.godWeaponTypes[i];
                var godWeaponInfo = godWeaponModel.GetGodWeaponInfo(type);
                var equipedLevel = godWeaponInfo != null ? godWeaponInfo.level : 0;
                dict[type] = equipedLevel;
            }
            UI3DPlayerExhibitionData data = new UI3DPlayerExhibitionData()
            {
                job = job,
                clothesId = clothesId,
                suitLevel = _suitLevel,
                weaponId = weaponId,
                wingsId = wingsId,
                secondaryId = secondaryId,
                isDialogue = false,
                godWeapons = dict
            };
            return data;
        }
    }
    public enum ModelShowType
    {
        treasure, //法宝
        mount, //坐骑
        pet,
        pet, //灵宠
        FashionDress, //时装
    }
}
UI/Common/UI3DShowHero.cs
@@ -89,7 +89,22 @@
            }
            PutOnSecondary(job, secondaryResId);
            var extraSecondaryId = (data.job == 1 && data.fashionSecondaryId > 0) ? this.clothesId + 2900 : 0;
            var extraSecondaryId = 0;
            if (data.job == 1 && data.fashionSecondaryId > 0)
            {
                if (data.clothesId == 0)
                {
                    extraSecondaryId = jobConfig.BaseEquip[0] + 2900;
                }
                else
                {
                    var item = Config.Instance.Get<ItemConfig>(data.clothesId);
                    var defaultClothesResId = item == null ? jobConfig.BaseEquip[0] : item.ChangeOrd;
                    extraSecondaryId = defaultClothesResId + 2900;
                }
            }
            PutOnExtraSecondary(job, extraSecondaryId);
            var wingsResId = 0;