private bool showGUINoise(PlanetNoise planetNoise, string name, bool show) { EditorGUILayout.BeginHorizontal(); { show = EditorGUILayout.Foldout(show, name); if (GUILayout.Button("Randomise", EditorStyles.miniButton)) { Undo.RecordObject(_target, "Randomise " + name); _target.randomiseNoise(planetNoise); EditorApplication.delayCall += updatePreviewIfAvailable; } } EditorGUILayout.EndHorizontal(); ++EditorGUI.indentLevel; if (show) { planetNoise.scale = showGUISlider("scale", planetNoise.scale, 0.1f, 20f); planetNoise.octaves = showGUISlider("octaves", planetNoise.octaves, 0, 10); planetNoise.falloff = showGUISlider("falloff", planetNoise.falloff, 0f, 20f); planetNoise.intensity = showGUISlider("intensity", planetNoise.intensity, 0f, 20f); planetNoise.ridginess = showGUISlider("rigidness", planetNoise.ridginess, 0f, 1f); planetNoise.smearScale = showGUISlider("smearScale", planetNoise.smearScale, 0.1f, 20f); planetNoise.smearOctaves = showGUISlider("smearOctaves", planetNoise.smearOctaves, 0, 10); planetNoise.smearFalloff = showGUISlider("smearFalloff", planetNoise.smearFalloff, 0f, 20f); planetNoise.smearIntensity = showGUISlider("smearIntensity", planetNoise.smearIntensity, 0f, 20f); } --EditorGUI.indentLevel; return(show); }
public void randomiseNoise(PlanetNoise noise) { noise.scale = Random.Range(0.1f, 20f); noise.octaves = Random.Range(0, 10); noise.falloff = Random.Range(0f, 20f); noise.intensity = Random.Range(0f, 20f); noise.ridginess = Random.Range(0f, 1f); noise.smearScale = Random.Range(0.1f, 20f); noise.smearOctaves = Random.Range(0, 10); noise.smearFalloff = Random.Range(0f, 20f); noise.smearIntensity = Random.Range(0f, 20f); }
public void OnEnable() { if (surfaceNoise == null) { surfaceNoise = new PlanetNoise(); landNoise = new PlanetNoise(); landColourNoise01 = new PlanetNoise(); landColourNoise23 = new PlanetNoise(); cloudNoise = new PlanetNoise(); seedSurface = Random.Range(0, int.MaxValue); seedLand = Random.Range(0, int.MaxValue); seedLandColour01 = Random.Range(0, int.MaxValue); seedLandColour23 = Random.Range(0, int.MaxValue); seedCity = Random.Range(0, int.MaxValue); seedCloud = Random.Range(0, int.MaxValue); surfaceNoise.scale = 0.9f; surfaceNoise.octaves = 10; surfaceNoise.falloff = 4.94f; surfaceNoise.intensity = 2.75f; surfaceNoise.ridginess = 0.46f; surfaceNoise.smearScale = 0.6f; surfaceNoise.smearOctaves = 1; surfaceNoise.smearFalloff = 7.9f; surfaceNoise.smearIntensity = 0.8f; landNoise.scale = 0.68f; landNoise.octaves = 1; landNoise.falloff = 3.74f; landNoise.intensity = 3.09f; landNoise.ridginess = 0f; landNoise.smearScale = 2f; landNoise.smearOctaves = 1; landNoise.smearFalloff = 1.04f; landNoise.smearIntensity = 1.61f; landColour0 = new Color(152f / 255f, 107f / 255f, 71f / 255f); landColour1 = new Color(69f / 255f, 43f / 255f, 22f / 255f); landColour2 = new Color(0f / 255f, 20f / 255f, 0f / 255f); landColour3 = new Color(11f / 255f, 64f / 255f, 11f / 255f); landColourNoise01.scale = 0.49f; landColourNoise01.octaves = 9; landColourNoise01.falloff = 9.13f; landColourNoise01.intensity = 16.16f; landColourNoise01.ridginess = 0.234f; landColourNoise01.smearScale = 19.76f; landColourNoise01.smearOctaves = 1; landColourNoise01.smearFalloff = 9.53f; landColourNoise01.smearIntensity = 15.73f; landColourNoise23.scale = 0.49f; landColourNoise23.octaves = 9; landColourNoise23.falloff = 9.13f; landColourNoise23.intensity = 16.16f; landColourNoise23.ridginess = 0.234f; landColourNoise23.smearScale = 19.76f; landColourNoise23.smearOctaves = 1; landColourNoise23.smearFalloff = 9.53f; landColourNoise23.smearIntensity = 15.73f; waterColour0 = new Color(3f / 255f, 3f / 255f, 52f / 255f); waterColour1 = new Color(0f / 255f, 0f / 255f, 88f / 255f); waterLevel = 0.5f; waterSpecular = 1f; waterFalloff = 3.1f; iceColour = new Color(1f, 1f, 234f / 255f, 1f); iceReach = 0.308f; iceHeight = 0.986f; shadowRange = 20f; shadowStrength = 0.4f; cityReach = 0.8f; cityHeight = 0.8f; cityColour = new Color(37f / 255f, 27f / 255f, 17f / 255f); cityCount = 128; cityMultiplier = 6; cityDropoff = 4; cityDepth = 4; citySpread = 0.45f; cityIntensity = 64f; maxCityIntensity = 7.5f; cityFalloff = 0.5f; normalScale = 0.1f; cloudNoise.scale = 0.4f; cloudNoise.octaves = 10; cloudNoise.falloff = 4.1f; cloudNoise.intensity = 6.1f; cloudNoise.ridginess = 0f; cloudNoise.smearScale = 16.38f; cloudNoise.smearOctaves = 3; cloudNoise.smearFalloff = 4.2f; cloudNoise.smearIntensity = 5.15f; cloudWorleyNoiseOctaves = 1; cloudWorleyNoiseFrequency = 6f; cloudWorleyNoiseAmplitude = 0.5f; cloudShadowRange = 10f; cloudShadowStrength = 0.1f; cloudColour0 = new Color(1f, 1f, 1f, 1f); cloudColour1 = new Color(0f, 0f, 0f, 0f); cloudSpin = 1f; cloudNormalScale = 0.01f; size = 0; combineHeightWithCity = true; } }