hch
14 小时以前 f0b84a5808e4ee357e8770282b77c6355aec9404
0312 增加飘经验值
3个文件已修改
44 ■■■■ 已修改文件
Main/System/Battle/BattleObject/BattleObject.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Equip/EquipModel.cs 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Equip/ItemsOnFloor.cs 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Battle/BattleObject/BattleObject.cs
@@ -473,7 +473,7 @@
    public void PerformDrop()
    {
        if (null == m_battleDrops || m_battleDrops.dropItemPackIndex.Count == 0)
        if (null == m_battleDrops)
            return;
        EventBroadcast.Instance.Broadcast<string, BattleDrops, Action>(
Main/System/Equip/EquipModel.cs
@@ -11,7 +11,7 @@
    public const int TotleEquip = 12;  //装备栏大小
    public bool waitEquipOPPack = false;    // 穿戴装备的操作 不含分解
    public event Action<bool, int> OnEquipOPResultAction;    //是否换上了新装备且分解了 装备索引
    public event Action<List<int>, RectTransform> OnItemDropEvent;
    public event Action<BattleDrops> OnItemDropEvent;
    //用于飘动逻辑
    // public Dictionary<int, EquipOnFloorInfo> equipFloorInfo = new Dictionary<int, EquipOnFloorInfo>(); //真实背包的索引,对应地板装备的信息
@@ -98,9 +98,9 @@
        if (!string.IsNullOrEmpty(guid))
            return;
        lastDropIndexs = drops.dropItemPackIndex;
        // lastDropIndexs = drops.dropItemPackIndex;
        // Debug.Log("-掉落装备 " + lastDropIndexs.Count + " 个" + JsonMapper.ToJson(lastDropIndexs));
        NotifyItemDrop(drops.dropItemPackIndex, drops.rectTransform);
        NotifyItemDrop(drops);
        action?.Invoke();
    }
@@ -140,7 +140,7 @@
    //掉落通知
    public void NotifyItemDrop(List<int> indexs, RectTransform rect)
    public void NotifyItemDrop(BattleDrops drops)//(List<int> indexs, RectTransform rect)
    {
        // 界面不显示则立即处理
        // if (!UIManager.Instance.IsOpened<HomeWin>())
@@ -154,7 +154,7 @@
        // {
        //     OnItemDropEvent?.Invoke(indexs, rect);
        // }
        OnItemDropEvent?.Invoke(indexs, rect);
        OnItemDropEvent?.Invoke(drops);
    }
    public void CalcFloorEquip(int itemIndex)
Main/System/Equip/ItemsOnFloor.cs
@@ -12,7 +12,7 @@
    [SerializeField] FloorItemCell floorItemCell;    //非装备显示组件
    [SerializeField] MoneyMoveByPath moneyMoveByPathCell;     //掉落物金钱
    [SerializeField] RectTransform defaultDropRect;     //默认掉落位置
    [SerializeField] Text[] expTexts;
    FloorItemCell[] floorItemCells = new FloorItemCell[20];    //包含非装备的战利品掉落
    MoneyMoveByPath[] moneyMoveByPathArr = new MoneyMoveByPath[20];  //掉落货币,金钱,经验等
@@ -48,6 +48,10 @@
        Display(true, EquipModel.Instance.lastDropIndexs);
        EquipModel.Instance.OnItemDropEvent += NotifyPlayItemDrop;
        PackManager.Instance.DeleteItemEvent += DeleteDropItem;
        for (int i = 0; i < expTexts.Length; i++)
        {
            expTexts[i].text = "";
        }
    }
@@ -59,11 +63,33 @@
    }
    void NotifyPlayItemDrop(List<int> itemIndexs, RectTransform rect)
    void NotifyPlayItemDrop(BattleDrops drops)
    {
        Display(true, itemIndexs, rect);
        if (drops.dropItemPackIndex.Count > 0)
        {
            Display(true, drops.dropItemPackIndex, drops.rectTransform);
        }
        DisplayExp(drops);
    }
    int expIndex = 0;
    void DisplayExp(BattleDrops drops)
    {
        // startPos = new Vector2(transform.localPosition.x + UnityEngine.Random.Range(-30, 30), transform.localPosition.y + UnityEngine.Random.Range(50, 100));
        if (drops.expDrops.Count > 0)
        {
            var nowIndex = expIndex;
            expTexts[nowIndex].text = "E+" + (drops.expDrops[0].Exp + drops.expDrops[0].ExpPoint * Constants.ExpPointValue);
            expTexts[nowIndex].transform.position = drops.rectTransform.position;
            expTexts[nowIndex].transform.DOLocalMove(expTexts[nowIndex].transform.localPosition + new Vector3(0, 20, 0), 1f).SetEase(Ease.InOutSine).onComplete = () =>
            {
                expTexts[nowIndex].text = "";
            };
            expIndex = (expIndex + 1) % 6;
        }
    }
    void DeleteDropItem(PackType packType, string guid, int itemID, int index, int clearType)
    {