Skip to content

Instantly share code, notes, and snippets.

@ossra

ossra/RMMZ-ES6 Secret

Created August 18, 2020 22:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ossra/06a9807c134ba128d8842bbca338bc9f to your computer and use it in GitHub Desktop.
Save ossra/06a9807c134ba128d8842bbca338bc9f to your computer and use it in GitHub Desktop.
/* mixin function within plugin class */
mixin (proto, object) {
this.base[proto.constructor.name] = { };
for (const name of Object.keys(object)) {
this.base[proto.constructor.name][name] = proto[name];
}
Object.assign(proto, object);
}
/* calling the mixin function from the plugin class */
plugin.namespace.mixin(Spriteset_Base.prototype, { // {
/* ====================================================== | Spriteset_Base | */
/* < update > -------------------------------------------------------------------- */
update () {
plugin.namespace.base.Spriteset_Base.update.call(this);
},
}); // }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment