Removed OmniLights from Walls, added spotlights to robots. Added vase 3D model
This commit is contained in:
+2
-28
@@ -11,7 +11,7 @@ public partial class Tile
|
||||
public Vector2I GridPosition;
|
||||
public Node3D ContentNode;
|
||||
|
||||
public bool containsLight, containsDecoration, containsResource;
|
||||
public bool containsDecoration, containsResource;
|
||||
public GameResource resource;
|
||||
public bool wasVisited;
|
||||
public event EventHandler OnTileVisited;
|
||||
@@ -74,7 +74,6 @@ public partial class Tile
|
||||
public void Reset(Dictionary<string, MeshInstance3D> tileMeshes)
|
||||
{
|
||||
collapsedMesh = null;
|
||||
containsLight = false;
|
||||
containsDecoration = false;
|
||||
containsResource = false;
|
||||
resource = null;
|
||||
@@ -86,36 +85,11 @@ public partial class Tile
|
||||
{
|
||||
foreach (Placeholder placeholder in placeholders)
|
||||
{
|
||||
if (containsLight && placeholder.name == "light") SpawnLight(contentMeshes["light"], placeholder, transform);
|
||||
else if (containsResource && placeholder.name == "resource") SpawnResource(contentMeshes["resource"], placeholder, transform);
|
||||
if (containsResource && placeholder.name == "resource") SpawnResource(contentMeshes["resource"], placeholder, transform);
|
||||
else if (containsDecoration && placeholder.name != "light" && placeholder.name != "resource") SpawnDecorations(contentMeshes, placeholder, transform);
|
||||
}
|
||||
}
|
||||
|
||||
private void SpawnLight(MeshInstance3D lightMesh, Placeholder placeholder, Transform3D transform)
|
||||
{
|
||||
MeshInstance3D light = new MeshInstance3D
|
||||
{
|
||||
Mesh = lightMesh.Mesh,
|
||||
Position = placeholder.transform.Origin
|
||||
};
|
||||
OmniLight3D lightSource = new OmniLight3D()
|
||||
{
|
||||
OmniAttenuation = 2f,
|
||||
LightColor = GameData.lightColor,
|
||||
ShadowEnabled = true,
|
||||
LightEnergy = 100f,
|
||||
LightIndirectEnergy = 1.5f,
|
||||
OmniRange = 20f,
|
||||
Position = placeholder.transform.Origin
|
||||
};
|
||||
lightSource.Position.MoveToward(transform.Origin, 0.1f);
|
||||
LightHandler.lights.Add(lightSource);
|
||||
light.AddChild(lightSource);
|
||||
ContentNode.AddChild(light);
|
||||
light.LookAt(transform.Origin, Vector3.Up);
|
||||
}
|
||||
|
||||
private void SpawnResource(MeshInstance3D resourceMesh, Placeholder placeholder, Transform3D transform)
|
||||
{
|
||||
MeshInstance3D resource = new MeshInstance3D
|
||||
|
||||
Reference in New Issue
Block a user