示例#1
0
    /** 输出 */
    public void onPrint(string str)
    {
        _printQueue.offer(str.Length + 1);
        _printSb.Append(str);
        _printSb.Append('\n');

        while (_printSb.Length > _printMaxCacheLength)
        {
            _printSb.Remove(0, _printQueue.poll());
        }

        if (!_isShow)
        {
            return;
        }

        refreshPrintShow();
    }
示例#2
0
    private void doFrame(int delay)
    {
        if (_waiting)
        {
            return;
        }

        if (_cacheQueue.isEmpty())
        {
            _waiting = true;
        }
        else
        {
            FrameSyncData data = _cacheQueue.poll();

            if (data.commands != null && !data.commands.isEmpty())
            {
                data.commands.forEach(preExecuteCommand);
            }

            _scene.doFrame(delay);
        }
    }