37 lines
1.0 KiB
JavaScript
37 lines
1.0 KiB
JavaScript
|
"use strict";
|
||
|
let fs = require("fs");
|
||
|
let path = require("path");
|
||
|
|
||
|
module.exports = {
|
||
|
/**
|
||
|
* 獲取場景節點下的配置信息
|
||
|
* @param event event
|
||
|
* @param data 這邊把panel的Node帶進來
|
||
|
*/
|
||
|
"getFsPath": function (event, request) {
|
||
|
let self = this;
|
||
|
var response = null;
|
||
|
var args = request.args;
|
||
|
try {
|
||
|
let url = `db://assets/${args[0]._value}`;
|
||
|
url = url.replace(/\\/g, "/");
|
||
|
// let url = `db://assets/=SceneLobby`;
|
||
|
// Editor.log(`url: ${url}`);
|
||
|
let fsPath = Editor.remote.assetdb.urlToFspath(url);
|
||
|
// Editor.log(`fsPath: ${fsPath}`);
|
||
|
|
||
|
// this.fileSearch(fsPath);
|
||
|
|
||
|
let res = {
|
||
|
url: url,
|
||
|
fsPath, fsPath
|
||
|
}
|
||
|
response = JSON.stringify(res);
|
||
|
} catch (error) {
|
||
|
Editor.log(`getFsPath error: ${error}`);
|
||
|
}
|
||
|
if (event.reply) {
|
||
|
event.reply(null, response);
|
||
|
}
|
||
|
},
|
||
|
};
|