|
@@ -3,6 +3,7 @@ using CombatLibrary.CombatLibrary.CombatCore.Utility;
|
|
|
using Common.Utility.CombatEvent;
|
|
|
using Fort23.Core;
|
|
|
using Fort23.UTool;
|
|
|
+using OfficeOpenXml.FormulaParsing.Excel.Functions.Logical;
|
|
|
using UnityEngine;
|
|
|
using UnityEngine.UI;
|
|
|
using Utility.UITool;
|
|
@@ -17,7 +18,8 @@ namespace Fort23.Mono
|
|
|
public static async CTask OpenShowItemMoveToTargetPanel()
|
|
|
{
|
|
|
ShowItemMoveToTargetPanel showItemMoveToTargetPanel =
|
|
|
- await UIManager.Instance.LoadAndOpenPanel<ShowItemMoveToTargetPanel>(null, UILayer.Middle, isFocus: false);
|
|
|
+ await UIManager.Instance.LoadAndOpenPanel<ShowItemMoveToTargetPanel>(null, UILayer.Middle,
|
|
|
+ isFocus: false);
|
|
|
}
|
|
|
|
|
|
public static async void OpenShowItemMoveToTargetPanel(Vector2 startPos, Vector2 target,
|
|
@@ -79,17 +81,53 @@ namespace Fort23.Mono
|
|
|
{
|
|
|
Vector2 target = moveTarget.GetComponent<RectTransform>().anchoredPosition;
|
|
|
CombatItemShowEventData combatItemShowEventData = iEventData as CombatItemShowEventData;
|
|
|
- if (combatItemShowEventData.isExp)
|
|
|
+ bool isExp = combatItemShowEventData.isExp;
|
|
|
+ if (isExp)
|
|
|
{
|
|
|
MainUIPanel mainUIPanel = UIManager.Instance.GetComponent<MainUIPanel>();
|
|
|
Vector3 pos = mainUIPanel.expPoint.position;
|
|
|
target = transform.worldToLocalMatrix * pos;
|
|
|
}
|
|
|
+
|
|
|
Vector3 p = UIManager.Instance.CurrCustomCameraStack.camera.WorldToScreenPoint(
|
|
|
combatItemShowEventData.startPos_WorldPos);
|
|
|
Vector3 p2 = UIManager.Instance.UICamera.ScreenToWorldPoint(p);
|
|
|
Vector3 startPos = transform.worldToLocalMatrix * p2;
|
|
|
- ShowPanel(startPos, target, combatItemShowEventData.count, combatItemShowEventData.showName);
|
|
|
+ ShowPanel(startPos, target, combatItemShowEventData.count, combatItemShowEventData.showName, delegate
|
|
|
+ {
|
|
|
+ MainUIPanel mainUIPanel = UIManager.Instance.GetComponent<MainUIPanel>();
|
|
|
+ if (mainUIPanel == null)
|
|
|
+ {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (isExp)
|
|
|
+ {
|
|
|
+ if (mainUIPanel != null)
|
|
|
+ {
|
|
|
+ ParticleSystemPool particleSystemPool =
|
|
|
+ GObjectPool.Instance.FetchAsyncForGameObject<ParticleSystemPool>(mainUIPanel.fx_ui_exp,
|
|
|
+ "fx_ui_exp");
|
|
|
+ particleSystemPool.transform.SetParent(mainUIPanel.expPoint.transform);
|
|
|
+ particleSystemPool.transform.localPosition = Vector3.zero;
|
|
|
+ particleSystemPool.transform.localScale = Vector3.one;
|
|
|
+ // particleSystemPool.transform.
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ if (mainUIPanel != null)
|
|
|
+ {
|
|
|
+ ParticleSystemPool particleSystemPool =
|
|
|
+ GObjectPool.Instance.FetchAsyncForGameObject<ParticleSystemPool>(mainUIPanel.fx_ui_coin,
|
|
|
+ "fx_ui_coin");
|
|
|
+ particleSystemPool.transform.SetParent(mainUIPanel.Icon_Coin.transform);
|
|
|
+ particleSystemPool.transform.localPosition = Vector3.zero;
|
|
|
+ particleSystemPool.transform.localScale = Vector3.one;
|
|
|
+ // particleSystemPool.transform.
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
protected void RenderUpdateCallBack()
|
|
@@ -111,7 +149,7 @@ namespace Fort23.Mono
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public void AddACurve(Vector2 startPos, Vector2 target, string itemConfig)
|
|
|
+ public void AddACurve(Vector2 startPos, Vector2 target, string itemConfig, System.Action finishCallBack)
|
|
|
{
|
|
|
ACurve aCurve = new ACurve();
|
|
|
CurveInfo curveInfo = new CurveInfo();
|
|
@@ -144,6 +182,7 @@ namespace Fort23.Mono
|
|
|
aCurve.CurveInfos.Add(curveInfo2);
|
|
|
aCurve.CurveType = CurveType.BSL;
|
|
|
ImageMove currImageMove = new ImageMove();
|
|
|
+ currImageMove.finishCallBack = finishCallBack;
|
|
|
currImageMove.SizeCurve = AnimationCurveManager.Instance.AnimationCurveLibrary.ui_moveSize;
|
|
|
currImageMove.moveSpeed = AnimationCurveManager.Instance.AnimationCurveLibrary.ui_moveSpped;
|
|
|
// currImageMove.ShowSizeCurve = AnimationCurveManager.Instance.AnimationCurveLibrary.ui_showSize;
|
|
@@ -154,11 +193,8 @@ namespace Fort23.Mono
|
|
|
gameObjectPool.own.SetActive(false);
|
|
|
gameObjectPool.own.transform.localScale = Vector3.zero;
|
|
|
currImageMove.GameObjectPool = gameObjectPool;
|
|
|
- MyImage myImage= gameObjectPool.own.GetComponent<MyImage>();
|
|
|
- myImage.onSpriteAlter= delegate
|
|
|
- {
|
|
|
- myImage.SetNativeSize();
|
|
|
- };
|
|
|
+ MyImage myImage = gameObjectPool.own.GetComponent<MyImage>();
|
|
|
+ myImage.onSpriteAlter = delegate { myImage.SetNativeSize(); };
|
|
|
myImage.icon_name = itemConfig;
|
|
|
currImageMove.transform = gameObjectPool.own.GetComponent<RectTransform>();
|
|
|
// currImageMove.transform.sizeDelta = new Vector2(35, 35);
|
|
@@ -168,11 +204,11 @@ namespace Fort23.Mono
|
|
|
currImageMove.yanChi = Random.Range(0, 0.5f);
|
|
|
currImageMove.speed = AnimationCurveManager.Instance.AnimationCurveLibrary.uiMoveSpeed;
|
|
|
currImageMove.currAcur = aCurve;
|
|
|
-
|
|
|
allImageMove.Add(currImageMove);
|
|
|
}
|
|
|
|
|
|
- public void ShowPanel(Vector2 startPos, Vector2 target, int count, string showName)
|
|
|
+ public void ShowPanel(Vector2 startPos, Vector2 target, int count, string showName,
|
|
|
+ System.Action finishCallBack = null)
|
|
|
{
|
|
|
if (target.x == -5000)
|
|
|
{
|
|
@@ -181,7 +217,7 @@ namespace Fort23.Mono
|
|
|
|
|
|
for (int i = 0; i < count; i++)
|
|
|
{
|
|
|
- AddACurve(startPos, target, showName);
|
|
|
+ AddACurve(startPos, target, showName, finishCallBack);
|
|
|
}
|
|
|
}
|
|
|
}
|