请问大家是怎么修改cocos creator引擎源码的

   直接改引擎js源码的话编译后不能和其他小游戏引擎js源码复用和增量下载,会导致新用户需要直接下载3M多的引擎js源码,启动会更久。
   请问大家是用什么方式不直接修改源码的情况下来修改引擎的。

可以试试hack一下。直接cc.abc.edf=function(){}

1赞

js prototype

给3.x版本的 Node加上 x y 属性, 向2.x那样可以直接通过 node.x 和 node.y那样访问:
Object.defineProperty(Node.prototype, “x”, {
get: function () {
return this.position.x;
},

        set: function (value) {
            this.setPosition(value, this.position.y, this.position.z);
        },
        enumerable: true,
        configurable: true
    });

    Object.defineProperty(Node.prototype, "y", {

        get: function () {
            return this.position.y;
        },

        set: function (value) {
            this.setPosition(this.position.x, value, this.position.z);
        },
        enumerable: true,
        configurable: true
    });