Finished first EA Version #1
Binary file not shown.
@@ -6,7 +6,7 @@ public class Placeholder
|
|||||||
public Transform3D transform;
|
public Transform3D transform;
|
||||||
|
|
||||||
public Placeholder(string name, Transform3D transform){
|
public Placeholder(string name, Transform3D transform){
|
||||||
this.name = name.Split("_")[0];
|
this.name = name.Split("_")[0].ToLower();
|
||||||
this.transform = transform;
|
this.transform = transform;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+4
-5
@@ -77,12 +77,11 @@ public partial class Tile
|
|||||||
|
|
||||||
public void SpawnContent(Dictionary<string, MeshInstance3D> contentMeshes, Transform3D transform, List<Placeholder> placeholders)
|
public void SpawnContent(Dictionary<string, MeshInstance3D> contentMeshes, Transform3D transform, List<Placeholder> placeholders)
|
||||||
{
|
{
|
||||||
|
|
||||||
foreach (Placeholder placeholder in placeholders)
|
foreach (Placeholder placeholder in placeholders)
|
||||||
{
|
{
|
||||||
if (containsLight && placeholder.name.ToLower() == "light") SpawnLight(contentMeshes["light"], placeholder, transform);
|
if (containsLight && placeholder.name == "light") SpawnLight(contentMeshes["light"], placeholder, transform);
|
||||||
else if (containsResource && placeholder.name.ToLower() == "resource") SpawnResource(contentMeshes["resource"], placeholder, transform);
|
else if (containsResource && placeholder.name == "resource") SpawnResource(contentMeshes["resource"], placeholder, transform);
|
||||||
else if (containsDecoration) SpawnDecorations(contentMeshes, placeholder, transform);
|
else if (containsDecoration && placeholder.name != "light" && placeholder.name != "resource") SpawnDecorations(contentMeshes, placeholder, transform);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -125,7 +124,7 @@ public partial class Tile
|
|||||||
{
|
{
|
||||||
foreach (string key in contentMeshes.Keys)
|
foreach (string key in contentMeshes.Keys)
|
||||||
{
|
{
|
||||||
if (key.ToLower() != placeholder.name.ToLower()) continue;
|
if (key.ToLower() != placeholder.name) continue;
|
||||||
MeshInstance3D decoration = new MeshInstance3D
|
MeshInstance3D decoration = new MeshInstance3D
|
||||||
{
|
{
|
||||||
Mesh = contentMeshes[key].Mesh,
|
Mesh = contentMeshes[key].Mesh,
|
||||||
|
|||||||
+3
-1
@@ -141,10 +141,12 @@ public partial class World : Node3D
|
|||||||
|
|
||||||
int posX, posY;
|
int posX, posY;
|
||||||
|
|
||||||
while(currentLight < layerSize * layerSize / 4)
|
while(currentLight < layerSize * 3)
|
||||||
{
|
{
|
||||||
posX = rand.Next(layerSize);
|
posX = rand.Next(layerSize);
|
||||||
posY = rand.Next(layerSize);
|
posY = rand.Next(layerSize);
|
||||||
|
//Skip already placed lights and skip junction and gate as they do not contain lights
|
||||||
|
if(layer.tiles[posX, posY].collapsedMesh == "junction" || layer.tiles[posX, posY].collapsedMesh == "gate") continue;
|
||||||
if(layer.tiles[posX, posY].containsLight) continue;
|
if(layer.tiles[posX, posY].containsLight) continue;
|
||||||
layer.tiles[posX, posY].containsLight = true;
|
layer.tiles[posX, posY].containsLight = true;
|
||||||
currentLight++;
|
currentLight++;
|
||||||
|
|||||||
Reference in New Issue
Block a user