From 122334b4ec7250307dba5cfa4ccee057ef58e2a8 Mon Sep 17 00:00:00 2001 From: LazyDuchess <42678262+LazyDuchess@users.noreply.github.com> Date: Wed, 16 Nov 2022 21:08:40 -0300 Subject: [PATCH] Initialize all loaded assemblies on Main(), not just the game one. --- Assets/Scripts/OpenTS2/Assemblies/AssemblyHelper.cs | 10 ++++++++++ Assets/Scripts/OpenTS2/Engine/Core/Main.cs | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Assets/Scripts/OpenTS2/Assemblies/AssemblyHelper.cs b/Assets/Scripts/OpenTS2/Assemblies/AssemblyHelper.cs index 1f35569..aa64897 100644 --- a/Assets/Scripts/OpenTS2/Assemblies/AssemblyHelper.cs +++ b/Assets/Scripts/OpenTS2/Assemblies/AssemblyHelper.cs @@ -11,6 +11,16 @@ namespace OpenTS2.Assemblies public static class AssemblyHelper { public static Action AssemblyProcesses; + + public static void InitializeLoadedAssemblies() + { + var assemblies = AppDomain.CurrentDomain.GetAssemblies(); + foreach(var element in assemblies) + { + InitializeAssembly(element); + } + } + /// /// Initializes an assembly, does Reflection tasks like parsing attributes. /// diff --git a/Assets/Scripts/OpenTS2/Engine/Core/Main.cs b/Assets/Scripts/OpenTS2/Engine/Core/Main.cs index f295f48..90b3de8 100644 --- a/Assets/Scripts/OpenTS2/Engine/Core/Main.cs +++ b/Assets/Scripts/OpenTS2/Engine/Core/Main.cs @@ -30,7 +30,7 @@ namespace OpenTS2.Engine.Core Factories.TextureFactory = new TextureFactory(); CodecAttribute.Initialize(); //Initialize the game assembly, do all reflection things. - AssemblyHelper.InitializeAssembly(Assembly.GetExecutingAssembly()); + AssemblyHelper.InitializeLoadedAssemblies(); s_initialized = true; } }