using Core.Extensions; #if UNITY_EDITOR using UnityEngine; #endif namespace TowerDefense.Nodes { /// /// Deterministically selects a node in the order it appears on the list /// public class FixedNodeSelector : NodeSelector { /// /// Index to keep track of what node should be selected next /// protected int m_NodeIndex; /// /// Selects the next node using /// /// The next selected node, or null if there are no valid nodes public override Node GetNextNode() { if (linkedNodes.Next(ref m_NodeIndex, true)) { return linkedNodes[m_NodeIndex]; } return null; } #if UNITY_EDITOR protected override void OnDrawGizmos() { Gizmos.color = Color.yellow; base.OnDrawGizmos(); } #endif } }