Files
2025-05-10 10:59:58 +08:00

47 lines
1.5 KiB
TypeScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// //FYI: https://github.com/Tencent/puerts/blob/master/doc/unity/manual.md
import FairyGUI = CS.FairyGUI;
import FairyEditor = CS.FairyEditor;
import System = CS.System;
// import { genCode } from './GenCode_CSharp';
import { genCSCode } from './GenCode_CSharp';
import { runGenCodeCustom } from './GenCodeCustomInspector';
import { runLanguageCustom, languageDestroy } from './LanguageCustomInspector';
import genSetting from './GenCodeSettings'
const App = FairyEditor.App;
const File = System.IO.File;
// console.log(App.project.settingsPath+"/Adaptation.json");
// console.log(System.IO.File.ReadAllText(App.project.settingsPath+"/Adaptation.json"))
runGenCodeCustom()
runLanguageCustom()
function onPublish(handler: FairyEditor.PublishHandler) {
if (!handler.genCode) return;
handler.genCode = false; //prevent default output
console.log('Handling gen code in plugin 1');
genCSCode(handler);
}
var callBack = context => {
genSetting.packageItemChange(context);
}
function onDestroy() {
languageDestroy()
//do cleanup here
//App.project.
//console.error("坑爹的ts没法注销事件刷新后请重启fgui")
//App.Off(FairyEditor.EditorEvents.PackageItemChanged, callBack)
}
//App.On(FairyEditor.EditorEvents.PackageItemChanged, callBack)
//console.log("packages count=", FairyEditor)
// for (let index = 0; index < App.project.allPackages.Count; index++) {
// let pkg: FairyEditor.FPackage = App.project.allPackages[index];
// console.log("package.items=", pkg)
// }
export { onPublish, onDestroy };