public void StartSelection(OnSelection onSelection, EntitySelectionType selectionType, int startIndex, params BattleEntity[] targets) { StartSelection(onSelection, selectionType, targets); //Works with the failsafe in the other overload if (Targets != null) { ChangeSelection(startIndex); } }
public void StartSelection(OnSelection onSelection, EntitySelectionType selectionType, params BattleEntity[] targets) { Targets = targets; Selection = onSelection; SelectionType = selectionType; //Failsafe - end selection immediately if inputs are invalid if (Targets == null || Targets.Length == 0) { Debug.LogError($"Null or empty target array in {nameof(TargetSelectionMenu)}.{nameof(StartSelection)}, ending selection..."); EndSelection(); } }
public void EndSelection() { CurSelection = 0; Targets = null; Selection = null; SelectionType = EntitySelectionType.Single; if (BattleUIManager.Instance.TopMenu != null) { BattleUIManager.Instance.PopMenu(); } Cursor.Reset(); }