WeaverFuse.cs 689 B

12345678910111213141516171819202122
  1. // safety fuse for weaver to flip.
  2. // runtime can check this to ensure weaving succeded.
  3. // otherwise running server/client would give lots of random 'writer not found' etc. errors.
  4. // this is much cleaner.
  5. //
  6. // note that ILPostProcessor errors already block entering playmode.
  7. // however, issues could still stop the weaving from running at all.
  8. // WeaverFuse can check if it actually ran.
  9. namespace Mirror
  10. {
  11. public static class WeaverFuse
  12. {
  13. // this trick only works for ILPostProcessor.
  14. // CompilationFinishedHook can't weaver Mirror.dll.
  15. public static bool Weaved() =>
  16. #if UNITY_2020_3_OR_NEWER
  17. false;
  18. #else
  19. true;
  20. #endif
  21. }
  22. }