Reworked lights, removed background, fixed colors, v1.2.0
This commit is contained in:
@@ -62,15 +62,11 @@ public class NoiseGenerator
|
||||
}
|
||||
|
||||
float modifier = highestValue - lowestValue;
|
||||
if (lowestValue < 0)
|
||||
{
|
||||
lowestValue = lowestValue * -1;
|
||||
}
|
||||
|
||||
colors = new Color32[samples.Length];
|
||||
for (int i = 0; i < samples.Length; i++)
|
||||
{
|
||||
colors[i] = Color32.Lerp(low, high, (samples[i] * modifier) + lowestValue);
|
||||
colors[i] = Color32.Lerp(low, high, (1 / modifier) * (samples[i] - lowestValue));
|
||||
}
|
||||
|
||||
for (int i = 0; i < samples.Length; i++)
|
||||
@@ -105,7 +101,7 @@ public class NoiseGenerator
|
||||
{
|
||||
float xCord = tile.GetComponent<Tile>().getPosition().x + vertices[i].x / (vertices.Length - 1) * 10;
|
||||
float yCord = tile.GetComponent<Tile>().getPosition().z + vertices[i].z / (vertices.Length - 1) * 10;
|
||||
float sample = Mathf.PerlinNoise(xCord, yCord);
|
||||
float sample = Mathf.PerlinNoise(xCord, yCord) - 0.1f * rand.Next(0, 6);
|
||||
samples[i] = sample;
|
||||
}
|
||||
}
|
||||
@@ -163,8 +159,8 @@ public class NoiseGenerator
|
||||
Vector3[] vertices = mesh.vertices;
|
||||
float[] samples = calculateBasicSamples(tile);
|
||||
|
||||
int randX = rand.Next(-4, 5);
|
||||
int randZ = rand.Next(-4, 5);
|
||||
int randX = rand.Next(-3, 4);
|
||||
int randZ = rand.Next(-3, 4);
|
||||
|
||||
for (int i = -1; i < 2; i++)
|
||||
{
|
||||
|
||||
@@ -65,7 +65,7 @@ public class WorldGenerator : MonoBehaviour
|
||||
|
||||
void resetPlayer()
|
||||
{
|
||||
if (player.transform.position.y <= -5)
|
||||
if (player.transform.position.y <= -10)
|
||||
{
|
||||
Vector3 position = new Vector3(currentTile.transform.position.x, 5, currentTile.transform.position.z);
|
||||
player.transform.SetPositionAndRotation(position, player.transform.rotation);
|
||||
|
||||
Reference in New Issue
Block a user