BuildCompileEvent.cs 868 B

12345678910111213141516171819202122232425262728293031
  1. using XGame.Editor.Compiler;
  2. namespace XGame.Editor.Build
  3. {
  4. internal class BuildCompileEvent : ICompileEvent
  5. {
  6. public BuildContext context;
  7. public int Priority { get; private set; }
  8. public void OnCompileFailed(CompileResult result)
  9. {
  10. BuildUtils.CmdCompleted(result.isCopyAssemblyFailed ? BuildErrorCode.CopyAssemblyFailed : BuildErrorCode.CompileFailed, context);
  11. }
  12. public void OnCompileSuccess()
  13. {
  14. BuildUtils.CmdCompleted(BuildErrorCode.CmdCompleted, context);
  15. }
  16. public static ICompileEvent RegistEvent(BuildContext context)
  17. {
  18. var eventImpl = new BuildCompileEvent()
  19. {
  20. context = context
  21. };
  22. CompileScriptsHandle.RegistEvent(eventImpl);
  23. return eventImpl;
  24. }
  25. }
  26. }