public void DeselectAction()
 {
     if (SelectedAction != null)
     {
         OnActionDeselected?.Invoke(this, SelectedAction);
         SelectedAction = null;
     }
 }
Beispiel #2
0
    /// <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);
        }
    }