Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions Features/Serializable/Schematics/SchematicBlockData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,15 @@ public GameObject Create(SchematicObject schematicObject, Transform parentTransf
Transform transform = gameObject.transform;
transform.SetParent(parentTransform);
transform.SetLocalPositionAndRotation(Position, Quaternion.Euler(Rotation));

transform.localScale = BlockType switch
{
BlockType.Empty when Scale == Vector3.zero => Vector3.one,
BlockType.Waypoint => Scale * SerializableWaypoint.ScaleMultiplier,
_ => Scale,
};

if (BlockType == BlockType.Waypoint)
gameObject.GetComponent<WaypointToy>().NetworkBoundsSize = Scale;
else
transform.localScale = BlockType switch
{
BlockType.Empty when Scale == Vector3.zero => Vector3.one,
_ => Scale
};

if (gameObject.TryGetComponent(out AdminToyBase adminToyBase))
{
Expand Down
4 changes: 1 addition & 3 deletions Features/Serializable/SerializableWaypoint.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ namespace ProjectMER.Features.Serializable;

public class SerializableWaypoint : SerializableObject, IIndicatorDefinition
{
public const float ScaleMultiplier = 1 / 256f;

public override GameObject? SpawnOrUpdateObject(Room? room = null, GameObject? instance = null)
{
WaypointToy waypoint = instance == null ? GameObject.Instantiate(PrefabManager.Waypoint) : instance.GetComponent<WaypointToy>();
Expand All @@ -21,7 +19,7 @@ public class SerializableWaypoint : SerializableObject, IIndicatorDefinition
_prevIndex = Index;

waypoint.transform.SetPositionAndRotation(position, rotation);
waypoint.transform.localScale = Scale * ScaleMultiplier;
waypoint.NetworkBoundsSize = Scale;
waypoint.NetworkMovementSmoothing = 60;
waypoint.NetworkVisualizeBounds = true;

Expand Down