GameStart.cs 1021 B

12345678910111213141516171819202122232425262728293031323334353637
  1. using System;
  2. using System.Linq;
  3. using System.Reflection;
  4. namespace ET
  5. {
  6. public static class GameStart
  7. {
  8. public static void Start()
  9. {
  10. try
  11. {
  12. string[] assemblyNames = { "Unity.Model.dll", "Unity.Hotfix.dll", "Unity.ModelView.dll", "Unity.HotfixView.dll" };
  13. foreach (Assembly assembly in AppDomain.CurrentDomain.GetAssemblies())
  14. {
  15. string assemblyName = $"{assembly.GetName().Name}.dll";
  16. if (!assemblyNames.Contains(assemblyName))
  17. {
  18. continue;
  19. }
  20. Game.EventSystem.Add(assembly);
  21. }
  22. ProtobufHelper.Init();
  23. Game.Options = new Options();
  24. Game.EventSystem.Publish(new EventType.AppStart()).Coroutine();
  25. }
  26. catch (Exception e)
  27. {
  28. Log.Error(e);
  29. }
  30. }
  31. }
  32. }