少年修仙传客户端代码仓库
client_Wu Xijin
2018-11-15 2dccba0c26cb52f93bcfd68742ec18983056176a
Merge remote-tracking branch 'origin/master' into builtinmove
3个文件已修改
173 ■■■■■ 已修改文件
Fight/GameActor/GActorNpcFight.cs 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Fight/GameActor/GActorNpcNoFight.cs 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Strengthening/WashTips.cs 127 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Fight/GameActor/GActorNpcFight.cs
@@ -55,28 +55,32 @@
        base.OnInit(package);
        m_LoadDefaultRes = false;
        var _package = package as H0406_tagNPCAppear;
        if (_package != null)
        int _npcID = 0;
        if (this is GA_NpcSummonFight)
        {
            NpcConfig = Config.Instance.Get<NPCConfig>((int)_package.NPCID);
            _npcID = (int)(package as H0408_tagPlayerSummonNPCAppear).NPCID;
        }
        else if (this is GA_Pet)
        {
            _npcID = (int)(package as H0435_tagPetAppear).NPCID;
        }
        else
        {
            var _package2 = package as H0408_tagPlayerSummonNPCAppear;
            if (_package2 != null)
            {
                NpcConfig = Config.Instance.Get<NPCConfig>((int)_package2.NPCID);
            }
            else
            {
                return;
            }
            _npcID = (int)(package as H0406_tagNPCAppear).NPCID;
        }
        if (_npcID == 0)
        {
            Debug.LogError("加载异常....");
            return;
        }
        NpcConfig = Config.Instance.Get<NPCConfig>(_npcID);
        if (NpcConfig == null)
        {
            // 报错
            Debug.LogError("配置异常....: " + _npcID);
            return;
        }
