public void Start()
        {
            if (HighLogic.LoadedSceneIsFlight || HighLogic.LoadedSceneIsEditor)
            {
                ReloadDatabaseNodes();
                SetDebugMode(DebugMode);
            }

            if (HighLogic.LoadedSceneIsFlight)
            {
                /// Check to see if there's any boiloff resources on this part
                HasAnyBoiloffResource = false;
                foreach (BoiloffFuel fuel in fuels)
                {
                    if (BoiloffUtils.IsPartResourcePresent(fuel.fuelName, part))
                    {
                        HasAnyBoiloffResource = true;
                        fuel.Initialize();
                    }
                    else
                    {
                        fuel.fuelPresent = false;
                    }
                }
                /// if no resources turn off the UI
                if (!HasAnyBoiloffResource)
                {
                    Events["Disable"].guiActive       = false;
                    Events["Enable"].guiActive        = false;
                    Fields["BoiloffStatus"].guiActive = false;
                    return;
                }

                maxFuelAmount = GetTotalMaxResouceAmount();

                planetFlux = LongwaveFluxBaseline;
                solarFlux  = ShortwaveFluxBaseline;

                if (GetTotalCoolingCost() > 0.0)
                {
                    finalCoolingCost                  = maxFuelAmount / 1000.0 * GetTotalCoolingCost();
                    Events["Disable"].guiActive       = true;
                    Events["Enable"].guiActive        = true;
                    Events["Enable"].guiActiveEditor  = true;
                    Events["Disable"].guiActiveEditor = true;
                }
                // Catchup
                DoCatchup();
            }
        }
        public void Update()
        {
            if (HighLogic.LoadedSceneIsFlight && HasAnyBoiloffResource)
            {
                /// Show the insulation status field if there is a cooling cost
                if (IsCoolable())
                {
                    Fields["CoolingStatus"].guiActive = true;
                    if (Events["Enable"].active == CoolingEnabled || Events["Disable"].active != CoolingEnabled)
                    {
                        Events["Disable"].active = CoolingEnabled;
                        Events["Enable"].active  = !CoolingEnabled;
                    }
                }
                else
                {
                    Fields["CoolingStatus"].guiActive = false;
                    Events["Disable"].active          = false;
                    Events["Enable"].active           = false;
                }

                /// if there is no more fuel, hide the boiloff status
                if (fuelAmount == 0.0)
                {
                    Fields["BoiloffStatus"].guiActive = false;
                }
            }
            else if (HighLogic.LoadedSceneIsEditor)
            {
                /// Check for the presence of any resource
                HasAnyBoiloffResource = false;
                foreach (BoiloffFuel fuel in fuels)
                {
                    if (BoiloffUtils.IsPartResourcePresent(fuel.fuelName, part))
                    {
                        HasAnyBoiloffResource = true;
                        fuel.Initialize();
                    }
                    else
                    {
                        fuel.fuelPresent = false;
                    }
                }

                if (IsCoolable() && HasAnyBoiloffResource)
                {
                    Fields["CoolingStatus"].guiActiveEditor = true;
                    Fields["CoolingStatus"].guiActiveEditor = true;

                    double max = GetTotalMaxResouceAmount();

                    CoolingStatus = Localizer.Format("#LOC_CryoTanks_ModuleCryoTank_Field_CoolingStatus_Editor", (GetTotalCoolingCost() * (float)(max / 1000.0)).ToString("F2"));

                    Events["Disable"].guiActiveEditor = true;
                    Events["Enable"].guiActiveEditor  = true;

                    if (Events["Enable"].active == CoolingEnabled || Events["Disable"].active != CoolingEnabled)
                    {
                        Events["Disable"].active = CoolingEnabled;
                        Events["Enable"].active  = !CoolingEnabled;
                    }
                }
                else
                {
                    Fields["CoolingStatus"].guiActiveEditor = false;
                    Events["Disable"].guiActiveEditor       = false;
                    Events["Enable"].guiActiveEditor        = false;
                }
            }
        }