spineset/main.js

46 lines
1.4 KiB
JavaScript
Raw Normal View History

2022-03-31 00:59:17 +00:00
"use strict";
let fs = require("fs");
let path = require("path");
module.exports = {
load() {
this.init();
},
unload() {
// Editor.log("卸載執行");
},
/** 初始化 */
init() {
// this.createDirectory();
},
/** 創建Spine節點 */
createSpine(...args) {
// Editor.log("文件0: " + JSON.stringify(args[0]));
// Editor.log("文件1: " + JSON.stringify(args[1]));
// Editor.log("文件2: " + JSON.stringify(args[2]));
Editor.Scene.callSceneScript("spineset", "get-asset-info", { args: args }, function (err, response) {
// Editor.log("callSceneScript: " + response);
// let info = JSON.parse(response);
// let path = info.path;
// let url = info.url;
});
},
messages: {
/** 打開面板 */
"open-panel"() {
Editor.Panel.open("spineset");
},
/** 保存按鈕點擊 */
"create-click"(event, ...args) {
this.createSpine(...args);
},
/** 面板加載完成 */
"panel-load-finish"(evnet, ...args) {
Editor.Scene.callSceneScript("spineset", "get-default-info", { args: args }, function (err, response) {
// Editor.log("callSceneScript: " + response);
Editor.Ipc.sendToPanel("spineset", "setDefault", response);
});
},
},
}