Exemplo n.º 1
0
        public override void Process(VehicleColorChange colorPacket)
        {
            GameObject   target        = NitroxEntity.RequireObjectFrom(colorPacket.Id);
            SubNameInput subNameInput  = target.RequireComponentInChildren <SubNameInput>();
            SubName      subNameTarget = subNameInput.target;

            using (packetSender.Suppress <VehicleColorChange>())
            {
                // Switch to the currently selected tab:
                subNameInput.SetSelected(colorPacket.Index);

                // OnColorChange calls these two methods, in order to update the vehicle color and the color+text on the ingame panel, respectively:
                subNameTarget.SetColor(colorPacket.Index, colorPacket.HSB.ToUnity(), colorPacket.Color.ToUnity());
                subNameInput.SetColor(colorPacket.Index, colorPacket.Color.ToUnity());
            }
        }