少年修仙传客户端代码仓库
client_linchunjie
2019-05-20 a7105bc2821035be49a27342eb380ae9b7b1d6c2
6850 【2.0】日常副本结算界面显示奖励
3个文件已修改
197 ■■■■■ 已修改文件
System/Dungeon/DungeonRewardItem.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Dungeon/DungeonSlayerVictoryWin.cs 159 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/FairyAu/FairyAuTaskWin.cs 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Dungeon/DungeonRewardItem.cs
@@ -31,7 +31,7 @@
        private void ShowItemTip()
        {
            ItemTipUtility.Show(serverItem.ItemID);
            ItemTipUtility.Show(itemId);
        }
        private void RequestSfx()
System/Dungeon/DungeonSlayerVictoryWin.cs
@@ -1,18 +1,141 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace Snxxz.UI
{
    public class DungeonSlayerVictoryWin : DungeonVictoryWin
    {
        protected override void Display()
        {
            m_ContainerPoivt.gameObject.SetActive(true);
            base.RequireDungeonExit();
            base.DrawPassTime();
            base.DrawGetExp();
            base.DrawItemRewards();
        }
    }
}
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace Snxxz.UI
{
    public class DungeonSlayerVictoryWin : DungeonVictoryWin
    {
        List<Item> items = new List<Item>();
        protected override void Display()
        {
            m_ContainerPoivt.gameObject.SetActive(true);
            base.RequireDungeonExit();
            base.DrawPassTime();
            m_ContainerExp.gameObject.SetActive(false);
            var result = dungeonModel.dungeonResult;
            items.Clear();
            if (result.totalExp > 0)
            {
                items.Add(new Item()
                {
                    itemId = GeneralDefine.expDisplayId,
                    count = result.totalExp,
                });
            }
            if (result.money != null && result.money.Length > 0)
            {
                for (int i = 0; i < result.money.Length; i++)
                {
                    var moneyType = result.money[i].moneyType;
                    if (GeneralDefine.moneyDisplayIds.ContainsKey(moneyType))
                    {
                        items.Add(new Item()
                        {
                            itemId = GeneralDefine.moneyDisplayIds[moneyType],
                            count = result.money[i].moneyValue,
                        });
                    }
                }
            }
            if (result.itemInfo != null)
            {
                for (int i = 0; i < result.itemInfo.Length; i++)
                {
                    items.Add(new Item()
                    {
                        itemId = result.itemInfo[i].ItemID,
                        count = result.itemInfo[i].Count,
                    });
                }
            }
            DrawItemRewards();
        }
        protected override void DrawItemRewards()
        {
            var merged = false;
            var hasReward = items.Count > 0;
            m_ContainerReward.gameObject.SetActive(hasReward);
            m_RewardIndexs.Clear();
            if (m_RewardTweens != null && m_RewardTweens.Length > 0)
            {
                for (int i = 0; i < m_RewardTweens.Length; i++)
                {
                    m_RewardTweens[i].SetEndState();
                }
            }
            if (items.Count > 0)
            {
                var itemModels = new List<ItemCellModel>();
                for (int i = 0; i < items.Count; i++)
                {
                    if (!merged && items[i].itemId == dungeonModel.specialItemCollectRecord.id)
                    {
                        itemModels.Add(new ItemCellModel(items[i].itemId, true,
                            (ulong)items[i].count + (ulong)dungeonModel.specialItemCollectRecord.count));
                        merged = true;
                    }
                    else
                    {
                        itemModels.Add(new ItemCellModel(items[i].itemId, true, (ulong)items[i].count));
                    }
                }
                for (int i = 0; i < passRewardBehaviours.Length; i++)
                {
                    var behaviour = passRewardBehaviours[i];
                    if (i < itemModels.Count)
                    {
                        behaviour.transform.parent.gameObject.SetActive(true);
                        behaviour.gameObject.SetActive(false);
                        behaviour.Init(itemModels[i]);
                        m_RewardIndexs.Add(m_SpecialItemCollect == null ? i : i + 1);
                    }
                    else
                    {
                        behaviour.transform.parent.gameObject.SetActive(false);
                        behaviour.gameObject.SetActive(false);
                    }
                }
                if (m_SpecialItemCollect != null)
                {
                    if (!merged && dungeonModel.specialItemCollectRecord.count > 0)
                    {
                        m_SpecialItemCollect.transform.parent.gameObject.SetActive(true);
                        m_SpecialItemCollect.gameObject.SetActive(false);
                        m_SpecialItemCollect.SetItem(dungeonModel.specialItemCollectRecord);
                        m_RewardIndexs.Insert(0, 0);
                    }
                    else
                    {
                        m_SpecialItemCollect.transform.parent.gameObject.SetActive(false);
                        m_SpecialItemCollect.gameObject.SetActive(false);
                    }
                }
            }
            if (m_RewardIndexs.Count > 0 && m_RewardTweens != null && m_RewardTweens.Length > 0)
            {
                PlayRewardTween(0);
            }
        }
        public struct Item
        {
            public int itemId;
            public long count;
        }
    }
}
System/FairyAu/FairyAuTaskWin.cs
@@ -366,24 +366,24 @@
        }
        void RewardInformationDisplay(List<RewardAnalysis.RewardInfo> rewardList)//奖励信息
        {
            if (_Grid.childCount != 0)
            {
                for (int i = 0; i < _Grid.childCount; i++)
                {
                    DestroyObject(_Grid.GetChild(i).gameObject);
                }
            }
            if (rewardList.Count == 0)
                return;
            var index = 0;
            for (int i = 0; i < rewardList.Count; i++)
            {
                GameObject go = GameObject.Instantiate(UILoader.LoadPrefab("ItemCell"));
                GameObject go = null;
                if (i >= _Grid.childCount)
                {
                    go = GameObject.Instantiate(UILoader.LoadPrefab("ItemCell"));
                    go.transform.SetParent(_Grid);
                    go.transform.localScale = Vector3.one;
                    Vector3 pos = go.transform.localPosition;
                    go.transform.localPosition = pos.SetZ(0);
                }
                else
                {
                    go = _Grid.GetChild(i).gameObject;
                }
                go.gameObject.SetActive(true);
                ItemCell itemcell = go.GetComponent<ItemCell>();
                go.transform.SetParent(_Grid);
                go.transform.localScale = Vector3.one;
                Vector3 pos = go.transform.localPosition;
                go.transform.localPosition = pos.SetZ(0);
                Button _button = go.transform.GetComponent<Button>();
                ItemCellModel cellModel = new ItemCellModel(rewardList[i].itemCfg.ID, true, (ulong)rewardList[i].num);
                itemcell.Init(cellModel);
                itemcell.button.RemoveAllListeners();
@@ -392,6 +392,12 @@
                {
                    ItemTipUtility.Show(rewardList[tab].itemCfg.ID);
                });
                index = i + 1;
            }
            for (int i = index; i < _Grid.childCount; i++)
            {
                _Grid.GetChild(i).gameObject.SetActive(false);
            }
        }
        void FairyAuRefresh()//仙盟任务的刷新或添加