private static void Registers() { if (!msInitialized) { msInitialized = true; GlobalReflectionCache.LoadAssemblies(); NameToTypeUtility.Initialize(); var allModules = GlobalReflectionCache.FindTypes <ModuleAttribute>(false); if (allModules != null) { allModules.Sort(EngineComparers.defaultModuleAttributeComparer); foreach (var m in allModules) { //DebugUtility.Log(LoggerTags.Engine, "Module {0} Loaded.", m); ModuleAttribute attr = m.GetCustomAttribute <ModuleAttribute>(true); if (!string.IsNullOrEmpty(attr.entryPoint)) { var entry = m.GetMethod(attr.entryPoint, System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic); if (entry != null) { //DebugUtility.Log(LoggerTags.Engine, "Module {0} Entry.", m); entry.Invoke(null, null); } } } } } }