using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using Crest; using HarmonyLib; using UnityEngine; using UnityEngine.SceneManagement; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("RadFixes")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("raddude")] [assembly: AssemblyProduct("RadFixes")] [assembly: AssemblyCopyright("Copyright © 2026")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("56796b16-fa96-4077-8440-cc4ba31a62f5")] [assembly: AssemblyFileVersion("1.2.1.0")] [assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.2.1.0")] [module: UnverifiableCode] namespace RadFixes; internal class BoatDamageFixes { [HarmonyPatch(typeof(BoatDamage), "Impact")] public static class BoatDamagePatches { public static bool Prefix() { if (inIFrames) { RF_Plugin.LogDebug("In IFrames, no damage received"); } return !inIFrames; } } [HarmonyPatch(typeof(Shipyard), "DischargeShip")] public static class ShipyardPatches { public static void Postfix(Shipyard __instance) { ((MonoBehaviour)__instance).StartCoroutine(IFrameCoroutine()); } } [CompilerGenerated] private sealed class d__3 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__3(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; inIFrames = true; <>2__current = (object)new WaitForSeconds(5f); <>1__state = 1; return true; case 1: <>1__state = -1; inIFrames = false; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } internal static bool inIFrames; [IteratorStateMachine(typeof(d__3))] private static IEnumerator IFrameCoroutine() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__3(0); } } internal static class Extensions { public static T GetPrivateField(this object obj, string field) { return (T)Traverse.Create(obj).Field(field).GetValue(); } public static void SetPrivateField(this object obj, string field, object value) { Traverse.Create(obj).Field(field).SetValue(value); } public static void SetPrivateField(string field, object value) { Traverse.Create(typeof(T)).Field(field).SetValue(value); } public static object InvokePrivateMethod(this object obj, string method, params object[] parameters) { return AccessTools.Method(obj.GetType(), method, (Type[])null, (Type[])null).Invoke(obj, parameters); } } internal class SettingsMenuFixes { [HarmonyPatch(typeof(StartMenu))] private class StartMenuPatches { [HarmonyPrefix] [HarmonyPatch("GameToSettings")] public static void PauseSound() { AudioListener.pause = true; } [HarmonyPrefix] [HarmonyPatch("SettingsToGame")] public static void UnPauseSound() { AudioListener.pause = false; } [HarmonyPrefix] [HarmonyPatch("EnableSettingsMenu")] public static bool BoatCameraNoMenu(GameObject ___logo) { if (BoatCamera.on && !Object.op_Implicit((Object)(object)GameState.currentShipyard) && RF_Plugin.boatCameraMenuZoom.Value.Equals("DisableMenu")) { ___logo.SetActive(false); return false; } return true; } [HarmonyPrefix] [HarmonyPatch("LateUpdate")] public static bool BoatCameraNoMenuSettingsToGame(StartMenu __instance) { if ((Input.GetKeyDown("escape") || Input.GetKeyDown("f10") || Input.GetKeyDown((KeyCode)336)) && GameState.playing && !GameState.currentlyLoading && !Object.op_Implicit((Object)(object)GameState.currentShipyard) && BoatCamera.on && GameState.wasInSettingsMenu && RF_Plugin.boatCameraMenuZoom.Value.Equals("DisableMenu")) { __instance.InvokePrivateMethod("SettingsToGame"); return false; } return true; } } [HarmonyPatch(typeof(MouseButtonPointer))] private class MouseButtonPointerPatches { [HarmonyPrefix] [HarmonyPatch("LateUpdate")] public static bool DisableMouseInputLostFocus() { if (!Application.isFocused) { return false; } return true; } } [HarmonyPatch(typeof(BoatCamera))] private class BoatCameraPatches { [HarmonyPrefix] [HarmonyPatch("Update")] public static bool BoatCameraSettingsMenu(bool ___on) { if (GameState.playing && !GameState.currentlyLoading && !Object.op_Implicit((Object)(object)GameState.currentShipyard) && GameState.wasInSettingsMenu && !___on && GameInput.GetKeyDown((InputName)16)) { return false; } if (GameState.wasInSettingsMenu && !Object.op_Implicit((Object)(object)GameState.currentShipyard) && ___on && RF_Plugin.boatCameraMenuZoom.Value.Equals("DisableZoom")) { return false; } if (GameState.wasInSettingsMenu && !Object.op_Implicit((Object)(object)GameState.currentShipyard) && ___on && GameInput.GetKeyDown((InputName)16) && RF_Plugin.boatCameraMenuZoom.Value.Equals("DisableMenu")) { return false; } return true; } } } internal class ItemFixes { [HarmonyPatch(typeof(ShipItemFishingRod))] private class ShipItemFishingRodPatches { [HarmonyPostfix] [HarmonyPatch("OnLoad")] public static void OnLoadSetReverseSpinner(ref float ___spinnerSpeed) { if (RF_Plugin.enableFishingReelFix.Value) { ___spinnerSpeed = -40f; } } [HarmonyPostfix] [HarmonyPatch("OnBuy")] public static void OnBuySetReverseSpinner(ref float ___spinnerSpeed) { if (RF_Plugin.enableFishingReelFix.Value) { ___spinnerSpeed = -40f; } } } [HarmonyPatch(typeof(GoPointer))] private static class GoPointerPatches { [HarmonyPatch("DoRaycast")] public static bool Prefix(GoPointer __instance) { if (GameState.playing && !GameState.currentlyLoading) { PickupableItem heldItem = __instance.GetHeldItem(); if ((Object)(object)heldItem != (Object)null && ((Component)heldItem).GetComponent()?.name == "spyglass" && ((PickupableItem)((Component)heldItem).GetComponent()).heldRotationOffset != -22f) { ((Component)__instance.lookUI).gameObject.SetActive(false); return false; } ((Component)__instance.lookUI).gameObject.SetActive(true); } return true; } [HarmonyPatch("LateUpdate")] public static bool Prefix(GoPointer __instance, PickupableItem ___heldItem, GoPointerButton ___pointedAtButton) { if (GameState.playing && !GameState.currentlyLoading && (Object)(object)___heldItem != (Object)null && ((Component)___heldItem).GetComponent()?.name == "spyglass" && Object.op_Implicit((Object)(object)___pointedAtButton) && ___pointedAtButton.allowPlacingItems && __instance.AltButtonDown()) { return false; } return true; } } [HarmonyPatch(typeof(ShipItemChipLog), "OnBuy")] private class ShipItemChipLogPatches { public static bool Prefix(ShipItemChipLog __instance, ref Rigidbody ___bobberBody, ConfigurableJoint ___bobberJoint, ref Vector3 ___initialBobberPos, ref SimpleFloatingObject ___bobberFloater) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) ___bobberBody = ((Component)___bobberJoint).GetComponent(); ((Component)___bobberJoint).transform.parent = Refs.shiftingWorld; ___initialBobberPos = ((Joint)___bobberJoint).connectedAnchor; ___bobberFloater = ((Component)___bobberBody).GetComponent(); _ = ((ShipItem)__instance).sold; return false; } } } internal class NREFixes { [HarmonyPatch(typeof(MouseLook), "ToggleMouseLookAndCursor")] private class MouseLookPatches { public static bool Prefix() { if ((Object)(object)MouseButtonPointer.instance == (Object)null) { return false; } return true; } } [HarmonyPatch(typeof(Refs), "SetPlayerControl")] private class RefsPatches { public static bool Prefix() { if ((Object)(object)Refs.ovrController == (Object)null || (Object)(object)Refs.charController == (Object)null) { return false; } return true; } } [HarmonyPatch(typeof(NPCBoatController))] private class NPCBoatControllerPatches { [HarmonyPatch("Start")] public static bool Prefix(NPCBoatController __instance, ref Collider ___col, ref Rigidbody ___rigidbody) { Transform currentTarget = __instance.currentTarget; int currentTargetIndex = ((!((Object)(object)((currentTarget != null) ? ((Component)currentTarget).GetComponent() : null) == (Object)null)) ? ((Component)__instance.currentTarget).GetComponent().index : (-1)); ___col = ((Component)__instance).GetComponent(); ___rigidbody = ((Component)__instance).GetComponent(); __instance.currentTargetIndex = currentTargetIndex; __instance.currentDockIndex = -1; return false; } [HarmonyPatch("OnTriggerEnter")] public static bool Prefix(Collider other, NPCBoatController __instance) { if (!GameState.currentlyLoading && GameState.playing && (Object)(object)((Component)other).transform == (Object)(object)__instance.currentTarget) { NPCBoatWaypoint component = ((Component)other).GetComponent(); if (Object.op_Implicit((Object)(object)component) && component.navigationWaypoint) { __instance.currentTarget = ((Component)component.GetNextDestination()).transform; __instance.currentTargetIndex = component.GetNextDestination().index; return false; } Transform currentTarget = __instance.currentTarget; int currentDockIndex = ((!((Object)(object)((currentTarget != null) ? ((Component)currentTarget).GetComponent() : null) == (Object)null)) ? ((Component)__instance.currentTarget).GetComponent().index : (-1)); __instance.currentDock = __instance.currentTarget; __instance.currentDockIndex = currentDockIndex; __instance.currentTarget = null; __instance.currentTargetIndex = -1; } return false; } } [HarmonyPatch(typeof(Sail), "Start")] private class SailPatches { public static bool Prefix(Sail __instance, ref Rigidbody ___sailRigidbody, Rigidbody ___shipRigidbody, ref BoatDamage ___damage, ref float ___minAngle, ref float ___maxAngle, SailCategory ___category) { //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Invalid comparison between Unknown and I4 //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) ___sailRigidbody = ((Component)__instance).GetComponent(); if (!Object.op_Implicit((Object)(object)___sailRigidbody)) { Debug.LogError((object)(((Object)((Component)__instance).gameObject).name + ": no sailRigidbody.")); } ___damage = ((___shipRigidbody != null) ? ((Component)___shipRigidbody).gameObject.GetComponent() : null); HingeJoint component = ((Component)__instance).GetComponent(); JointLimits limits; if (___minAngle == 0f && (Object)(object)component != (Object)null) { limits = component.limits; ___minAngle = ((JointLimits)(ref limits)).min; } if (___maxAngle == 0f && (Object)(object)component != (Object)null) { limits = component.limits; ___maxAngle = ((JointLimits)(ref limits)).max; } if ((int)___category == 5) { ___sailRigidbody.mass = 0.1f; ___sailRigidbody.angularDrag = 1f; } __instance.SetSailArea(); return false; } } [HarmonyPatch(typeof(PortDude), "OnTriggerEnter")] private class PortDudePatches { public static bool Prefix(Collider other) { if (((Component)other).CompareTag("Player") || !((Component)other).CompareTag("Good")) { return false; } Good component = ((Component)other).GetComponent(); if ((Object)(object)component == (Object)null || component.GetMissionIndex() == -1) { return false; } return true; } } } internal class ContinueMenuFixes { [HarmonyPatch(typeof(StartMenu), "ButtonClick", new Type[] { typeof(StartMenuButtonType) })] private class StartMenuPatches { public static void Prefix(StartMenuButtonType button, ref int __state) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Invalid comparison between Unknown and I4 __state = SaveSlots.activeSlotsCount; if ((int)button == 1) { SaveSlots.activeSlotsCount++; } } public static void Postfix(StartMenuButtonType button, int __state) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Invalid comparison between Unknown and I4 if ((int)button == 1) { SaveSlots.activeSlotsCount = __state; } } } [HarmonyPatch(typeof(BackupSavesListUI), "Awake")] private class BackupSavesListUIPatches { public static void Postfix(ref int ___showingListFor) { ___showingListFor = -1; } } } internal class UIFixes { [HarmonyPatch(typeof(EconomyUI))] private class EconomyUIPatches { [HarmonyPatch("OpenUI")] public static void Postfix(EconomyUI __instance, EconomyUIButton[] ___goodsListButtons, ref TextMesh ___textPageNumber, int ___currentGoodsListPage) { int num = Mathf.CeilToInt((float)__instance.goodCount / (float)___goodsListButtons.Length); int num2 = ___currentGoodsListPage; if (num2 < 0) { num2 = 0; } if (num2 > num - 1) { num2 = num - 1; } ___textPageNumber.text = $"{num2 + 1} / {num}"; } [HarmonyPatch("RefreshGoodsList")] public static bool Prefix(EconomyUI __instance, EconomyUIButton[] ___goodsListButtons, int ___currentGoodsListPage, EconomyUIGoodsOrder ___goodsOrder, Material[] ___buttonMaterials, IslandMarket ___currentIsland) { int num = ___goodsListButtons.Length; for (int i = 0; i < num; i++) { int num2 = num * ___currentGoodsListPage + i + 1; if (num2 >= ___goodsOrder.goods.Length) { ((Component)___goodsListButtons[i]).gameObject.SetActive(false); continue; } ShipItem goodAt = ___goodsOrder.GetGoodAt(num2); int goodIndex = ___goodsOrder.GetGoodIndex(num2); if (Object.op_Implicit((Object)(object)goodAt) && goodIndex != 51) { ___goodsListButtons[i].SetButtonText(goodAt.name); } else { ___goodsListButtons[i].SetButtonText("---"); } if (!Object.op_Implicit((Object)(object)goodAt)) { ___goodsListButtons[i].SetButtonMaterial(___buttonMaterials[1]); } else if (__instance.currentSelectedGood == goodIndex) { ___goodsListButtons[i].SetButtonMaterial(___buttonMaterials[2]); } else if (___currentIsland.HasGood(goodIndex)) { ___goodsListButtons[i].SetButtonMaterial(___buttonMaterials[0]); } else { ___goodsListButtons[i].SetButtonMaterial(___buttonMaterials[1]); } ___goodsListButtons[i].SetButtonIndex(goodIndex); ((Component)___goodsListButtons[i]).gameObject.SetActive(true); } return false; } } [HarmonyBefore(new string[] { "com.raddude82.radrefinements" })] [HarmonyPatch(typeof(GPButtonInventorySlot), "OnItemClick")] private class GPButtonInventorySlotPatches { public static void Prefix() { if (BuyItemUI.instance.menu.activeInHierarchy) { BuyItemUI.instance.DeactivateUI(); } } } } [BepInPlugin("com.raddude82.radfixes", "RadFixes", "1.2.1")] public class RF_Plugin : BaseUnityPlugin { public const string PLUGIN_GUID = "com.raddude82.radfixes"; public const string PLUGIN_NAME = "RadFixes"; public const string PLUGIN_VERSION = "1.2.1"; private static ManualLogSource _logger; internal static ConfigEntry enableFishingReelFix; internal static ConfigEntry boatCameraMenuZoom; internal static RF_Plugin Instance { get; private set; } internal static void LogDebug(string message) { _logger.LogDebug((object)message); } internal static void LogInfo(string message) { _logger.LogInfo((object)message); } internal static void LogWarning(string message) { _logger.LogWarning((object)message); } internal static void LogError(string message) { _logger.LogError((object)message); } private void Awake() { //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Expected O, but got Unknown if ((Object)(object)Instance != (Object)null && (Object)(object)Instance != (Object)(object)this) { Object.Destroy((Object)(object)((Component)this).gameObject); return; } Instance = this; _logger = ((BaseUnityPlugin)this).Logger; enableFishingReelFix = ((BaseUnityPlugin)this).Config.Bind("Settings", "Enable reel fix", true, "If enabled will rotate the fishing rod reel in the direction it should."); boatCameraMenuZoom = ((BaseUnityPlugin)this).Config.Bind("Settings", "Boat camera settings menu zoom fix", "DisableZoom", new ConfigDescription("While paused in boat camera mode: DisableZoom will disable zooming in and out, DisableMenu will disable the menu, None will leave it as it is.", (AcceptableValueBase)(object)new AcceptableValueList(new string[3] { "DisableZoom", "DisableMenu", "None" }), Array.Empty())); Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), "com.raddude82.radfixes"); SceneManager.sceneLoaded += SceneFixes.SceneLoaded; } } internal class SceneFixes { internal static void SceneLoaded(Scene scene, LoadSceneMode loadSceneMode) { if (((Scene)(ref scene)).name == "island 1 A Gold Rock") { GoldRockCity(); } if (((Scene)(ref scene)).name == "island 13 E (Sage Hills)") { SageHills(); } if (((Scene)(ref scene)).name == "island 18 M (Oasis)") { HappyBay(); } if (((Scene)(ref scene)).name == "island 19 M (Eastwind)") { Eastwind(); } if (((Scene)(ref scene)).name == "island 25 (chronos)") { Chronos(); } } private static void GoldRockCity() { GameObject islandScenery = GameObject.Find("island 1 A (gold rock) scenery"); SetShopkeeper(islandScenery, "shop (3)", "shopkeeper (5)"); SetShopkeeper(islandScenery, "shop (7)", "shopkeeper (9)"); } private static void SetShopkeeper(GameObject islandScenery, string shopName, string shopkeeperName) { ShopArea val = ((islandScenery != null) ? ((IEnumerable)islandScenery.GetComponentsInChildren()).FirstOrDefault((Func)((ShopArea k) => ((Object)k).name == shopName)) : null); Shopkeeper val2 = ((islandScenery != null) ? ((IEnumerable)islandScenery.GetComponentsInChildren()).FirstOrDefault((Func)((Shopkeeper k) => ((Object)k).name == shopkeeperName)) : null); if (!((Object)(object)val == (Object)null) && !((Object)(object)val2 == (Object)null)) { if ((Object)(object)val.GetShopkeeper() == (Object)(object)val2 && (Object)(object)val2.GetPrivateField("shop") == (Object)(object)val) { RF_Plugin.LogWarning("Gold Rock City shop fix not needed for " + shopkeeperName + " - " + shopName); return; } val.SetPrivateField("keeper", val2); val2.SetPrivateField("shop", val); } } private static void SageHills() { GameObject val = GameObject.Find("island 13 E (sage hills) scenery"); ShopArea val2 = ((val != null) ? ((IEnumerable)val.GetComponentsInChildren()).FirstOrDefault((Func)((ShopArea k) => ((Object)k).name == "shop area (2)")) : null); if (!((Object)(object)val2 == (Object)null)) { if (val2.openAtNight) { RF_Plugin.LogWarning("Sage Hills shop fix not needed"); } else { val2.openAtNight = true; } } } private static void HappyBay() { GameObject val = GameObject.Find("island 18 M (Oasis) scenery"); Shopkeeper val2 = ((val != null) ? ((IEnumerable)val.GetComponentsInChildren()).FirstOrDefault((Func)((Shopkeeper k) => ((Object)k).name == "shopkeeper")) : null); if (!((Object)(object)val2 == (Object)null)) { RF_NPCSchedule obj = val.gameObject.AddComponent(); obj.SetPrivateField("_keeper", val2); } } private static void Eastwind() { GameObject val = GameObject.Find("island 19 M (Eastwind) scenery"); IEnumerable enumerable = ((val != null) ? (from k in val.GetComponentsInChildren() where ((Object)k).name == "shopkeeper (1)" select k) : null); Shopkeeper val2 = null; foreach (Shopkeeper item in enumerable) { val2 = item; if ((Object)(object)item.GetPrivateField("shop") == (Object)null) { ((Object)item).name = "shopkeeper (3)"; break; } } ShopArea val3 = ((val != null) ? ((IEnumerable)val.GetComponentsInChildren()).FirstOrDefault((Func)((ShopArea k) => ((Object)k).name == "shop area (2)")) : null); if (!((Object)(object)val3 == (Object)null) && !((Object)(object)val2 == (Object)null)) { if ((Object)(object)val3.GetShopkeeper() == (Object)(object)val2 && (Object)(object)val2.GetPrivateField("shop") == (Object)(object)val3) { RF_Plugin.LogWarning("Eastwind shop fix not needed"); return; } val3.SetPrivateField("keeper", val2); val2.SetPrivateField("shop", val3); } } private static void Chronos() { GameObject val = GameObject.Find("island 25 (chronos) scenery"); IEnumerable enumerable = ((val != null) ? (from k in val.GetComponentsInChildren() where ((Object)k).name == "shop area" select k) : null); ShopArea val2 = null; ShopArea val3 = null; foreach (ShopArea item in enumerable) { if (item.itemsForSale.Count > 0 && item.itemsForSale[0].name == "bun") { val2 = item; } if (item.itemsForSale.Count > 0 && item.itemsForSale[0].name == "trout") { val3 = item; } } Shopkeeper val4 = ((val != null) ? ((IEnumerable)val.GetComponentsInChildren()).FirstOrDefault((Func)((Shopkeeper k) => ((Object)k).name == "shopkeeper (3)")) : null); Shopkeeper val5 = ((val != null) ? ((IEnumerable)val.GetComponentsInChildren()).FirstOrDefault((Func)((Shopkeeper k) => ((Object)k).name == "shopkeeper (4)")) : null); if ((Object)(object)val3 != (Object)null && (Object)(object)val5 != (Object)null) { if ((Object)(object)val3.GetShopkeeper() == (Object)(object)val5 && (Object)(object)val5.GetPrivateField("shop") == (Object)(object)val3) { RF_Plugin.LogWarning("Chronos shop fix not needed for " + ((Object)val5).name + " - " + ((Object)val3).name); } val3.SetPrivateField("keeper", val5); val5.SetPrivateField("shop", val3); } if ((Object)(object)val2 != (Object)null && (Object)(object)val4 != (Object)null) { if ((Object)(object)val2.GetShopkeeper() == (Object)(object)val4 && (Object)(object)val4.GetPrivateField("shop") == (Object)(object)val2) { RF_Plugin.LogWarning("Chronos shop fix not needed for " + ((Object)val4).name + " - " + ((Object)val2).name); } val2.SetPrivateField("keeper", val4); val4.SetPrivateField("shop", val2); } } } public class RF_NPCSchedule : MonoBehaviour { [SerializeField] private Shopkeeper _keeper; private void Awake() { _keeper = null; } public void Update() { if (!Object.op_Implicit((Object)(object)_keeper)) { return; } if (Sun.sun.localTime >= 18f || Sun.sun.localTime < 7f) { if (((Component)_keeper).gameObject.activeInHierarchy) { ((Component)_keeper).gameObject.SetActive(false); } } else if (!((Component)_keeper).gameObject.activeInHierarchy) { ((Component)_keeper).gameObject.SetActive(true); } } }