private void ApplyRuleCheck(VehicleCityDataRuleXml x)
        {
            m_service.parent.isVisible          = x.RuleCheckType == RuleCheckTypeVehicle.SERVICE || x.RuleCheckType == RuleCheckTypeVehicle.SERVICE_LEVEL || x.RuleCheckType == RuleCheckTypeVehicle.SERVICE_SUBSERVICE || x.RuleCheckType == RuleCheckTypeVehicle.SERVICE_SUBSERVICE_LEVEL;
            m_subService.parent.isVisible       = x.RuleCheckType == RuleCheckTypeVehicle.SERVICE_SUBSERVICE || x.RuleCheckType == RuleCheckTypeVehicle.SERVICE_SUBSERVICE_LEVEL;
            m_level.parent.isVisible            = x.RuleCheckType == RuleCheckTypeVehicle.SERVICE_LEVEL || x.RuleCheckType == RuleCheckTypeVehicle.SERVICE_SUBSERVICE_LEVEL;
            m_class.parent.isVisible            = x.RuleCheckType == RuleCheckTypeVehicle.ITEM_CLASS;
            m_assetFilterSelf.parent.isVisible  = x.RuleCheckType == RuleCheckTypeVehicle.ASSET_NAME_SELF;
            m_assetFilterOwner.parent.isVisible = x.RuleCheckType == RuleCheckTypeVehicle.ASSET_NAME_OWNER;

            bool isExportableType = x.RuleCheckType == RuleCheckTypeVehicle.ASSET_NAME_OWNER ||
                                    x.RuleCheckType == RuleCheckTypeVehicle.ASSET_NAME_SELF;

            m_exportButtonContainer.isVisible      = isExportableType;
            m_exportButtonContainerLocal.isVisible = isExportableType;
            if (isExportableType)
            {
                string assetKind = "";
                switch (x.RuleCheckType)
                {
                case RuleCheckTypeVehicle.ASSET_NAME_OWNER:
                    assetKind = "BUILDING";
                    EnableDisableExport(x.BuildingName);
                    break;

                case RuleCheckTypeVehicle.ASSET_NAME_SELF:
                    assetKind = "VEHICLE";
                    EnableDisableExport(x.AssetName);
                    break;
                }
                m_exportButton.text      = Locale.Get($"K45_ACE_EXPORTDATA_TOASSET{assetKind}");
                m_exportButtonLocal.text = Locale.Get($"K45_ACE_EXPORTDATA_TOLOCAL{assetKind}");
            }
        }
        private void ApplyColorUIRules(VehicleCityDataRuleXml x)
        {
            bool isPastel = x.ColoringMode == ColoringMode.PASTEL_FULL_VIVID || x.ColoringMode == ColoringMode.PASTEL_HIGHER_SATURATION || x.ColoringMode == ColoringMode.PASTEL_ORIG;

            m_allowRed.isVisible           = isPastel;
            m_allowGreen.isVisible         = isPastel;
            m_allowBlues.isVisible         = isPastel;
            m_allowNeutral.isVisible       = isPastel;
            m_listColorContainer.isVisible = x.ColoringMode == ColoringMode.LIST;
        }
 private void UpdateColorList(ref VehicleCityDataRuleXml reference)
 {
     UIPanel[] colorPickers = m_colorFieldTemplateListColors.SetItemCount(reference.m_colorList.Count);
     m_isLoadingColors = true;
     for (int i = 0; i < reference.m_colorList.Count; i++)
     {
         UIColorField colorField = colorPickers[i].GetComponentInChildren <UIColorField>();
         if (colorField.objectUserData == null)
         {
             colorField.eventSelectedColorChanged += (x, y) =>
                                                     SafeObtain((ref VehicleCityDataRuleXml z) =>
             {
                 if (!m_isLoadingColors && z.m_colorList.Count > x.parent.zOrder)
                 {
                     m_isLoadingColors = true;
                     if (y == default)
                     {
                         z.m_colorList.RemoveAt(x.parent.zOrder);
                         UpdateColorList(ref z);
                     }
                     else
                     {
                         z.m_colorList[x.parent.zOrder] = y;
                     }
                     BuildingManager.instance.UpdateBuildingColors();
                     m_isLoadingColors = false;
                 }
             });
             colorField.eventColorPickerOpen += KlyteMonoUtils.DefaultColorPickerHandler;
             colorField.objectUserData        = true;
         }
         colorField.selectedColor = reference.m_colorList[i];
     }
     m_addColor.zOrder = 99999999;
     m_isLoadingColors = false;
 }