Exemple #1
0
    public void OnActionTrigger(ActionButtonTrigger actionButtonTriggerCaster, ActionButtonTrigger.Type actionType)
    {
        var actionTypeId = (int)actionType;
        var actionGroup  = ActionGroupRoot[actionTypeId];

        if (ActionStatusGroup[actionGroup].CurrentCooldown > 0)
        {
            return;
        }
        if (ActionStatusGroup[actionGroup].MaximumStack > 0 && ActionStatusGroup[actionGroup].CurrentStack == 0 && !ActionStatusGroup[actionGroup].isNotRefill)
        {
            return;
        }
        if (CurrentActionArgs != null && CurrentActionArgs.TransitionRestrictTrigger)
        {
            return;
        }
        if (CurrentActionGroup != null && CurrentActionGroup != actionGroup)
        {
            OnTransitionToOtherCast();
        }

        CurrentActionGroup = actionGroup;
        CurrentActionArgs.SetActionTrigger(actionButtonTriggerCaster).SetCaster(this);
        // when trigger pressed, set triggerState bool
        CurrentActionArgs.SetIsTriggerSet(true);

        ActionTrigger(UnitEventType.SetTrigger);
    }
Exemple #2
0
    // when Action Trigger Released
    public void OnActionTriggerEnd(ActionButtonTrigger.Type p_TriggerType)
    {
        var actionTypeId        = (int)p_TriggerType;
        var actionGroup         = ActionGroupRoot[actionTypeId];
        var actionUnitEventArgs = ActionArgs[actionGroup];

        if (CurrentActionArgs != null && CurrentActionArgs.ActionButtonTrigger.ActionButtonType == p_TriggerType &&
            CurrentActionArgs.IsTriggerSet && !CurrentActionArgs.ActionTriggerReleaseEventDeferredFlag)
        {
            if (!CurrentActionArgs.IsActionTriggerReleaseEventDeferred)
            {
                ActionTrigger(UnitEventType.OnActionTriggerEnd);
            }
            else
            {
                CurrentActionArgs.SetActionTriggerReleaseEventDeferredFlag(true);
            }
        }


        actionUnitEventArgs.SetIsTriggerSet(false);
    }