Files
Continentis/Assets/Scripts/MainGame/UI/ArrowsPage/ArrowsPage.cs
SoulliesOfficial 9b1b5ca93f initial
2025-10-03 00:02:43 -04:00

33 lines
1.1 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)
{
PointerArrow 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();
}
}
}