public void ValueChanged() { Generator.NoiseScale = Mathf.Max(ScaleSlider.value, 20f); ScaleSlider.maxValue = Mathf.Max(Generator.NoiseScale * 2f, 20f); HeightSlider.maxValue = ScaleSlider.value / 3f; Generator.Height = Mathf.RoundToInt(HeightSlider.value); SetValues(); Generator.Generate(); }
public override void OnInspectorGUI() { EditorGUI.BeginChangeCheck(); base.OnInspectorGUI(); if (GUILayout.Button("Generate")) { generator.Generate(); } if (GUILayout.Button("Generate Random")) { generator.Seed = Random.Range(-999999f, 999999f); generator.Generate(); } if (generator.AutoGenerate && EditorGUI.EndChangeCheck()) { generator.Generate(); } }
public LandMap GenerateMap(ILandSettings settings) { var time = Stopwatch.StartNew(); //Land = new Land(Layout, settings); //Generate land's chunks var map = new LandMap(settings, LandLayout); var landGenerator = new LandGenerator(LandLayout, settings); Map = landGenerator.Generate(map); time.Stop(); //Debug.Log(Land.GetStaticstics()); Debug.Log(string.Format("Generate map {0} ms", time.ElapsedMilliseconds)); return(Map); }