(function() {"use strict";var __module = CC_EDITOR ? module : {exports:{}};var __filename = 'preview-scripts/assets/test.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, '9a895BkWd5EjbAMkGT8Y1pQ', 'test', __filename);
// test.ts

Object.defineProperty(exports, "__esModule", { value: true });
var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property;
var test = /** @class */ (function (_super) {
    __extends(test, _super);
    function test() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this.actionNode = null;
        _this.actionButton = null;
        _this.actionAudioButton = null;
        return _this;
    }
    test.prototype.start = function () {
        var _this = this;
        cc.loader.loadRes("bomb", cc.AudioClip);
        this._initPos = this.actionNode.getPosition().clone();
        var action = cc.sequence(cc.moveBy(.2, cc.v2(500, 0)), cc.moveTo(.2, this._initPos));
        this.actionButton.node.on("click", function () {
            _this.actionNode.runAction(action);
        });
        this.actionAudioButton.node.on("click", function () {
            _this.actionNode.runAction(action);
            cc.loader.loadRes("bomb", cc.AudioClip, function (err, clip) {
                if (!err) {
                    cc.audioEngine.playEffect(clip, false);
                }
                else {
                    console.warn(JSON.stringify(err));
                }
            });
        });
    };
    __decorate([
        property(cc.Node)
    ], test.prototype, "actionNode", void 0);
    __decorate([
        property(cc.Button)
    ], test.prototype, "actionButton", void 0);
    __decorate([
        property(cc.Button)
    ], test.prototype, "actionAudioButton", void 0);
    test = __decorate([
        ccclass
    ], test);
    return test;
}(cc.Component));
exports.default = test;

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