public void OnGUI()
        {
            base.OnGUI(new Rect());

            EditorGUIUtility.labelWidth = 90;
            inputData.seed = EditorGUILayout.IntField("Seed", inputData.seed);
            inputData.size = PWGUI.IntSlider("Chunk size: ", inputData.size, 4, 512);
            inputData.step = PWGUI.Slider("Step: ", inputData.step, 0.01f, 16);

            if (PWGUI.BeginFade("Terrain", ref showTerrain, false))
            {
                inputData.maxTerrainHeight = PWGUI.IntSlider("Terrain height: ", inputData.maxTerrainHeight, 0, 1000);
                inputData.octaves          = PWGUI.IntSlider("Noise octaves: ", inputData.octaves, 1, 8);
                inputData.persistance      = PWGUI.Slider("Noise persistance: ", inputData.persistance, 0f, 2f);
                inputData.lacunarity       = PWGUI.Slider("Noise lacunarity: ", inputData.lacunarity, 0f, 2f);
                inputData.isWaterless      = EditorGUILayout.Toggle("Is waterless", inputData.isWaterless);
                if (!inputData.isWaterless)
                {
                    inputData.waterLevel = PWGUI.IntSlider("WaterLevel: ", (int)inputData.waterLevel, 0, 100);
                }
            }
            PWGUI.EndFade();

            //TODO: dummy temperature/wetness generation
        }
Esempio n. 2
0
		public override void OnNodeGUI()
		{
			EditorGUI.BeginChangeCheck();
			{
				PWGUI.Slider("Persistance: ", ref persistance, ref persistanceMin, ref persistanceMax);
				PWGUI.IntSlider("Octaves: ", ref octaves, 0, 16);
			}
			if (EditorGUI.EndChangeCheck())
				notifyDataChanged = true;

			PWGUI.Sampler2DPreview(output, needUpdate);
		}
Esempio n. 3
0
        public override void OnNodeGUI()
        {
            EditorGUIUtility.labelWidth = 40;
            EditorGUI.BeginChangeCheck();
            {
                persistance    = PWGUI.Slider("Persistance: ", persistance, ref persistanceMin, ref persistanceMax);
                octaves        = PWGUI.IntSlider("Octaves: ", octaves, 0, 16);
                scale          = PWGUI.Slider("Scale: ", scale, 0.01f, 10);
                additionalSeed = EditorGUILayout.IntField("Seed", additionalSeed);
            }
            if (EditorGUI.EndChangeCheck())
            {
                delayedChanges.UpdateValue(noiseSettingsChangedKey);
            }

            PWGUI.Sampler2DPreview(output);
        }
Esempio n. 4
0
        public override void OnNodeGUI()
        {
            EditorGUIUtility.labelWidth = 40;
            EditorGUI.BeginChangeCheck();
            {
                node.persistence    = PWGUI.Slider("persistence: ", node.persistence, ref node.persistenceMin, ref node.persistenceMax);
                node.lacunarity     = PWGUI.Slider("Lacunarity: ", node.lacunarity, 0.1f, 5);
                node.octaves        = PWGUI.IntSlider("Octaves: ", node.octaves, 0, 16);
                node.scale          = PWGUI.Slider("Scale: ", node.scale, 0.01f, 10);
                node.additionalSeed = EditorGUILayout.IntField("Seed", node.additionalSeed);
            }
            if (EditorGUI.EndChangeCheck())
            {
                node.perlin2D.UpdateParams(node.GetSeed(), node.scale, node.octaves, node.persistence, node.lacunarity);
                delayedChanges.UpdateValue(noiseSettingsChangedKey);
            }

            PWGUI.Sampler2DPreview(node.output);
        }