Easy logic question about initializing new game world

Deleted for giggles

Sorry to say that, but your question is way more complex than the way you are asking for. You really should see some tutorials about generating levels, like having already done “maps” that circle through or really make something like minecraft-ish, that generates the world through logic etc. Your question is on the one hand kind of universal and on the other hand very complex to just answer it within a few lines…

it isn´t really generating the world, the map is already built I was probably a little confusing in the OP. It is just about assigning values to a large amount of variables, one time when the game is started. But those variables are based on formulas that include some RNG so that everyone´s game will be slightly different.

I don’t really understand what you want to achieve. Do you have a performance drop while initialising the game first time?

You could split your initialisation into a sequence of coroutine calls, like:

IEnumerator LevelLoadSequence()
{
      LoadTerrain(); //just example methods?
      yield return null;
  
      LoadUnits(); 
      yield return null;

      SetupAI();
      yield return null;

      StartGame(); //here you remove the black screen covering the scene
}

It’s hard to help when the question is vague. If this is not what you meant, just dismiss my comment. >_>

You could save a PlayerPref when the calcutations are done and then destroy the script at the beginning if the PlayerPref is x.

For example you could do this:

void Awake()
{
    if (PlayerPrefs.GetInt("hasInitializedWorld", 0) == 1)
    {
        //Load variables from a file.
          
        //Assign variables.
           
        //Destroy this script.
        Destroy(this);
    }
}

void Calculations()
{
    //At the end of the calculations.
    PlayerPrefs.SetInt("hasInitializedWorld", 1);

    //Save all variables to a file.
}

To save the variables you could in theory use PlayerPrefs as well, but if you have a lot, you should look into saving the variables in a file and reading that after the first time the game has started.