_step () {
        if (this.profiler !== null) {
            if (stepProfilerId === -1) {
                stepProfilerId = this.profiler.idByName('Runtime._step');
            }
            this.profiler.start(stepProfilerId);
        }

        // Clean up threads that were told to stop during or since the last step
        this.threads = this.threads.filter(thread => !thread.isKilled);

        // Find all edge-activated hats, and add them to threads to be evaluated.
        for (const hatType in this._hats) {
            if (!this._hats.hasOwnProperty(hatType)) continue;
            const hat = this._hats[hatType];
            if (hat.edgeActivated) {
                this.startHats(hatType);
            }
        }
        this.redrawRequested = false;
        this._pushMonitors();
        if (this.profiler !== null) {
            if (stepThreadsProfilerId === -1) {
                stepThreadsProfilerId = this.profiler.idByName('Sequencer.stepThreads');
            }
            this.profiler.start(stepThreadsProfilerId);
        }
        const doneThreads = this.sequencer.stepThreads();
        if (this.profiler !== null) {
            this.profiler.stop();
        }
        this._updateGlows(doneThreads);
        // Add done threads so that even if a thread finishes within 1 frame, the green
        // flag will still indicate that a script ran.
        this._emitProjectRunStatus(
            this.threads.length + doneThreads.length -
                this._getMonitorThreadCount([...this.threads, ...doneThreads]));
        if (this.renderer) {
            // @todo: Only render when this.redrawRequested or clones rendered.
            if (this.profiler !== null) {
                if (rendererDrawProfilerId === -1) {
                    rendererDrawProfilerId = this.profiler.idByName('RenderWebGL.draw');
                }
                this.profiler.start(rendererDrawProfilerId);
            }
            this.renderer.draw();
            if (this.profiler !== null) {
                this.profiler.stop();
            }
        }

        if (this._refreshTargets) {
            this.emit(Runtime.TARGETS_UPDATE);
            this._refreshTargets = false;
        }

        if (!this._prevMonitorState.equals(this._monitorState)) {
            this.emit(Runtime.MONITORS_UPDATE, this._monitorState);
            this._prevMonitorState = this._monitorState;
        }

        if (this.profiler !== null) {
            this.profiler.stop();
            this.profiler.reportFrames();
        }
    }
/**
     * Repeatedly run `sequencer.stepThreads` and filter out
     * inactive threads after each iteration.
     */
Repeatedly run `sequencer.stepThreads` and filter out
inactive threads after each iteration.
Repeatedly run ` sequencer . stepThreads ` and filter out inactive threads after each iteration .
_step () {
        if (this.profiler !== null) {
            if (stepProfilerId === -1) {
                stepProfilerId = this.profiler.idByName('Runtime._step');
            }
            this.profiler.start(stepProfilerId);
        }
        this.threads = this.threads.filter(thread => !thread.isKilled);
        for (const hatType in this._hats) {
            if (!this._hats.hasOwnProperty(hatType)) continue;
            const hat = this._hats[hatType];
            if (hat.edgeActivated) {
                this.startHats(hatType);
            }
        }
        this.redrawRequested = false;
        this._pushMonitors();
        if (this.profiler !== null) {
            if (stepThreadsProfilerId === -1) {
                stepThreadsProfilerId = this.profiler.idByName('Sequencer.stepThreads');
            }
            this.profiler.start(stepThreadsProfilerId);
        }
        const doneThreads = this.sequencer.stepThreads();
        if (this.profiler !== null) {
            this.profiler.stop();
        }
        this._updateGlows(doneThreads);
        this._emitProjectRunStatus(
            this.threads.length + doneThreads.length -
                this._getMonitorThreadCount([...this.threads, ...doneThreads]));
        if (this.renderer) {
            if (this.profiler !== null) {
                if (rendererDrawProfilerId === -1) {
                    rendererDrawProfilerId = this.profiler.idByName('RenderWebGL.draw');
                }
                this.profiler.start(rendererDrawProfilerId);
            }
            this.renderer.draw();
            if (this.profiler !== null) {
                this.profiler.stop();
            }
        }
        if (this._refreshTargets) {
            this.emit(Runtime.TARGETS_UPDATE);
            this._refreshTargets = false;
        }
        if (!this._prevMonitorState.equals(this._monitorState)) {
            this.emit(Runtime.MONITORS_UPDATE, this._monitorState);
            this._prevMonitorState = this._monitorState;
        }
        if (this.profiler !== null) {
            this.profiler.stop();
            this.profiler.reportFrames();
        }
    }
_step ( ) { if ( this . profiler !== null ) { if ( stepProfilerId === - 1 ) { stepProfilerId = this . profiler . idByName ( 'Runtime._step' ) ; } this . profiler . start ( stepProfilerId ) ; } this . threads = this . threads . filter ( thread => ! thread . isKilled ) ; for ( const hatType in this . _hats ) { if ( ! this . _hats . hasOwnProperty ( hatType ) ) continue ; const hat = this . _hats [ hatType ] ; if ( hat . edgeActivated ) { this . startHats ( hatType ) ; } } this . redrawRequested = false ; this . _pushMonitors ( ) ; if ( this . profiler !== null ) { if ( stepThreadsProfilerId === - 1 ) { stepThreadsProfilerId = this . profiler . idByName ( 'Sequencer.stepThreads' ) ; } this . profiler . start ( stepThreadsProfilerId ) ; } const doneThreads = this . sequencer . stepThreads ( ) ; if ( this . profiler !== null ) { this . profiler . stop ( ) ; } this . _updateGlows ( doneThreads ) ; this . _emitProjectRunStatus ( this . threads . length + doneThreads . length - this . _getMonitorThreadCount ( [ ... this . threads , ... doneThreads ] ) ) ; if ( this . renderer ) { if ( this . profiler !== null ) { if ( rendererDrawProfilerId === - 1 ) { rendererDrawProfilerId = this . profiler . idByName ( 'RenderWebGL.draw' ) ; } this . profiler . start ( rendererDrawProfilerId ) ; } this . renderer . draw ( ) ; if ( this . profiler !== null ) { this . profiler . stop ( ) ; } } if ( this . _refreshTargets ) { this . emit ( Runtime . TARGETS_UPDATE ) ; this . _refreshTargets = false ; } if ( ! this . _prevMonitorState . equals ( this . _monitorState ) ) { this . emit ( Runtime . MONITORS_UPDATE , this . _monitorState ) ; this . _prevMonitorState = this . _monitorState ; } if ( this . profiler !== null ) { this . profiler . stop ( ) ; this . profiler . reportFrames ( ) ; } }
Repeatedly run `sequencer.stepThreads` and filter out
 inactive threads after each iteration.
Repeatedly run ` sequencer . stepThreads ` and filter out inactive threads after each iteration .
// Clean up threads that were told to stop during or since the last step // Find all edge-activated hats, and add them to threads to be evaluated. // Add done threads so that even if a thread finishes within 1 frame, the green // flag will still indicate that a script ran. // @todo: Only render when this.redrawRequested or clones rendered.