This commit is contained in:
Marco 2025-02-21 18:57:00 +01:00
commit b07a8fe60d
33 changed files with 594 additions and 58 deletions

View file

@ -195,11 +195,17 @@ public partial class GameManager : Node2D
CameraTargetObject(_player);
}
public void CameraTargetObject(Node2D target)
public void CameraTargetObject(Node2D target, Vector2? offset = null)
{
if (_cameraTarget is null) return;
_cameraTarget.Reparent(target, true);
_cameraTarget.GlobalPosition = target.GlobalPosition;
if (offset.HasValue)
{
_cameraTarget.Position += offset.Value;
}
}
private void SpawnWeapons()