B9PartSwitch.ModuleB9PartInfo.SetupGUI C# (CSharp) Метод

SetupGUI() приватный Метод

private SetupGUI ( ) : void
Результат void
        private void SetupGUI()
        {
            List<ModuleB9PartSwitch> switcherModules = part.FindModulesImplementing<ModuleB9PartSwitch>();
            bool hasResources = part.Resources.Any(resource => resource.info.density != 0f);
            bool showMass = switcherModules.Any(module => module.ChangesMass);
            bool showCost = switcherModules.Any(module => module.ChangesCost);

            var dryMassField = Fields[nameof(dryMass)];
            dryMassField.guiActiveEditor = showInfo && showMass;
            dryMassField.guiName = hasResources ? DryMassGUIString : MassGUIString;
            Fields[nameof(wetMass)].guiActiveEditor = showInfo && showMass && hasResources;

            var dryCostField = Fields[nameof(dryCost)];
            dryCostField.guiActiveEditor = showInfo && showCost;
            dryCostField.guiName = hasResources ? DryCostGUIString : CostGUIString;
            Fields[nameof(wetCost)].guiActiveEditor = showInfo && showCost && hasResources;

            Fields[nameof(maxTemp)].guiActiveEditor = showInfo && switcherModules.Any(module => module.PartFieldManaged(SubtypePartFields.MaxTemp));
            Fields[nameof(skinMaxTemp)].guiActiveEditor = showInfo && switcherModules.Any(module => module.PartFieldManaged(SubtypePartFields.SkinMaxTemp));
            Fields[nameof(crashTolerance)].guiActiveEditor = showInfo && switcherModules.Any(module => module.PartFieldManaged(SubtypePartFields.CrashTolerance));
        }