"use strict";
// //FYI: https://github.com/Tencent/puerts/blob/master/doc/unity/manual.md
Object.defineProperty(exports, "__esModule", { value: true });
exports.onDestroy = exports.onPublish = void 0;
var FairyEditor = CS.FairyEditor;
var System = CS.System;
// import { genCode } from './GenCode_CSharp';
const GenCode_CSharp_1 = require("./GenCode_CSharp");
const GenCodeCustomInspector_1 = require("./GenCodeCustomInspector");
const LanguageCustomInspector_1 = require("./LanguageCustomInspector");
const GenCodeSettings_1 = require("./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"))
(0, GenCodeCustomInspector_1.runGenCodeCustom)();
(0, LanguageCustomInspector_1.runLanguageCustom)();
function onPublish(handler) {
    if (!handler.genCode)
        return;
    handler.genCode = false; //prevent default output
    console.log('Handling gen code in plugin 1');
    (0, GenCode_CSharp_1.genCSCode)(handler);
}
exports.onPublish = onPublish;
var callBack = context => {
    GenCodeSettings_1.default.packageItemChange(context);
};
function onDestroy() {
    (0, LanguageCustomInspector_1.languageDestroy)();
    //do cleanup here
    //App.project.
    //console.error("坑爹的ts没法注销事件，刷新后请重启fgui")
    //App.Off(FairyEditor.EditorEvents.PackageItemChanged, callBack)
}
exports.onDestroy = onDestroy;
