コード例 #1
0
 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();
 }
コード例 #2
0
 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();
     }
 }
コード例 #3
0
ファイル: Main.cs プロジェクト: asmboom/InfluenceTerrainDemo
        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);
        }