public void CreatePool(int num)
 {
     for (int i = 0; i < num; i++)
     {
         Planet planet = planetGenerator.GeneratePlanet();
         planetPool.Add(planet);
     }
 }
    public override void OnInspectorGUI()
    {
        using (var check = new EditorGUI.ChangeCheckScope())
        {
            base.OnInspectorGUI();
            if (check.changed)
            {
                planet.GeneratePlanet();
            }
        }

        if (GUILayout.Button("Generate Planet"))
        {
            planet.GeneratePlanet();
        }

        DrawSettingsEditor(planet.shapeSettings, planet.OnShapeSettingsUpdated, ref planet.shapeSettingsFoldOut, ref shapeEditor);
        DrawSettingsEditor(planet.colorSettings, planet.OnColorSettingsUpdated, ref planet.colorSettingsFoldOut, ref colorEditor);
    }
Beispiel #3
0
        private void btnOk_Click(object sender, EventArgs e)
        {
            if (_animator != null)
            {
                if (_generator.ALL_RANDOM_SEED == -1)
                {
                    if (MessageBox.Show("The RANDOM_SEED property is set to -1. This will produce a different landscape for every frame. Continue?", "Warning",
                                        MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.No)
                    {
                        return;
                    }
                }

                _animator.AnimateTest(txtOutputName.Text);
                return;
            }
            int lastSeed = _generator.GeneratePlanet(txtOutputName.Text);

            MessageBox.Show("Finished generating.\nSeed used: " + lastSeed, "Done", MessageBoxButtons.OK, MessageBoxIcon.Information);
            lblLastSeed.Text = "Last seed: " + lastSeed;
        }
Beispiel #4
0
    // ------------------------



    // Generate planet
    public PlanetData GeneratePlanetData(string name, float planetSize, bool hasAtmosphere = false, float terrainMeshHeightMultiplier = 1, float noiseScale = 10)
    {
        return(PlanetGenerator.GeneratePlanet(name, planetSize, material, meshHeightCurve, regions, gradient, terrainMeshHeightMultiplier, noiseScale, noiseTaulu, octaves, noiseResolution, hasAtmosphere));
    }
Beispiel #5
0
 private void Awake()
 {
     instance = this;
     planet   = planetGenerator.GeneratePlanet();
     envController.CreateIncrementHexData(planet.GetHexCount());
 }