Ejemplo n.º 1
0
    private void DoNextCmd()
    {
        if (_runningHolder != null)
        {
            _runningHolder.PreviewRunning(false);
        }
        _runningHolder = _holders[_nextCmdIndex];
        _runningHolder.PreviewRunning(true);

        var e = new CommandEvent();

        e.CommandType = _runningHolder.CommandType;
        e.TimelineId  = TimelineId;

        if (_nextCmdIndex == 0)
        {
            e.PhaseType = CommandPhaseType.Start;
            EventBus.Trigger(e);
        }

        e.PhaseType = CommandPhaseType.Run;
        EventBus.Trigger(e);

        if (++_nextCmdIndex >= ActiveHolderCount)
        {
            _nextCmdIndex = 0;
            e.PhaseType   = CommandPhaseType.End;
            EventBus.Trigger(e);
        }
    }