Refactor; Optimize simulation

This commit is contained in:
Aslan 2026-02-22 14:43:43 -05:00
parent 8581cf6fb8
commit 0ef5652cea
16 changed files with 508 additions and 651 deletions

View file

@ -8,9 +8,14 @@ public class Character(Sector sector, Vector3 localCoordinates) : GameObject(sec
public override void AssignSector(Sector sector)
{
CurrentSector = sector;
Vector3 sectorOffset = GetSectorOffset(sector);
CurrentSector = sector;
if (IsMainPlayer())
{
LocalCoordinates += sectorOffset;
}
ResetLocalCoordinates();
UpdateSectorOffsetToMainPlayer();
UpdateNodePosition();
@ -48,13 +53,6 @@ public class Character(Sector sector, Vector3 localCoordinates) : GameObject(sec
public override void UpdateNodePosition()
{
if (IsMainPlayer())
{
player.GlobalPosition = LocalCoordinates;
}
else
{
player.GlobalPosition = LocalCoordinates + SectorOffset;
}
player.GlobalPosition = LocalCoordinates + SectorOffset;
}
}