Exemple #1
0
    public void Generate_Galaxy()
    {
        Destroy_Galaxy();

        int   totalArms  = armPairs;
        int   Randomizer = Random.Range(500, 601);
        float armInc     = DetermineArmIncrement(armPairs);
        float armVal;

        starCount = (int)(galaxySize * Randomizer);
        string[] starNames = NameList.Get_Star_Names(starCount);

        GameObject galaxy = Instantiate(galaxy_Prefab);

        for (int a = 0; a < totalArms; a++)
        {
            int stars = (starCount / armPairs);
            armVal = DetermineArmValue(armPairs, a);

            for (int i = 0; i < stars; i++)
            {
                Generate_Star(galaxy, a, armVal, armInc, starNames[i]);
            }
        }
    }