Esempio n. 1
0
    public void PerformAction(ActionObject hitObject, bool pressed)
    {
        if (hitObject == null)
        {
            if (primaryAction)
            {
                primaryAction.CheckAction(null, pressed);
            }
            return;
        }

        if (pressed)
        {
            switch (hitObject.actionGroupPress)
            {
            case ActionGroup.primary:
                if (primaryAction)
                {
                    primaryAction.CheckAction(hitObject, pressed);
                }
                break;

            case ActionGroup.secondary:
                if (secondaryAction)
                {
                    secondaryAction.CheckAction(hitObject, pressed);
                }
                break;

            case ActionGroup.support:
                if (supportAction)
                {
                    supportAction.CheckAction(hitObject, pressed);
                }
                break;

            case ActionGroup.ranged:
                if (rangedAction)
                {
                    rangedAction.CheckAction(hitObject, pressed);
                }
                break;

            case ActionGroup.none:
                SimpleAction(hitObject, pressed);
                break;
            }
        }

        if (!pressed)
        {
            switch (hitObject.actionGroupTap)
            {
            case ActionGroup.primary:
                if (primaryAction)
                {
                    primaryAction.CheckAction(hitObject, pressed);
                }
                break;

            case ActionGroup.secondary:
                if (secondaryAction)
                {
                    secondaryAction.CheckAction(hitObject, pressed);
                }
                break;

            case ActionGroup.support:
                if (supportAction)
                {
                    supportAction.CheckAction(hitObject, pressed);
                }
                break;

            case ActionGroup.ranged:
                if (rangedAction)
                {
                    rangedAction.CheckAction(hitObject, pressed);
                }
                break;

            case ActionGroup.none:
                SimpleAction(hitObject, pressed);
                break;
            }
        }
    }