Config.js 725 B

12345678910111213141516171819202122
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. const App = CS.FairyEditor.App;
  4. const cfgPath = `${App.pluginManager.basePath}/xgame-ext/Config.json`;
  5. class Config {
  6. /**psd2fgui的插件路径,该插件依赖的npm库比较大,单独保存*/
  7. psd2fguiPluginsPath;
  8. /**依赖信息清单路径*/
  9. dependencyManifestPath;
  10. wirte() {
  11. let config = JSON.stringify(this);
  12. CS.System.IO.File.WriteAllText(cfgPath, config);
  13. }
  14. static load() {
  15. if (CS.System.IO.File.Exists(cfgPath) == false) {
  16. return null;
  17. }
  18. let text = CS.System.IO.File.ReadAllText(cfgPath);
  19. return JSON.parse(text);
  20. }
  21. }
  22. exports.default = Config;