-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.js
More file actions
41 lines (38 loc) · 1.07 KB
/
main.js
File metadata and controls
41 lines (38 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
'use strict';
var CfgUtil = require('./core/CfgUtil');
/**小游戏跳转文件所在路径文件 */
var isAutoBuild=false;
module.exports = {
load () {
// execute when package loaded
},
unload () {
// execute when package unloaded
},
// register your ipc messages here
messages: {
'open' () {
// open entry panel registered in package.json
Editor.Panel.open('wechat-appid-list');
},
'editor:build-start': function (event, target) {
if (target.platform === "wechatgame"){
CfgUtil.initCfg(function(data){
isAutoBuild = data.isAutoBuild;
// Editor.log(" ------------editor:build-start",isAutoBuild);
});
// Editor.log(" ------------editor:build-start");
}
},
// 当插件构建完成的时候触发
'editor:build-finished': function (event, target) {
if (target.platform === "wechatgame"){
//微信编译完成时执行
// Editor.log(" ------------editor:build-finished")
if(isAutoBuild){
CfgUtil.saveGameJson();
}
}
},
},
};