move space tiles into parent for readability
This commit is contained in:
@@ -15,7 +15,7 @@ GameObject:
|
|||||||
m_TagString: Untagged
|
m_TagString: Untagged
|
||||||
m_Icon: {fileID: 0}
|
m_Icon: {fileID: 0}
|
||||||
m_NavMeshLayer: 0
|
m_NavMeshLayer: 0
|
||||||
m_StaticEditorFlags: 0
|
m_StaticEditorFlags: 2147483647
|
||||||
m_IsActive: 1
|
m_IsActive: 1
|
||||||
--- !u!4 &8664788757336834019
|
--- !u!4 &8664788757336834019
|
||||||
Transform:
|
Transform:
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ namespace Escape_Room_Engine.Engine.Scripts
|
|||||||
internal readonly Dimensions rrDimensions;
|
internal readonly Dimensions rrDimensions;
|
||||||
internal List<Module> Modules { get; } = new(2);
|
internal List<Module> Modules { get; } = new(2);
|
||||||
|
|
||||||
private GameObject _spaceObject;
|
private GameObject _spaceObject, _spaceTiles;
|
||||||
private readonly Room _room;
|
private readonly Room _room;
|
||||||
|
|
||||||
internal Space(Room room, Passage entrance)
|
internal Space(Room room, Passage entrance)
|
||||||
@@ -64,6 +64,9 @@ namespace Escape_Room_Engine.Engine.Scripts
|
|||||||
_spaceObject.transform.localPosition = new Vector3(rrDimensions.x, 0, rrDimensions.z);
|
_spaceObject.transform.localPosition = new Vector3(rrDimensions.x, 0, rrDimensions.z);
|
||||||
|
|
||||||
// build the space floor out of tiles
|
// build the space floor out of tiles
|
||||||
|
_spaceTiles = new GameObject($"Space Geometry");
|
||||||
|
_spaceTiles.transform.SetParent(_spaceObject.transform, false);
|
||||||
|
_spaceTiles.isStatic = true;
|
||||||
for (var z = 0; z < rrDimensions.length; z++)
|
for (var z = 0; z < rrDimensions.length; z++)
|
||||||
{
|
{
|
||||||
for (var x = 0; x < rrDimensions.width; x++)
|
for (var x = 0; x < rrDimensions.width; x++)
|
||||||
@@ -81,7 +84,7 @@ namespace Escape_Room_Engine.Engine.Scripts
|
|||||||
else
|
else
|
||||||
location = left ? TileLocation.W : right ? TileLocation.E : TileLocation.C;
|
location = left ? TileLocation.W : right ? TileLocation.E : TileLocation.C;
|
||||||
|
|
||||||
var tileObject = Object.Instantiate(Engine.DefaultEngine.config.spaceTile, _spaceObject.transform, false);
|
var tileObject = Object.Instantiate(Engine.DefaultEngine.config.spaceTile, _spaceTiles.transform, false);
|
||||||
tileObject.transform.localPosition = new Vector3(x, 0, z);
|
tileObject.transform.localPosition = new Vector3(x, 0, z);
|
||||||
tileObject.showTile = location;
|
tileObject.showTile = location;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,6 +54,7 @@ namespace Escape_Room_Engine.Engine.Scripts
|
|||||||
}
|
}
|
||||||
|
|
||||||
_tile = Instantiate(tilePrefabs[showTile], transform);
|
_tile = Instantiate(tilePrefabs[showTile], transform);
|
||||||
|
_tile.isStatic = true;
|
||||||
_tile.GetComponent<MeshRenderer>().material = material;
|
_tile.GetComponent<MeshRenderer>().material = material;
|
||||||
|
|
||||||
_showTile = showTile;
|
_showTile = showTile;
|
||||||
|
|||||||
Reference in New Issue
Block a user