Пример #1
0
        static TechAdvancingStartupClass()     // Initialize the mod
        {
            ConfigTabValueSavedAttribute.BuildDefaultValueCache();

            ConfigButtonTexture = ContentFinder <Texture2D> .Get("TechAdvancingSettingsLogo", true);

            HarmonyDetours.Setup();

            if (MP.enabled)
            {
                MP.RegisterAll();
            }
        }
Пример #2
0
        static Injector_GHXXTechAdvancing()     //Detour the method that gets run when a research gets finished. Old school detour. Could be replaced with harmony
        {
            MethodInfo source      = typeof(ResearchManager).GetMethod("ReapplyAllMods", BindingFlags.Instance | BindingFlags.Public);
            MethodInfo destination = typeof(_ResearchManager).GetMethod("_ReapplyAllMods", BindingFlags.Static | BindingFlags.NonPublic);

            //Log.Message("Source method = " + source.Name + "Target = " + destination.Name);

            Detour.DoDetour(source, destination);
            GameObject initializer = new GameObject("GHXXTAMapComponentInjector");

            initializer.AddComponent <MapComponentInjector>();
            UnityEngine.Object.DontDestroyOnLoad(initializer);

            HarmonyDetours.Setup();
        }