Replace xform.WorldPosition with xformSystem method for Setting/Getting (#30029)
* GET WORLD POSITON, ROTATION * Missing parentheses * ui system depndency * the issue * Unused * Let the function do the transform --------- Co-authored-by: plykiya <plykiya@protonmail.com>
This commit is contained in:
@@ -9,6 +9,7 @@ public sealed class HTNOverlay : Overlay
|
||||
{
|
||||
private readonly IEntityManager _entManager = default!;
|
||||
private readonly Font _font = default!;
|
||||
private readonly SharedTransformSystem _transformSystem;
|
||||
|
||||
public override OverlaySpace Space => OverlaySpace.ScreenSpace;
|
||||
|
||||
@@ -16,6 +17,7 @@ public sealed class HTNOverlay : Overlay
|
||||
{
|
||||
_entManager = entManager;
|
||||
_font = new VectorFont(resourceCache.GetResource<FontResource>("/Fonts/NotoSans/NotoSans-Regular.ttf"), 10);
|
||||
_transformSystem = _entManager.System<SharedTransformSystem>();
|
||||
}
|
||||
|
||||
protected override void Draw(in OverlayDrawArgs args)
|
||||
@@ -30,7 +32,7 @@ public sealed class HTNOverlay : Overlay
|
||||
if (string.IsNullOrEmpty(comp.DebugText) || xform.MapID != args.MapId)
|
||||
continue;
|
||||
|
||||
var worldPos = xform.WorldPosition;
|
||||
var worldPos = _transformSystem.GetWorldPosition(xform);
|
||||
|
||||
if (!args.WorldAABB.Contains(worldPos))
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user