
                (function() {
                    var nodeEnv = typeof require !== 'undefined' && typeof process !== 'undefined';
                    var __module = nodeEnv ? module : {exports:{}};
                    var __filename = 'preview-scripts/assets/Script/Storage.js';
                    var __require = nodeEnv ? function (request) {
                        return cc.require(request);
                    } : function (request) {
                        return __quick_compile_project__.require(request, __filename);
                    };
                    function __define (exports, require, module) {
                        if (!nodeEnv) {__quick_compile_project__.registerModule(__filename, module);}"use strict";
cc._RF.push(module, '7cf8cMT5zJA0ZU4Gp0JcL8v', 'Storage');
// Script/Storage.ts

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.StorageMessage = void 0;
//缓存浏览器数据
var StorageMessage = {
    getStorage: function (key) {
        var result = null;
        if (cc.sys.localStorage.getItem(key)) {
            var result = cc.sys.localStorage.getItem(key);
        }
        if (result) {
            result = JSON.parse(result);
        }
        return result;
    },
    setStorage: function (key, value) {
        //主动拉起分享接口
        var temp = JSON.stringify(value);
        cc.sys.localStorage.setItem(key, temp);
    },
    removeStorage: function (key) {
        //主动删除消息接口
        if (cc.sys.localStorage.getItem(key)) {
            cc.sys.localStorage.removeItem(key);
        }
    },
};
exports.StorageMessage = StorageMessage;

cc._RF.pop();
                    }
                    if (nodeEnv) {
                        __define(__module.exports, __require, __module);
                    }
                    else {
                        __quick_compile_project__.registerModuleFunc(__filename, function () {
                            __define(__module.exports, __require, __module);
                        });
                    }
                })();
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImFzc2V0c1xcU2NyaXB0XFxTdG9yYWdlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7OztBQUFBLFNBQVM7QUFDVCxJQUFJLGNBQWMsR0FBRztJQUNqQixVQUFVLEVBQUcsVUFBUyxHQUFHO1FBQ3JCLElBQUksTUFBTSxHQUFHLElBQUksQ0FBQztRQUNsQixJQUFHLEVBQUUsQ0FBQyxHQUFHLENBQUMsWUFB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