Files
Continentis/Assets/Scripts/MainGame/UI/ArrowsPage/ArrowsPage.cs
SoulliesOfficial d09b58fd80 架构大更
2026-03-20 11:56:50 -04:00

31 lines
1.0 KiB
C#

using System.Collections.Generic;
using Lean.Pool;
using UnityEngine;
namespace Continentis.MainGame.UI
{
public class ArrowsPage : UIPageBase
{
public PointerArrow mainPointerArrow;
public List<PointerArrow> pointerArrows;
public List<PointerArrow> otherPointerArrows =>
pointerArrows.FindAll(pointerArrow => pointerArrow != mainPointerArrow);
public void GeneratePointerArrow(Vector3 startPosition, Vector3 endPosition, bool isMain)
{
var pointerArrow = LeanPool.Spawn(MainGameManager.Instance.basePrefabs.pointerArrow, transform)
.GetComponent<PointerArrow>();
pointerArrow.SetArrow(startPosition, endPosition);
pointerArrows.Add(pointerArrow);
if (isMain) mainPointerArrow = pointerArrow;
}
public void ClearPointerArrows()
{
foreach (var pointerArrow in pointerArrows) LeanPool.Despawn(pointerArrow.gameObject);
pointerArrows.Clear();
}
}
}