private static void AfterAddTravelSite_RestorePause(UIStateVehicleSelected __instance, ref bool __state) { try { var craft_count = GameUtl.CurrentLevel().GetComponent <GeoLevelController>().ViewerFaction.Vehicles.Count(); //Verbo( "Craft count = {0}", craft_count ); if ((craft_count <= 1 && Mod.Config.Auto_Unpause_Single) || (craft_count > 1 && Mod.Config.Auto_Unpause_Multiple)) { return; } Verbo("New vehicle travel plan. Setting time to {0}.", __state ? "Paused" : "Running"); getContext(__instance).Level.Timing.Paused = __state; } catch (Exception ex) { Error(ex); } }
private static Component DefaultDumpSubject() { var level = GameUtl.CurrentLevel(); if (level == null || level.CurrentState != Level.State.Playing) { return(level.gameObject.transform); } if (level.GetComponent <MenuLevelController>() != null) { return(level.GetComponent <HomeScreenView>()?.HomeScreenModules); } if (level.GetComponent <GeoLevelController>() != null) { return(level.GetComponent <GeoscapeView>()?.GeoscapeModules); } if (level.GetComponent <TacticalLevelController>() != null) { return(level.GetComponent <TacticalView>()?.TacticalModules); } return(null); }