private static void Postfix(CyclopsShieldButton __instance) { if (__instance.active) { HandReticle_LateUpdate.activateCyclopsCrosshair = true; } }
public override void Process(CyclopsActivateShield shieldPacket) { Optional <GameObject> opCyclops = GuidHelper.GetObjectFrom(shieldPacket.Guid); if (opCyclops.IsPresent()) { CyclopsShieldButton shield = opCyclops.Get().GetComponentInChildren <CyclopsShieldButton>(); if (shield != null) { using (packetSender.Suppress <CyclopsActivateShield>()) { shield.OnClick(); } } else { Console.WriteLine("Could not activate shield because CyclopsShieldButton was not found on the cyclops " + shieldPacket.Guid); } } else { Console.WriteLine("Could not find cyclops with guid " + shieldPacket.Guid + " to activate shield."); } }
public static void Postfix(CyclopsShieldButton __instance) { NitroxId id = NitroxIdentifier.GetId(__instance.subRoot.gameObject); // Shield is activated, if activeSprite is set as sprite bool isActive = (__instance.activeSprite == __instance.image.sprite); NitroxServiceLocator.LocateService <Cyclops>().BroadcastChangeShieldState(id, isActive); }
public override void Process(CyclopsActivateShield shieldPacket) { GameObject cyclops = GuidHelper.RequireObjectFrom(shieldPacket.Guid); CyclopsShieldButton shield = cyclops.RequireComponentInChildren <CyclopsShieldButton>(); using (packetSender.Suppress <CyclopsActivateShield>()) { shield.OnClick(); } }
public void ChangeShieldMode(NitroxId id, bool isOn) { GameObject cyclops = NitroxIdentifier.RequireObjectFrom(id); CyclopsShieldButton shield = cyclops.GetComponentInChildren <CyclopsShieldButton>(); if (shield != null) { using (packetSender.Suppress <CyclopsChangeShieldMode>()) { if ((shield.activeSprite == shield.image.sprite) != isOn) { if (isOn) { shield.ReflectionCall("StartShield"); } else { shield.ReflectionCall("StopShield"); } } } } }
public static void Postfix(CyclopsShieldButton __instance) { String guid = GuidHelper.GetGuid(__instance.subRoot.gameObject); Multiplayer.Logic.Cyclops.ActivateShield(guid); }
public static void Postfix(CyclopsShieldButton __instance) { string guid = GuidHelper.GetGuid(__instance.subRoot.gameObject); NitroxServiceLocator.LocateService <Cyclops>().ActivateShield(guid); }