|
@@ -3,6 +3,9 @@ using CombatLibrary.CombatLibrary.CombatCore.Utility;
|
|
using Common.Utility.CombatEvent;
|
|
using Common.Utility.CombatEvent;
|
|
using Fort23.Core;
|
|
using Fort23.Core;
|
|
using Fort23.UTool;
|
|
using Fort23.UTool;
|
|
|
|
+using GameLogic.Bag;
|
|
|
|
+using GameLogic.Combat.CombatTool;
|
|
|
|
+using GameLogic.Combat.CombatType;
|
|
using OfficeOpenXml.FormulaParsing.Excel.Functions.Logical;
|
|
using OfficeOpenXml.FormulaParsing.Excel.Functions.Logical;
|
|
using UnityEngine;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
using UnityEngine.UI;
|
|
@@ -22,40 +25,6 @@ namespace Fort23.Mono
|
|
isFocus: false);
|
|
isFocus: false);
|
|
}
|
|
}
|
|
|
|
|
|
- public static async void OpenShowItemMoveToTargetPanel(Vector2 startPos, Vector2 target,
|
|
|
|
- bool isStartPosUseWorld, bool isEndPosUseWorld,
|
|
|
|
- List<string> allItem)
|
|
|
|
- {
|
|
|
|
- ShowItemMoveToTargetPanel showItemMoveToTargetPanel =
|
|
|
|
- await UIManager.Instance.LoadAndOpenPanel<ShowItemMoveToTargetPanel>(null, UILayer.Top, isFocus: false);
|
|
|
|
- if (isStartPosUseWorld)
|
|
|
|
- {
|
|
|
|
- startPos = showItemMoveToTargetPanel.transform.worldToLocalMatrix * startPos;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (isEndPosUseWorld)
|
|
|
|
- {
|
|
|
|
- target = showItemMoveToTargetPanel.transform.worldToLocalMatrix * target;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- showItemMoveToTargetPanel.ShowPanel(startPos, target, allItem.Count, "");
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- public static async void OpenShowItemMoveToTargetPanel(List<string> allItem)
|
|
|
|
- {
|
|
|
|
- ShowItemMoveToTargetPanel showItemMoveToTargetPanel =
|
|
|
|
- await UIManager.Instance.LoadAndOpenPanel<ShowItemMoveToTargetPanel>(null, UILayer.Top, isFocus: false);
|
|
|
|
- Vector2 target = showItemMoveToTargetPanel.moveTarget.GetComponent<RectTransform>().anchoredPosition;
|
|
|
|
- showItemMoveToTargetPanel.moveTarget.gameObject.SetActive(true);
|
|
|
|
- showItemMoveToTargetPanel.ShowPanel(new Vector2(), target, allItem.Count, "");
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- public static async void OpenShowItemMoveToTargetPanel(Vector2 startPos, Vector2 target, List<string> allItem)
|
|
|
|
- {
|
|
|
|
- ShowItemMoveToTargetPanel showItemMoveToTargetPanel =
|
|
|
|
- await UIManager.Instance.LoadAndOpenPanel<ShowItemMoveToTargetPanel>(null, UILayer.Top, isFocus: false);
|
|
|
|
- showItemMoveToTargetPanel.ShowPanel(startPos, target, allItem.Count, "");
|
|
|
|
- }
|
|
|
|
|
|
|
|
private void Init()
|
|
private void Init()
|
|
{
|
|
{
|
|
@@ -93,41 +62,73 @@ namespace Fort23.Mono
|
|
combatItemShowEventData.startPos_WorldPos);
|
|
combatItemShowEventData.startPos_WorldPos);
|
|
Vector3 p2 = UIManager.Instance.UICamera.ScreenToWorldPoint(p);
|
|
Vector3 p2 = UIManager.Instance.UICamera.ScreenToWorldPoint(p);
|
|
Vector3 startPos = transform.worldToLocalMatrix * p2;
|
|
Vector3 startPos = transform.worldToLocalMatrix * p2;
|
|
- ShowPanel(startPos, target, combatItemShowEventData.count, combatItemShowEventData.showName, delegate
|
|
|
|
- {
|
|
|
|
- MainUIPanel mainUIPanel = UIManager.Instance.GetComponent<MainUIPanel>();
|
|
|
|
- if (mainUIPanel == null)
|
|
|
|
- {
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
|
|
+ int maxCount = combatItemShowEventData.count;
|
|
|
|
+ int addValue = combatItemShowEventData.addValue / maxCount;
|
|
|
|
+ int finishVale = combatItemShowEventData.addValue % maxCount;
|
|
|
|
|
|
- if (isExp)
|
|
|
|
|
|
+ ShowPanel(startPos, target, maxCount, combatItemShowEventData.showName, isExp,
|
|
|
|
+ delegate(ImageMove imageMove)
|
|
{
|
|
{
|
|
- if (mainUIPanel != null)
|
|
|
|
|
|
+ MainUIPanel mainUIPanel = UIManager.Instance.GetComponent<MainUIPanel>();
|
|
|
|
+ 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.
|
|
|
|
|
|
+ return;
|
|
}
|
|
}
|
|
- }
|
|
|
|
- else
|
|
|
|
- {
|
|
|
|
- if (mainUIPanel != null)
|
|
|
|
|
|
+
|
|
|
|
+ int currAddValue = addValue;
|
|
|
|
+ if (imageMove.GroupIndex == maxCount - 1)
|
|
{
|
|
{
|
|
- 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.
|
|
|
|
|
|
+ currAddValue += finishVale;
|
|
}
|
|
}
|
|
- }
|
|
|
|
- });
|
|
|
|
|
|
+
|
|
|
|
+ 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;
|
|
|
|
+ LevelBattleCombatType levelBattleCombatType =
|
|
|
|
+ CombatController.currActiveCombat.CombatTypeBasic as LevelBattleCombatType;
|
|
|
|
+ if (levelBattleCombatType != null)
|
|
|
|
+ {
|
|
|
|
+ levelBattleCombatType.exp += currAddValue;
|
|
|
|
+ }
|
|
|
|
+ // 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;
|
|
|
|
+ BagController.Instance.AddCoin(currAddValue);
|
|
|
|
+ // particleSystemPool.transform.
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }, SetTargetPoint);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private void SetTargetPoint(ImageMove imageMove)
|
|
|
|
+ {
|
|
|
|
+ if (imageMove.isExp)
|
|
|
|
+ {
|
|
|
|
+ MainUIPanel mainUIPanel = UIManager.Instance.GetComponent<MainUIPanel>();
|
|
|
|
+ Vector3 pos = mainUIPanel.expPoint.position;
|
|
|
|
+ Vector3 target = transform.worldToLocalMatrix * pos;
|
|
|
|
+ CurveInfo curveInfo = imageMove.currAcur.CurveInfos[1];
|
|
|
|
+ curveInfo.t = target.x;
|
|
|
|
+ curveInfo.v = target.y;
|
|
|
|
+ imageMove.currAcur.CurveInfos[1] = curveInfo;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
protected void RenderUpdateCallBack()
|
|
protected void RenderUpdateCallBack()
|
|
@@ -149,7 +150,8 @@ namespace Fort23.Mono
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- public void AddACurve(Vector2 startPos, Vector2 target, string itemConfig, System.Action finishCallBack)
|
|
|
|
|
|
+ public ImageMove AddACurve(Vector2 startPos, Vector2 target, string itemConfig, bool isExp,
|
|
|
|
+ System.Action<ImageMove> finishCallBack, System.Action<ImageMove> targetPointSet)
|
|
{
|
|
{
|
|
ACurve aCurve = new ACurve();
|
|
ACurve aCurve = new ACurve();
|
|
CurveInfo curveInfo = new CurveInfo();
|
|
CurveInfo curveInfo = new CurveInfo();
|
|
@@ -181,8 +183,10 @@ namespace Fort23.Mono
|
|
aCurve.CurveInfos.Add(curveInfo);
|
|
aCurve.CurveInfos.Add(curveInfo);
|
|
aCurve.CurveInfos.Add(curveInfo2);
|
|
aCurve.CurveInfos.Add(curveInfo2);
|
|
aCurve.CurveType = CurveType.BSL;
|
|
aCurve.CurveType = CurveType.BSL;
|
|
- ImageMove currImageMove = new ImageMove();
|
|
|
|
|
|
+ ImageMove currImageMove = CObjectPool.Instance.Fetch<ImageMove>();
|
|
currImageMove.finishCallBack = finishCallBack;
|
|
currImageMove.finishCallBack = finishCallBack;
|
|
|
|
+ currImageMove.targetPointSet = targetPointSet;
|
|
|
|
+ currImageMove.isExp = isExp;
|
|
currImageMove.SizeCurve = AnimationCurveManager.Instance.AnimationCurveLibrary.ui_moveSize;
|
|
currImageMove.SizeCurve = AnimationCurveManager.Instance.AnimationCurveLibrary.ui_moveSize;
|
|
currImageMove.moveSpeed = AnimationCurveManager.Instance.AnimationCurveLibrary.ui_moveSpped;
|
|
currImageMove.moveSpeed = AnimationCurveManager.Instance.AnimationCurveLibrary.ui_moveSpped;
|
|
// currImageMove.ShowSizeCurve = AnimationCurveManager.Instance.AnimationCurveLibrary.ui_showSize;
|
|
// currImageMove.ShowSizeCurve = AnimationCurveManager.Instance.AnimationCurveLibrary.ui_showSize;
|
|
@@ -199,16 +203,16 @@ namespace Fort23.Mono
|
|
currImageMove.transform = gameObjectPool.own.GetComponent<RectTransform>();
|
|
currImageMove.transform = gameObjectPool.own.GetComponent<RectTransform>();
|
|
// currImageMove.transform.sizeDelta = new Vector2(35, 35);
|
|
// currImageMove.transform.sizeDelta = new Vector2(35, 35);
|
|
currImageMove.moveStartPos = startPos;
|
|
currImageMove.moveStartPos = startPos;
|
|
- currImageMove.moveTargetPos = moveTargetPos;
|
|
|
|
currImageMove.transform.anchoredPosition = currImageMove.moveStartPos;
|
|
currImageMove.transform.anchoredPosition = currImageMove.moveStartPos;
|
|
currImageMove.yanChi = Random.Range(0, 0.5f);
|
|
currImageMove.yanChi = Random.Range(0, 0.5f);
|
|
currImageMove.speed = AnimationCurveManager.Instance.AnimationCurveLibrary.uiMoveSpeed;
|
|
currImageMove.speed = AnimationCurveManager.Instance.AnimationCurveLibrary.uiMoveSpeed;
|
|
currImageMove.currAcur = aCurve;
|
|
currImageMove.currAcur = aCurve;
|
|
allImageMove.Add(currImageMove);
|
|
allImageMove.Add(currImageMove);
|
|
|
|
+ return currImageMove;
|
|
}
|
|
}
|
|
|
|
|
|
- public void ShowPanel(Vector2 startPos, Vector2 target, int count, string showName,
|
|
|
|
- System.Action finishCallBack = null)
|
|
|
|
|
|
+ public void ShowPanel(Vector2 startPos, Vector2 target, int count, string showName, bool isExp,
|
|
|
|
+ System.Action<ImageMove> finishCallBack = null, System.Action<ImageMove> targetPointSet = null)
|
|
{
|
|
{
|
|
if (target.x == -5000)
|
|
if (target.x == -5000)
|
|
{
|
|
{
|
|
@@ -217,7 +221,8 @@ namespace Fort23.Mono
|
|
|
|
|
|
for (int i = 0; i < count; i++)
|
|
for (int i = 0; i < count; i++)
|
|
{
|
|
{
|
|
- AddACurve(startPos, target, showName, finishCallBack);
|
|
|
|
|
|
+ ImageMove imageMove = AddACurve(startPos, target, showName, isExp, finishCallBack, targetPointSet);
|
|
|
|
+ imageMove.GroupIndex = i;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|