コード例 #1
0
 public override void OnLevelUnloading()
 {
     if (!HarmonyHelper.IsHarmonyInstalled)
     {
         return;
     }
     try
     {
         GetClosestLanePositionPatch.Undo();
         AddLaneConnectionPatch.Undo();
         RemoveLaneConnectionPatch.Undo();
         Log.Info("patching reverted");
     }
     catch (Exception e)
     {
         Log.Error($"Failed reverting patches: {e}");
     }
     base.OnLevelUnloading();
     Log.Info("level unloaded");
 }
コード例 #2
0
 public override void OnLevelLoaded(LoadMode mode)
 {
     base.OnLevelLoaded(mode);
     if (!HarmonyHelper.IsHarmonyInstalled)
     {
         return;
     }
     try
     {
         ElevatedStops.AddElevatedStoptypes();
         ElevatedStops.AllowStreetLightsOnElevatedStops();
         GetClosestLanePositionPatch.Apply();
         AddLaneConnectionPatch.Apply();
         RemoveLaneConnectionPatch.Apply();
         Log.Info("Patches deployed");
     }
     catch (Exception e)
     {
         Log.Error($"Failed deploying Patches: {e}");
     }
 }