From 725b7b2374f43582a2d78b2cae3f8303359651b8 Mon Sep 17 00:00:00 2001
From: yyl <yyl>
Date: 星期一, 10 十一月 2025 14:30:53 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.1.20:10010/r/Project_SG_scripts
---
Main/System/Equip/ItemsOnFloor.cs | 32 +++++++++++++++++++++++++++++---
1 files changed, 29 insertions(+), 3 deletions(-)
diff --git a/Main/System/Equip/ItemsOnFloor.cs b/Main/System/Equip/ItemsOnFloor.cs
index 2cafd37..038d2d8 100644
--- a/Main/System/Equip/ItemsOnFloor.cs
+++ b/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)
{
--
Gitblit v1.8.0