Пример #1
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.");
            }
        }
Пример #2
0
        public override void Process(CyclopsActivateShield shieldPacket)
        {
            GameObject          cyclops = GuidHelper.RequireObjectFrom(shieldPacket.Guid);
            CyclopsShieldButton shield  = cyclops.RequireComponentInChildren <CyclopsShieldButton>();

            using (packetSender.Suppress <CyclopsActivateShield>())
            {
                shield.OnClick();
            }
        }