コード例 #1
0
        public override void Process(CyclopsChangeColor colorPacket)
        {
            GameObject             cyclops     = GuidHelper.RequireObjectFrom(colorPacket.Guid);
            CyclopsNameScreenProxy screenProxy = cyclops.RequireComponentInChildren <CyclopsNameScreenProxy>();
            SubName subname = (SubName)screenProxy.subNameInput.ReflectionGet("target");

            if (subname != null)
            {
                subname.SetColor(colorPacket.Index, colorPacket.HSB, colorPacket.Color);
                screenProxy.subNameInput.ReflectionCall("SetColor", false, false, colorPacket.Index, colorPacket.Color);
                screenProxy.subNameInput.SetSelected(colorPacket.Index);
            }
            else
            {
                Log.Error("Could not find SubName in SubNameInput to change color");
            }
        }
コード例 #2
0
        public override void Process(CyclopsChangeName namePacket)
        {
            GameObject             cyclops     = GuidHelper.RequireObjectFrom(namePacket.Guid);
            CyclopsNameScreenProxy ScreenProxy = cyclops.RequireComponentInChildren <CyclopsNameScreenProxy>();
            SubName subname = (SubName)ScreenProxy.subNameInput.ReflectionGet("target");

            if (subname != null)
            {
                using (packetSender.Suppress <CyclopsChangeName>())
                {
                    subname.SetName(namePacket.Name);
                    ScreenProxy.subNameInput.inputField.text = namePacket.Name;
                }
            }
            else
            {
                Log.Error("Could not find SubName via target reflection");
            }
        }
        public override void Process(CyclopsChangeName namePacket)
        {
            Optional <GameObject> opCyclops = GuidHelper.GetObjectFrom(namePacket.Guid);

            if (opCyclops.IsPresent())
            {
                CyclopsNameScreenProxy ScreenProxy = opCyclops.Get().GetComponentInChildren <CyclopsNameScreenProxy>();

                if (ScreenProxy != null)
                {
                    SubName subname = (SubName)ScreenProxy.subNameInput.ReflectionGet("target");

                    if (subname != null)
                    {
                        subname.SetName(namePacket.Name);
                        ScreenProxy.subNameInput.inputField.text = namePacket.Name;
                    }
                }
            }
            else
            {
                Console.WriteLine("Could not find cyclops with guid " + namePacket.Guid + " to change name");
            }
        }