Example #1
0
    private bool Generate()
    {
        if (isGenerated)
        {
            return(false);
        }
        var rand = new System.Random(seed);

        temp = rand.Next(temps.Length);
        size = rand.Next(sizes.Length);
        int numOrbits = 5 * (size + 1);

        for (int i = 1; i <= numOrbits; i++)
        {
            double r = rand.NextDouble();
            if (r < 0.5)
            {
                Planetoid p = new Planetoid(rand.Next());
                satellites.Add(p);
                p.Generate(i);
            }
            else
            {
                satellites.Add(new EmptyOrbital(0));
            }
        }
        starPrefab = Resources.Load("Prefabs/Stars/" + temps[temp]) as GameObject;
        rotation   = (int)(360 * rand.NextDouble());
        return(true);
    }