main.ts 485 B

123456789101112131415161718
  1. //FYI: https://github.com/Tencent/puerts/blob/master/doc/unity/manual.md
  2. import { FairyEditor } from 'csharp';
  3. import { genCode } from './GenCode_TS';
  4. function onPublish(handler: FairyEditor.PublishHandler) {
  5. if (!handler.genCode) return;
  6. handler.genCode = false; //prevent default output
  7. console.log('Handling gen code in plugin');
  8. genCode(handler); //do it myself
  9. }
  10. function onDestroy() {
  11. //do cleanup here
  12. }
  13. export { onPublish, onDestroy };