public static void Postfix(BaseSpotLight __instance) { TechType techType = CraftData.GetTechType(__instance.gameObject); if (techType == TechType.Spotlight) { __instance.gameObject.EnsureComponent <ColoringController>(); } }
private void Init() { spotLight = GetComponent <BaseSpotLight>(); identifier = GetComponent <PrefabIdentifier>(); id = identifier.Id; OnProtoDeserialize(null); initialized = true; }
public static void Postfix(BaseSpotLight __instance) { var techType = CraftData.GetTechType(__instance.gameObject); if (techType == TechType.Spotlight) { var cc = __instance.gameObject.EnsureComponent <ColoringController>(); cc.enabled = __instance.constructed; } }
static bool Prefix(BaseSpotLight __instance, ref bool __result) { var toggle = __instance.GetComponent <SpotlightToggle>(); if (toggle != null && !toggle.IsOn) { __result = false; return(false); } else { return(true); } }
public SpotLightPowerConsumerInfo(BaseSpotLight light) : base(light.name) { this.light = light; }
public static void Prefix(BaseSpotLight __instance) { typeof(BaseSpotLight).GetField("powerPerSecond", BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.Instance).SetValue(__instance, QMultiModSettings.Instance.SpotlightPowerPerSecond); typeof(BaseSpotLight).GetField("updateInterval", BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.Instance).SetValue(__instance, QMultiModSettings.Instance.SpotlightUpdateInterval); }
static void Prefix(BaseSpotLight __instance) { __instance.gameObject.AddComponent <SpotlightToggle>(); Logger.Log("Added SpotlightToggle component to BaseSpotLight"); }