Refactor; Optimize simulation
This commit is contained in:
parent
8581cf6fb8
commit
0ef5652cea
16 changed files with 508 additions and 651 deletions
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue