(function() {"use strict";var __module = CC_EDITOR ? module : {exports:{}};var __filename = 'preview-scripts/assets/Script/pbhelper.js';var __require = CC_EDITOR ? function (request) {return cc.require(request, require);} : function (request) {return cc.require(request, __filename);};function __define (exports, require, module) {"use strict";
cc._RF.push(module, '00263T7laVN95RGVehPOXFi', 'pbhelper', __filename);
// Script/pbhelper.js

'use strict';

var protobuf = require("protobufjs");
var builder = protobuf.newBuilder();

var protoFiles = ['test_Proto.proto'];

function PBHelper() {
    this.sequence = 0;
}

PBHelper.prototype = {
    loadFile: function loadFile(path, packageName) {
        if (typeof cc !== 'undefined') {
            path = cc.sys.isNative ? cc.url.raw(path) : 'res/raw-assets/' + path;
            protobuf.Util.IS_NODE = cc.sys.isNative;
            cc.log('>>>>>>>' + path);
        }

        builder.importRoot = path;
        protoFiles.forEach(function (fileName) {
            var filePath = path + '/' + fileName;
            protobuf.protoFromFile(filePath, builder);
        });

        return builder.build(packageName);
    }

};

module.exports = PBHelper;

cc._RF.pop();
        }
        if (CC_EDITOR) {
            __define(__module.exports, __require, __module);
        }
        else {
            cc.registerModuleFunc(__filename, function () {
                __define(__module.exports, __require, __module);
            });
        }
        })();
        //# sourceMappingURL=pbhelper.js.map
        