Ejemplo n.º 1
0
    public void RealizeAction(ACTIONEVENT tipo)
    {
        switch (tipo)
        {
        case ACTIONEVENT.OnAwake:
            if (actionOnStart != null)
            {
                actionOnStart(this);
            }
            break;

        case ACTIONEVENT.BeforeStart:
            if (actionBeforeStart != null)
            {
                actionBeforeStart(this);
            }
            break;

        case ACTIONEVENT.OnCompleted:
            if (actionCompleted != null)
            {
                actionCompleted(this);
            }
            break;

        case ACTIONEVENT.OnCanceled:
            if (actionCanceled != null)
            {
                actionCanceled(this);
            }
            break;
        }
    }
Ejemplo n.º 2
0
    public void UnregisterAction(ACTIONEVENT tipo, Action <GameAction> action)
    {
        switch (tipo)
        {
        case ACTIONEVENT.OnAwake:
            actionOnStart -= action;
            break;

        case ACTIONEVENT.BeforeStart:
            actionBeforeStart -= action;
            break;

        case ACTIONEVENT.OnCompleted:
            actionCompleted -= action;
            break;

        case ACTIONEVENT.OnCanceled:
            actionCanceled -= action;
            break;
        }
    }