public void CheckForAllPendingApply()        // check each sub-panel for a pending apply and if so, run that panel's ApplyFromUIData method
    {
        DebugBot.DebugFunctionCall("TModuleUI; CheckForAllPendingApply(); ", debugFunctionCalls);
        Trainer trainerRef = gameController.masterTrainer;

        // Right now, this should work because this function is only called during the NextGeneration method of the Trainer
        trainerRef.applyPanelPlayers    = true;        // basically, true means that the current state of the system allows changes to each of these panel's data
        trainerRef.applyPanelPopulation = true;
        trainerRef.applyPanelCrossover  = true;
        trainerRef.applyPanelTrials     = true;
        trainerRef.applyPanelFitness    = true;
        trainerRef.applyPanelMiniGame   = true;
        // Population Panel:
        if (panelPopulationScript.applyPressed)
        {
            if (trainerRef.applyPanelPopulation)
            {
                panelPopulationScript.SetTrainerDataFromUIApply();
            }
        }
        // Players Panel:
        if (panelPlayersScript.applyPressed)
        {
            if (trainerRef.applyPanelPlayers)
            {
                panelPlayersScript.SetTrainerDataFromUIApply();
            }
        }
        // Trials Panel:
        if (panelTrialsScript.applyPressed)
        {
            if (trainerRef.applyPanelTrials)
            {
                panelTrialsScript.SetTrainerDataFromUIApply();
            }
        }
        // Fitness Panel:
        if (panelFitnessScript.applyPressed)
        {
            if (trainerRef.applyPanelFitness)
            {
                panelFitnessScript.SetTrainerDataFromUIApply();
            }
        }
        // MiniGame Panel:
        if (panelMiniGameScript.applyPressed)
        {
            if (trainerRef.applyPanelMiniGame)
            {
                panelMiniGameScript.SetTrainerDataFromUIApply();
            }
        }
        // Crossover Panel:
        if (panelCrossoverScript.applyPressed)
        {
            if (trainerRef.applyPanelCrossover)
            {
                panelCrossoverScript.SetTrainerDataFromUIApply();
            }
        }
        // Fill out the other panels:

        // Reset:
        trainerRef.applyPanelPlayers    = false;        // basically, true means that the current state of the system allows changes to each of these panel's data
        trainerRef.applyPanelPopulation = false;
        trainerRef.applyPanelCrossover  = false;
        trainerRef.applyPanelTrials     = false;
        trainerRef.applyPanelFitness    = false;
        trainerRef.applyPanelMiniGame   = false;
    }