public void GenerateScaled() { textureMinMax = new TextureMinMax(); generator.generateColliders = false; scaledPlanet.localScale = Vector3.one / OriginManager.skyboxScale; generator.chunkHolder = scaledPlanet.gameObject; generator.mat = CreateSurfaceMaterial(selected.material, Mathf.Sqrt(textureMinMax.Min), Mathf.Sqrt(textureMinMax.Max)); }
public void GenerateReal() { textureMinMax = new TextureMinMax(); // Reset(); generator.generateColliders = true; generator.chunkHolder = realPlanet.gameObject; generator.Run(textureMinMax); // set planet colors generator.mat = CreateSurfaceMaterial(selected.material, Mathf.Sqrt(textureMinMax.Min), Mathf.Sqrt(textureMinMax.Max)); // // set water // if (hasWater) { // waterMaterial = selected.waterMaterials[Random.Range(0, selected.waterMaterials.Length)]; // // instantiate a water prefab with scale set to slightly larger than scaleModifier * radius // water = GameObject.Instantiate(waterPrefab); // water.layer = 9; // water.transform.position = realPlanet.position; // water.transform.rotation = realPlanet.rotation; // water.transform.localScale = Vector3.one * scaleModifier * density.radius * selected.waterHeight; // } // if (hasAtmosphere) { // // instantiate an atmosphere prefab with scale set to slightly larger than scaleModifier * radius // } // if (hasRings) { // ringChunkHolder = new GameObject("Ring Chunks Holder"); // ringChunkHolder.layer = 9; // ringGenerator.chunkHolder = ringChunkHolder; // ringChunkHolder.transform.position = realPlanet.position; // ringChunkHolder.transform.rotation = realPlanet.rotation; // ringGenerator.mat = selected.ringMaterials[Random.Range(0, selected.ringMaterials.Length)]; // RingDensity ringDensity = (RingDensity) ringGenerator.densityGenerator; // ringDensity.innerRadius = density.radius * ringInnerRadiusScale; // ringDensity.outerRadius = density.radius * ringOuterRadiusScale; // ringDensity.seed = density.seed; // ringGenerator.Run(); // ringChunkHolder.transform.localScale = Vector3.one * scaleModifier; // } // planet = realPlanet.gameObject.AddComponent<Planet>(); // List<Vector3> loc = GetOrbitalLocations(density.radius * scaleModifier * 2f); // planet.orbitalBuildPoints = new List<Location>(); // foreach (Vector3 l in loc) { // planet.orbitalBuildPoints.Add( // new Location(l, (l - realPlanet.position).normalized) // ); // } // BuildNavTrees(); }
public void Run(TextureMinMax textureMinMax) { this.textureMinMax = textureMinMax; Run(); }