static void Main(string[] args) { if (args.Length == 0) { args = new[] { Console.ReadLine(), Console.ReadLine() }; } else if (args.Length == 1) { args = new[] { args[0], Console.ReadLine() }; } Console.Clear(); var player = new CVP(args[0], float.Parse(args[1])); player.StartPlay(false); player.Dispose(); }
public void Execute(int i) { float elevation = Elevation[i]; if (Explored[i] > 0) { float4 terrainColor = new float4(0.4f, 0.4f, 0.4f, 1); TerrainElevation[i] = (elevation * TerrainScale + PlanetRadius) / PlanetRadius; terrainColor = math.lerp(terrainColor, new float4(0.6f, 0.5f, 0.2f, 1.0f), math.saturate(Dirt[i])); terrainColor = math.lerp(terrainColor, new float4(0.6f, 0.6f, 0.4f, 1.0f), math.saturate(Sand[i])); terrainColor = math.lerp(terrainColor, new float4(0.2f, 0.7f, 0.1f, 1.0f), math.saturate(Vegetation[i])); terrainColor = math.lerp(terrainColor, new float4(0.8f, 0.9f, 1.0f, 1.0f), math.saturate(Ice[i])); TerrainColor[i] = terrainColor; } else { TerrainElevation[i] = 1; TerrainColor[i] = new float4(0, 0, 0, 1); } float waterDepth = WaterDepth[i]; WaterColor[i] = waterDepth > 0 ? new float4(0, 0, 1, math.saturate(waterDepth / 100)) : new float4(0, 0, 0, 0); WaterElevation[i] = ((waterDepth == 0) ? 1 : ((elevation + waterDepth) * TerrainScale + PlanetRadius) / PlanetRadius); TerrainState[i] = new float4(0, 0, 0, Explored[i]); if (MeshOverlayActive) { OverlayColor[i] = CVP.Lerp(MeshOverlayColors, (MeshOverlayData[i] - MeshOverlayMin) * MeshOverlayInverseRange); } else { OverlayColor[i] = new Color32(); } }