31 lines
1.0 KiB
C#
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();
|
|
}
|
|
}
|
|
} |