Пример #1
0
        /// <summary>
        /// Executed whenever a level completes its loading process.
        /// This mod the activates and patches the game using Hramony library.
        /// </summary>
        /// <param name="mode">The loading mode.</param>
        public override void OnLevelLoaded(LoadMode mode)
        {
            /*
             * This function can still be called when loading up the asset editor,
             * so we have to check where we are right now.
             */

            switch (mode)
            {
            case LoadMode.LoadGame:
            case LoadMode.NewGame:
            case LoadMode.LoadScenario:
            case LoadMode.NewGameFromScenario:
                break;

            default:
                return;
            }

            UnifyHarmonyVersions();
            PatchController.Activate();
        }
Пример #2
0
 /// <summary>
 /// Executed whenever a map is being unloaded.
 /// This mod then undoes the changes using the Harmony library.
 /// </summary>
 public override void OnLevelUnloading()
 {
     UnifyHarmonyVersions();
     PatchController.Deactivate();
 }