//Restores previous floodlight
 static bool Prefix(CyclopsLightingPanel __instance)
 {
     if (CyclopsLightingPanel_TempTurnOffFloodlights_Patch.previous)
     {
         __instance.ToggleFloodlights();
     }
     return(false);
 }
 //Really turns off floodlight to avoid energy consumption
 static bool Prefix(CyclopsLightingPanel __instance)
 {
     previous = __instance.floodlightsOn;
     if (__instance.floodlightsOn)
     {
         __instance.ToggleFloodlights();
     }
     return(false);
 }
        public override void Process(CyclopsToggleFloodLights lightingPacket)
        {
            GameObject           cyclops  = GuidHelper.RequireObjectFrom(lightingPacket.Guid);
            CyclopsLightingPanel lighting = cyclops.RequireComponentInChildren <CyclopsLightingPanel>();

            if (lighting.floodlightsOn != lightingPacket.IsOn)
            {
                using (packetSender.Suppress <CyclopsToggleFloodLights>())
                {
                    lighting.ToggleFloodlights();
                }
            }
        }
示例#4
0
        public override void Process(CyclopsToggleFloodLights lightingPacket)
        {
            Optional <GameObject> opCyclops = GuidHelper.GetObjectFrom(lightingPacket.Guid);

            if (opCyclops.IsPresent())
            {
                CyclopsLightingPanel lighting = opCyclops.Get().GetComponentInChildren <CyclopsLightingPanel>();

                if (lighting.floodlightsOn != lightingPacket.IsOn)
                {
                    using (packetSender.Suppress <CyclopsToggleFloodLights>())
                    {
                        lighting.ToggleFloodlights();
                    }
                }
            }
            else
            {
                Console.WriteLine("Could not find cyclops with guid " + lightingPacket.Guid + " to change flood lighting");
            }
        }