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

var toWeixin = console.error;
function cheating(speed) {
    if (speed === void 0) { speed = 200; }
    return function (target) {
        var oldTarget = target;
        // 工具函数，生成类的实例
        function factory(ctor, rest) {
            var c = function () {
                return ctor.apply(this, rest);
            };
            c.prototype = ctor.prototype;
            return new c();
        }
        // 添加行为到构造器
        var newTarget = function () {
            var args = [];
            for (var _i = 0; _i < arguments.length; _i++) {
                args[_i] = arguments[_i];
            }
            var instance = factory(oldTarget, args);
            instance.speed = speed;
            toWeixin("\u7EDD\u5730\u6C42\u751F\u91CC\u6211\u7684\u89D2\u8272" + instance.name + "\u5F00\u4E86\u79FB\u901F\u6302: " + speed + "\uFF0C\u51C6\u5907\u8981\u5403\u9E21\u4E86~");
            return instance;
        };
        // 指向原来的原型
        var F = function () { };
        F.prototype = oldTarget.prototype;
        newTarget.prototype = new F();
        // 修改方法
        target.prototype.hit = function (rival) {
            var hitDamage = 100; // 拳头攻击身体伤害
            // 造成一次伤害，秒杀！
            console.log(this.name + "\u5BF9" + rival.name + "\u9020\u6210\u4E00\u6B21\u4F24\u5BB3: " + hitDamage);
        };
        return newTarget;
    };
}

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