let assetPath = ""; let defaultPolygonPath = "assets/"; let polygonNameHeader = "polygon_"; let polygonName = ""; Editor.Panel.extend({ style: ` :host { margin: 5px; } h2 { color: #f90; } .bottom { height: 30px; } `, template: `

Source Change


1. 把要輸出的節點拉進來
2. 把來源編號跟目標標號輸入好

要使用的Prefab

來源Game ID
目標Game ID

生成
`, $: { /** Node */ node: "#node", /** 來源Game ID */ self: "#self", /** 目標Game */ target: "#target", /** 生成按鈕 */ create: "#create", }, ready() { // Editor.Ipc.sendToMain("sourcechange:panel-load-finish"); this.createBtnClick(); }, /** 保存按鈕點擊事件 */ createBtnClick() { this.$create.addEventListener("confirm", () => { if (!this.$node._value) { Editor.error("請拖曳 Node 到視窗"); return; } else if (!this.$self._value) { Editor.error("請輸入來源Game ID"); return; } else if (!this.$target._value) { Editor.error("請輸入目標Game ID"); return; } Editor.Ipc.sendToMain("sourcechange:create-click", this.$node, this.$self, this.$target); }); }, messages: { // "setDefault": function (event, ...agrs) { // if (event.reply) { // //if no error, the first argument should be null // event.reply(null, "Fine, thank you!"); // } // } } });