public static void Postfix(BaseSpotLight __instance)
        {
            TechType techType = CraftData.GetTechType(__instance.gameObject);

            if (techType == TechType.Spotlight)
            {
                __instance.gameObject.EnsureComponent <ColoringController>();
            }
        }
예제 #2
0
        private void Init()
        {
            spotLight  = GetComponent <BaseSpotLight>();
            identifier = GetComponent <PrefabIdentifier>();
            id         = identifier.Id;

            OnProtoDeserialize(null);

            initialized = true;
        }
예제 #3
0
        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;
            }
        }
예제 #4
0
        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;
 }
예제 #6
0
 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);
 }
예제 #7
0
 static void Prefix(BaseSpotLight __instance)
 {
     __instance.gameObject.AddComponent <SpotlightToggle>();
     Logger.Log("Added SpotlightToggle component to BaseSpotLight");
 }