Exemplo n.º 1
0
 private static void Postfix(CyclopsShieldButton __instance)
 {
     if (__instance.active)
     {
         HandReticle_LateUpdate.activateCyclopsCrosshair = true;
     }
 }
Exemplo n.º 2
0
        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.");
            }
        }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
0
        public override void Process(CyclopsActivateShield shieldPacket)
        {
            GameObject          cyclops = GuidHelper.RequireObjectFrom(shieldPacket.Guid);
            CyclopsShieldButton shield  = cyclops.RequireComponentInChildren <CyclopsShieldButton>();

            using (packetSender.Suppress <CyclopsActivateShield>())
            {
                shield.OnClick();
            }
        }
Exemplo n.º 5
0
        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");
                        }
                    }
                }
            }
        }
Exemplo n.º 6
0
        public static void Postfix(CyclopsShieldButton __instance)
        {
            String guid = GuidHelper.GetGuid(__instance.subRoot.gameObject);

            Multiplayer.Logic.Cyclops.ActivateShield(guid);
        }
Exemplo n.º 7
0
        public static void Postfix(CyclopsShieldButton __instance)
        {
            string guid = GuidHelper.GetGuid(__instance.subRoot.gameObject);

            NitroxServiceLocator.LocateService <Cyclops>().ActivateShield(guid);
        }