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