set placement size immediately on module creation
This commit is contained in:
@@ -15,6 +15,7 @@ namespace EscapeRoomEngine.Engine.Runtime.Modules
|
||||
public readonly List<Module> relatedModules = new();
|
||||
|
||||
public ModuleState State { get; private set; }
|
||||
internal Vector2Int Size => srPlacement.size;
|
||||
internal Orientation Orientation => srPlacement.orientation;
|
||||
/// <summary>
|
||||
/// Get the space relative (<i>SR</i>) position of this module.
|
||||
@@ -38,6 +39,7 @@ namespace EscapeRoomEngine.Engine.Runtime.Modules
|
||||
{
|
||||
this.space = space;
|
||||
this.description = description;
|
||||
srPlacement.size = description.modulePrefab.size;
|
||||
}
|
||||
|
||||
internal bool IsType(ModuleType type)
|
||||
@@ -61,7 +63,7 @@ namespace EscapeRoomEngine.Engine.Runtime.Modules
|
||||
Place(new Placement
|
||||
{
|
||||
position = space.ToSpaceRelative(rrPosition),
|
||||
size = description.modulePrefab.size,
|
||||
size = srPlacement.size,
|
||||
orientation = orientation
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user