void Awake() { GameState gameState = GameState.Instance; PlayerState playerState = PlayerState.Instance; PlanetNameGenerator planetNameGen = PlanetNameGenerator.Instance; this.hexes = new GameObject[MapWidth][]; for (int x = 0; x < this.MapWidth; x++) { this.hexes[x] = new GameObject[this.MapHeight]; } this.GenerateMap(); this.GenerateStartingHex(); }
public PlanetParameters(PlanetSeed planetSeed) { this.planetSeed = planetSeed; Random.seed = planetSeed.seed; gradientMultiplier = Random.Range(1.3f, 2.3f); seaLevel = Random.Range(0.25f, 0.8f); terrainHeight = Random.Range(0.04f, 0.08f); perlinSpaceSeed = new Vector3(Random.Range(1f, 10f), Random.Range(1f, 10f), Random.Range(1f, 10f)); icyness = Mathf.Sqrt(Random.Range(0.01f, 15.0f)) - 2f; Color32 shore = color(Random.Range(60, 120), Random.Range(120, 180), Random.Range(70, 110)); Color32 hills = color(Random.Range(80, 140), Random.Range(100, 160), Random.Range(60, 100)); Color32 highHills = color(Random.Range(80, 140), Random.Range(100, 160), Random.Range(60, 100)); Color32 mountains = color(Random.Range(210, 250), Random.Range(210, 250), Random.Range(230, 250)); gradient = new Gradient(); Gradient.GradientPoint p1 = new Gradient.GradientPoint(shore, 0.0f); Gradient.GradientPoint p2 = new Gradient.GradientPoint(hills, 0.5f); Gradient.GradientPoint p3 = new Gradient.GradientPoint(highHills, 0.8f); Gradient.GradientPoint p4 = new Gradient.GradientPoint(mountains, 1.0f); gradient.gradientPoints = new Gradient.GradientPoint[] { p1, p2, p3, p4 }; waterColor = new Color32((byte)Random.Range(40, 50), (byte)Random.Range(30, 90), (byte)Random.Range(90, 150), (byte)80); landIceColor = new Color32((byte)Random.Range(230, 240), (byte)Random.Range(230, 240), (byte)Random.Range(240, 255), (byte)30); waterIceColor = new Color32((byte)Random.Range(230, 245), (byte)Random.Range(240, 255), (byte)Random.Range(230, 245), (byte)240); starLight = new Color32( (byte)(Random.Range(135, 195) - 50 * icyness), (byte)(Random.Range(164, 124) - 40 * icyness), (byte)(Random.Range(200, 255) - 2 * icyness), (byte)255); starIntensity = Random.Range(1.5f, 2.0f); planetSize = Random.Range(0.75f, 1.25f); name = PlanetNameGenerator.GenerateName(); }