Fight/GameActor/GActorNpcNoFight.cs
@@ -28,14 +28,22 @@
    {
        m_LoadDefaultRes = false;
        var _package = package as H0406_tagNPCAppear;
        if (_package == null)
        int _npcID = 0;
        if (this is GA_NpcSummonFunc)
        {
            Debug.LogError("非战斗单位封包传入错误: " + package.GetType());
            _npcID = (int)(package as H0408_tagPlayerSummonNPCAppear).NPCID;
        }
        else
        {
            _npcID = (int)(package as H0406_tagNPCAppear).NPCID;
        }
        if (_npcID == 0)
        {
            return;
        }
        NpcConfig = Config.Instance.Get<NPCConfig>((int)_package.NPCID);
        NpcConfig = Config.Instance.Get<NPCConfig>(_npcID);
        if (NpcConfig == null)
        {
System/Strengthening/WashTips.cs
@@ -10,27 +10,32 @@
public class WashTips : MonoBehaviour
{
    #region 成员变量
    private Text _costMoneyText;
    private Text _washLevelTitle;
    private Button _washBtn;
    private Button _saveBtn;
    private Button _cancelBtn;
    private Button _upgradeBtn;
    private Button _washMasterBtn;
    private Text _specWashOpenCondition;
    private Text _specWashFullText;
    private GameObject _openSpecWashPro;
    private ScrollRect _selectWashRect;
    private ScrollerController _equipWashCtrl;
    private Text _washFullLvText;
    private ItemCell _costMatCell;
    private ItemCell _washEquipCell;
    private WashPro _attackWashPro; //攻击洗练属性
    private WashPro _lifeWashPro; //生命
    private WashPro _ignoreDefenceWashPro; //无视防御
    private ToggleGroup _cellGroup;
    private GameObject noEquipObj;
    [SerializeField]
    [SerializeField] Text _costMoneyText;
    [SerializeField] Text _washLevelTitle;
    [SerializeField] Button _washBtn;
    [SerializeField] Button _saveBtn;
    [SerializeField] Button _cancelBtn;
    [SerializeField] Button _upgradeBtn;
    [SerializeField] Button _washMasterBtn;
    [SerializeField] Text _specWashOpenCondition;
    [SerializeField] Text _specWashFullText;
    [SerializeField] GameObject _openSpecWashPro;
    [SerializeField] ScrollRect _selectWashRect;
    [SerializeField] ScrollerController _equipWashCtrl;
    [SerializeField] Text _washFullLvText;
    [SerializeField] ItemCell _costMatCell;
    [SerializeField] ItemCell _washEquipCell;
    [SerializeField] WashPro _attackWashPro; //攻击洗练属性
    [SerializeField] WashPro _lifeWashPro; //生命
    [SerializeField] WashPro _ignoreDefenceWashPro; //无视防御
    [SerializeField] ToggleGroup _cellGroup;
    [SerializeField] GameObject noEquipObj;
    [SerializeField] GameObject contain_Cost;
    [SerializeField] ItemCell contain_Cost_NormalItem;
    [SerializeField] ItemCell contain_Cost_MustAddItem;
    [SerializeField] Text contain_Cost_Money;
    [SerializeField] GameObject contain_Default;
    List<Text> specAttrNameText = new List<Text>();
    [SerializeField]
    List<Text> specAttrValueText = new List<Text>();
@@ -104,30 +109,8 @@
    private void Awake()
    {
        _washEquipCell = transform.Find("EquipInfoBG/WashItemBottom/ItemCell").GetComponent<ItemCell>();
        noEquipObj = transform.Find("EquipInfoBG/WashItemBottom/NoEquip").gameObject;
        _costMatCell = transform.Find("CostItem/ItemCell").GetComponent<ItemCell>();
        _washFullLvText = transform.Find("FullLvText").GetComponent<Text>();
        _selectWashRect = transform.Find("SelectList").GetComponent<ScrollRect>();
        _washBtn = transform.Find("WashBtn").GetComponent<Button>();
        _saveBtn = transform.Find("SaveBtn").GetComponent<Button>();
        _cancelBtn = transform.Find("CancelBtn").GetComponent<Button>();
        _upgradeBtn = transform.Find("UpgrdeBtn").GetComponent<Button>();
        _washMasterBtn = transform.Find("WashMasterBtn").GetComponent<Button>();
        _attackWashPro = transform.Find("AttributeInfo/Attribute01").GetComponent<WashPro>();
        _lifeWashPro = transform.Find("AttributeInfo/Attribute02").GetComponent<WashPro>();
        _ignoreDefenceWashPro = transform.Find("AttributeInfo/Attribute03").GetComponent<WashPro>();
        _washLevelTitle = transform.Find("AttributeInfo/TitleBG/TitleText").GetComponent<Text>();
        _costMoneyText = transform.Find("CostItem/Money/MoneyCountText").GetComponent<Text>();
        _specWashOpenCondition = transform.Find("AttributeInfo/WashMaster/SpecWashOpenCondition").GetComponent<Text>();
        _specWashFullText = transform.Find("AttributeInfo/WashMasterFull").GetComponent<Text>();
        _specWashOpenCondition.gameObject.SetActive(true);
        _specWashFullText.gameObject.SetActive(false);
        _openSpecWashPro = transform.Find("AttributeInfo/WashMaster/SpecWashPro").gameObject;
        _equipWashCtrl = transform.Find("EquipWashCtrl").GetComponent<ScrollerController>();
        _cellGroup = _equipWashCtrl.GetComponent<ToggleGroup>();
        _equipWashCtrl.OnRefreshCell += RefreshEquipWashCell;
        EquipReinforceEventMgr.Instance.RefreshWashCostMoneyEvent = RefreshCostMoney;
        _openSpecWashPro.SetActive(false);
@@ -361,6 +344,64 @@
    }
    public void UpdateWashMat()
    {
        bool isMustAdd = GetMustAddNum() > 0 ? true : false;
        contain_Cost.SetActive(isMustAdd);
        contain_Default.SetActive(!isMustAdd);
        if (!isMustAdd)
        {
            UpdateItemCell(_tagWashModel.costItem,_costMatCell,_tagWashModel.costCount);
        }
        else
        {
            UpdateItemCell(_tagWashModel.costItem, contain_Cost_NormalItem, _tagWashModel.costCount);
        }
    }
    private void UpdateItemCell(int itemId,ItemCell itemCell,int needNum)
    {
        ItemCellModel cellModel = new ItemCellModel(itemId);
        itemCell.Init(cellModel);
        itemCell.countText.gameObject.SetActive(true);
        int haveNum = playerPack.GetItemCountByID(PackType.rptItem,itemId);
        string matNumStr = string.Empty;
        if (haveNum >= needNum)
        {
            matNumStr = UIHelper.AppendStringColor(TextColType.Green,haveNum.ToString(), true);
        }
        else
        {
            matNumStr = UIHelper.AppendStringColor(TextColType.Red,haveNum.ToString());
        }
        itemCell.countText.text = StringUtility.Contact(matNumStr, "/",needNum);
        itemCell.cellBtn.RemoveAllListeners();
        itemCell.cellBtn.onClick.AddListener(() =>
        {
            itemPathModel.SetChinItemModel(itemId);
        });
    }
    public int GetMustAddNum()
    {
        int needAddCount = 0;
        if (_attackWashPro.toggleIsOn)
        {
            needAddCount += 1;
        }
        if (_lifeWashPro.toggleIsOn)
        {
            needAddCount += 1;
        }
        if (_ignoreDefenceWashPro.toggleIsOn)
        {
            needAddCount += 1;
        }
        return needAddCount;
    }
    //刷新仙玉
    public void RefreshCostMoney()
    {