public void DeselectAction() { if (SelectedAction != null) { OnActionDeselected?.Invoke(this, SelectedAction); SelectedAction = null; } }
/// <summary> /// Removes the selected action so another can be selected. /// </summary> public void ClearSelectedAction() { // Local action so can pass it to event after // instance action is cleared. BattleAction action = SelectedAction; // Reset the state of the action. SelectedAction?.DeselectTarget(); SelectedAction = null; // Notify senpai if (action != null) { OnActionDeselected?.Invoke(action); } }