using System.Collections.Generic; using Lean.Pool; using UnityEngine; namespace Continentis.MainGame.UI { public class ArrowsPage : UIPageBase { public PointerArrow mainPointerArrow; public List pointerArrows; public List otherPointerArrows => pointerArrows.FindAll(pointerArrow => pointerArrow != mainPointerArrow); public void GeneratePointerArrow(Vector3 startPosition, Vector3 endPosition, bool isMain) { PointerArrow pointerArrow = LeanPool.Spawn(MainGameManager.Instance.basePrefabs.pointerArrow, transform).GetComponent(); 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(); } } }