Support plugin

This commit is contained in:
oc 2018-03-15 10:04:12 +08:00
parent 55bae305d9
commit 6d9a4dafbf

View File

@ -300,20 +300,18 @@ functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
"plugins": { "plugins": {
"plugin": function () { "plugin": function () {
////// 插件编写,可以在这里写自己额外需要执行的脚本 ////// ////// 插件编写,可以在这里写自己额外需要执行的脚本 //////
var closure = {};
// 在这里写的代码,在所有模块加载完毕后,游戏开始前会被执行 // 在这里写的代码,在所有模块加载完毕后,游戏开始前会被执行
console.log("插件编写测试"); console.log("插件编写测试");
// 可以写一些其他的被直接执行的代码 // 可以写一些其他的被直接执行的代码
// 在这里写所有需要自定义的函数 // 在这里写所有需要自定义的函数
// 写法必须是 closure.xxx = function (args) { ... // 写法必须是 this.xxx = function (args) { ...
closure.test = function () { this.test = function () {
console.log("插件函数执行测试"); console.log("插件函数执行测试");
} }
// 可以在任何地方如afterXXX或自定义脚本事件调用函数方法为 core.plugin.xxx(); // 可以在任何地方如afterXXX或自定义脚本事件调用函数方法为 core.plugin.xxx();
return closure;
} }
} }
} }