CreateOrUpdateSubjects() public static method

public static CreateOrUpdateSubjects ( ) : Subject>.Dictionary
return Subject>.Dictionary
Exemplo n.º 1
0
        public static void AttachBootstrap()
        {
            try {
                Hooks.CreateOrUpdateSubjects();

                System.Reflection.Assembly executingAssembly = System.Reflection.Assembly.GetExecutingAssembly();
                Type[] types = executingAssembly.GetTypes();
                for (int i = 0; i < types.Length; i++)
                {
                    object[] customAttributes = types[i].GetCustomAttributes(typeof(ConsoleSystem.Factory), false);
                    if (customAttributes != null && customAttributes.Length != 0)
                    {
                        ConsoleSystem.Factory factory = customAttributes[0] as ConsoleSystem.Factory;
                        typeof(ConsoleSystem.Index).CallStaticMethod("BuildFields", types[i], factory);
                        typeof(ConsoleSystem.Index).CallStaticMethod("BuildProperties", types[i], factory);
                        typeof(ConsoleSystem.Index).CallStaticMethod("BuildFunctions", types[i], factory);
                    }
                }

                DirectoryConfig.GetInstance();
                CoreConfig.GetInstance();
                Config.GetInstance();

                if (!pluton.enabled)
                {
                    Debug.Log("[Bootstrap] Pluton is disabled!");
                    return;
                }

                Init();

                PlutonLoaded = true;
                Console.WriteLine("Pluton Loaded!");
            } catch (Exception ex) {
                Debug.LogException(ex);
                Debug.Log("[Bootstarp] Error while loading Pluton!");
            }
        }