2025-09-08 14:51:28 +08:00
|
|
|
using UnityEngine;
|
|
|
|
|
using UnityEngine.UI;
|
|
|
|
|
using ZXKFramework;
|
2025-09-08 17:37:12 +08:00
|
|
|
namespace DongWuYiXue.DaoNiaoShu
|
2025-09-08 14:51:28 +08:00
|
|
|
{
|
|
|
|
|
public class ArrowPanel : UIBase
|
|
|
|
|
{
|
|
|
|
|
public override string GroupName => "ArrowPanel";
|
|
|
|
|
public override string Name => "ArrowPanel";
|
|
|
|
|
public GameObject[] arrow;
|
|
|
|
|
Text tipText;
|
|
|
|
|
Coroutine coroutine;
|
|
|
|
|
Coroutine coroutine2;
|
|
|
|
|
public override void Init(IUIManager uictrl)
|
|
|
|
|
{
|
|
|
|
|
base.Init(uictrl);
|
|
|
|
|
tipText = transform.FindFirst<Text>("Txt");
|
|
|
|
|
}
|
|
|
|
|
public void ShowArrow(Transform v, string Txt, int arrowType, int showTime, int hideTime = 3)
|
|
|
|
|
{
|
|
|
|
|
HideAllArrow();
|
|
|
|
|
coroutine = Game.Instance.IEnumeratorManager.Run(showTime, () => {
|
|
|
|
|
tipText.text = Txt;
|
|
|
|
|
SetActive(true);
|
|
|
|
|
arrow[arrowType].gameObject.SetActive(true);
|
|
|
|
|
arrow[arrowType].transform.position = Camera.main.WorldToScreenPoint(v.position);
|
|
|
|
|
|
|
|
|
|
coroutine2 = Game.Instance.IEnumeratorManager.Run(hideTime, () => {
|
|
|
|
|
HideArrow();
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
public void ShowArrow(string txt,Vector2 v, int arrowType, int showTime, int hideTime = 3)
|
|
|
|
|
{
|
|
|
|
|
HideAllArrow();
|
|
|
|
|
coroutine = Game.Instance.IEnumeratorManager.Run(showTime, () => {
|
|
|
|
|
tipText.text = txt;
|
|
|
|
|
SetActive(true);
|
|
|
|
|
arrow[arrowType].gameObject.SetActive(true);
|
|
|
|
|
arrow[arrowType].GetComponent<RectTransform>().anchoredPosition = v;
|
|
|
|
|
coroutine2 = Game.Instance.IEnumeratorManager.Run(hideTime, () => {
|
|
|
|
|
HideArrow();
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
public void ShowArrow(Vector2 v, int arrowType, int showTime, int hideTime = 3)
|
|
|
|
|
{
|
|
|
|
|
HideAllArrow();
|
|
|
|
|
coroutine = Game.Instance.IEnumeratorManager.Run(showTime, () => {
|
|
|
|
|
SetActive(true);
|
|
|
|
|
arrow[arrowType].gameObject.SetActive(true);
|
|
|
|
|
arrow[arrowType].GetComponent<RectTransform>().anchoredPosition = v;
|
|
|
|
|
coroutine2 = Game.Instance.IEnumeratorManager.Run(hideTime, () => {
|
|
|
|
|
HideArrow();
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
public override void Hide()
|
|
|
|
|
{
|
|
|
|
|
base.Hide();
|
|
|
|
|
Game.Instance.IEnumeratorManager.Stop(coroutine);
|
|
|
|
|
Game.Instance.IEnumeratorManager.Stop(coroutine2);
|
|
|
|
|
}
|
|
|
|
|
public void HideArrow()
|
|
|
|
|
{
|
|
|
|
|
Game.Instance.IEnumeratorManager.Stop(coroutine);
|
|
|
|
|
Game.Instance.IEnumeratorManager.Stop(coroutine2);
|
|
|
|
|
SetActive(false);
|
|
|
|
|
}
|
|
|
|
|
public void HideAllArrow()
|
|
|
|
|
{
|
|
|
|
|
for (int i = 0; i < arrow.Length; i++)
|
|
|
|
|
{
|
|
|
|
|
arrow[i].SetActive(false);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|