|
@@ -36,7 +36,7 @@ namespace Fort23.Mono
|
|
target = showItemMoveToTargetPanel.transform.worldToLocalMatrix * target;
|
|
target = showItemMoveToTargetPanel.transform.worldToLocalMatrix * target;
|
|
}
|
|
}
|
|
|
|
|
|
- showItemMoveToTargetPanel.ShowPanel(startPos, target, allItem.Count);
|
|
|
|
|
|
+ showItemMoveToTargetPanel.ShowPanel(startPos, target, allItem.Count, "");
|
|
}
|
|
}
|
|
|
|
|
|
public static async void OpenShowItemMoveToTargetPanel(List<string> allItem)
|
|
public static async void OpenShowItemMoveToTargetPanel(List<string> allItem)
|
|
@@ -45,14 +45,14 @@ namespace Fort23.Mono
|
|
await UIManager.Instance.LoadAndOpenPanel<ShowItemMoveToTargetPanel>(null, UILayer.Top, isFocus: false);
|
|
await UIManager.Instance.LoadAndOpenPanel<ShowItemMoveToTargetPanel>(null, UILayer.Top, isFocus: false);
|
|
Vector2 target = showItemMoveToTargetPanel.moveTarget.GetComponent<RectTransform>().anchoredPosition;
|
|
Vector2 target = showItemMoveToTargetPanel.moveTarget.GetComponent<RectTransform>().anchoredPosition;
|
|
showItemMoveToTargetPanel.moveTarget.gameObject.SetActive(true);
|
|
showItemMoveToTargetPanel.moveTarget.gameObject.SetActive(true);
|
|
- showItemMoveToTargetPanel.ShowPanel(new Vector2(), target, allItem.Count);
|
|
|
|
|
|
+ showItemMoveToTargetPanel.ShowPanel(new Vector2(), target, allItem.Count, "");
|
|
}
|
|
}
|
|
|
|
|
|
public static async void OpenShowItemMoveToTargetPanel(Vector2 startPos, Vector2 target, List<string> allItem)
|
|
public static async void OpenShowItemMoveToTargetPanel(Vector2 startPos, Vector2 target, List<string> allItem)
|
|
{
|
|
{
|
|
ShowItemMoveToTargetPanel showItemMoveToTargetPanel =
|
|
ShowItemMoveToTargetPanel showItemMoveToTargetPanel =
|
|
await UIManager.Instance.LoadAndOpenPanel<ShowItemMoveToTargetPanel>(null, UILayer.Top, isFocus: false);
|
|
await UIManager.Instance.LoadAndOpenPanel<ShowItemMoveToTargetPanel>(null, UILayer.Top, isFocus: false);
|
|
- showItemMoveToTargetPanel.ShowPanel(startPos, target, allItem.Count);
|
|
|
|
|
|
+ showItemMoveToTargetPanel.ShowPanel(startPos, target, allItem.Count, "");
|
|
}
|
|
}
|
|
|
|
|
|
private void Init()
|
|
private void Init()
|
|
@@ -77,16 +77,19 @@ namespace Fort23.Mono
|
|
|
|
|
|
protected void Combat_ItemShow(IEventData iEventData)
|
|
protected void Combat_ItemShow(IEventData iEventData)
|
|
{
|
|
{
|
|
- CombatItemShowEventData combatItemShowEventData = iEventData as CombatItemShowEventData;
|
|
|
|
Vector2 target = moveTarget.GetComponent<RectTransform>().anchoredPosition;
|
|
Vector2 target = moveTarget.GetComponent<RectTransform>().anchoredPosition;
|
|
- // moveTarget.gameObject.SetActive(true);
|
|
|
|
|
|
+ CombatItemShowEventData combatItemShowEventData = iEventData as CombatItemShowEventData;
|
|
|
|
+ if (combatItemShowEventData.isExp)
|
|
|
|
+ {
|
|
|
|
+ MainUIPanel mainUIPanel = UIManager.Instance.GetComponent<MainUIPanel>();
|
|
|
|
+ Vector3 pos = mainUIPanel.expPoint.position;
|
|
|
|
+ target = transform.worldToLocalMatrix * pos;
|
|
|
|
+ }
|
|
Vector3 p = UIManager.Instance.CurrCustomCameraStack.camera.WorldToScreenPoint(
|
|
Vector3 p = UIManager.Instance.CurrCustomCameraStack.camera.WorldToScreenPoint(
|
|
combatItemShowEventData.startPos_WorldPos);
|
|
combatItemShowEventData.startPos_WorldPos);
|
|
Vector3 p2 = UIManager.Instance.UICamera.ScreenToWorldPoint(p);
|
|
Vector3 p2 = UIManager.Instance.UICamera.ScreenToWorldPoint(p);
|
|
- // RectTransform rectTransform= moveIcon.GetComponent<RectTransform>();
|
|
|
|
- // rectTransform.position = p2;
|
|
|
|
Vector3 startPos = transform.worldToLocalMatrix * p2;
|
|
Vector3 startPos = transform.worldToLocalMatrix * p2;
|
|
- ShowPanel(startPos, target, combatItemShowEventData.count);
|
|
|
|
|
|
+ ShowPanel(startPos, target, combatItemShowEventData.count, combatItemShowEventData.showName);
|
|
}
|
|
}
|
|
|
|
|
|
protected void RenderUpdateCallBack()
|
|
protected void RenderUpdateCallBack()
|
|
@@ -151,9 +154,14 @@ namespace Fort23.Mono
|
|
gameObjectPool.own.SetActive(false);
|
|
gameObjectPool.own.SetActive(false);
|
|
gameObjectPool.own.transform.localScale = Vector3.zero;
|
|
gameObjectPool.own.transform.localScale = Vector3.zero;
|
|
currImageMove.GameObjectPool = gameObjectPool;
|
|
currImageMove.GameObjectPool = gameObjectPool;
|
|
- // gameObjectPool.own.GetComponent<MyImage>().icon_name = itemConfig;
|
|
|
|
|
|
+ MyImage myImage= gameObjectPool.own.GetComponent<MyImage>();
|
|
|
|
+ myImage.onSpriteAlter= delegate
|
|
|
|
+ {
|
|
|
|
+ myImage.SetNativeSize();
|
|
|
|
+ };
|
|
|
|
+ myImage.icon_name = itemConfig;
|
|
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.moveTargetPos = moveTargetPos;
|
|
currImageMove.transform.anchoredPosition = currImageMove.moveStartPos;
|
|
currImageMove.transform.anchoredPosition = currImageMove.moveStartPos;
|
|
@@ -164,27 +172,16 @@ namespace Fort23.Mono
|
|
allImageMove.Add(currImageMove);
|
|
allImageMove.Add(currImageMove);
|
|
}
|
|
}
|
|
|
|
|
|
- public void ShowPanel(Vector2 startPos, Vector2 target,int count)
|
|
|
|
|
|
+ public void ShowPanel(Vector2 startPos, Vector2 target, int count, string showName)
|
|
{
|
|
{
|
|
- // if (allItem.Count < 5)
|
|
|
|
- // {
|
|
|
|
- // for (int i = allItem.Count; i <= 5; i++)
|
|
|
|
- // {
|
|
|
|
- // allItem.Add(allItem[Random.Range(0, allItem.Count)]);
|
|
|
|
- // }
|
|
|
|
- // }
|
|
|
|
-
|
|
|
|
if (target.x == -5000)
|
|
if (target.x == -5000)
|
|
{
|
|
{
|
|
target = moveTarget.GetComponent<RectTransform>().anchoredPosition;
|
|
target = moveTarget.GetComponent<RectTransform>().anchoredPosition;
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
- for (int i = 0; i <count; i++)
|
|
|
|
|
|
+ for (int i = 0; i < count; i++)
|
|
{
|
|
{
|
|
- string item = "count";
|
|
|
|
-
|
|
|
|
- AddACurve(startPos, target, item);
|
|
|
|
|
|
+ AddACurve(startPos, target, showName);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|