Files
FORT-BO/Assets/CONTENT/FEATURES/MapRadar/AirTarget.cs
T
AsanoRema c01ff800f6 Squashed commit of the following:
commit 173bbb165c
Author: henjkey <henjkey@gmail.com>
Date:   Fri Aug 14 18:51:23 2026 +0500

    Mappp

commit d559ab338a
Author: henjkey <henjkey@gmail.com>
Date:   Thu Aug 13 18:42:41 2026 +0500

    Map

    Controller
    Coordinates
    Target System
    Crosshair System
    Radar System
2026-08-18 16:16:19 +03:00

22 lines
638 B
C#

using UnityEngine;
[DisallowMultipleComponent]
public sealed class AirTarget : MapTarget
{
protected override void TickMovement(float deltaTime)
{
if (Player == null || Config == null || Config.MovementSpeed <= 0f)
return;
Vector2 playerCoordinates = Player.MapCoordinates;
if (Vector2.Distance(MapCoordinates, playerCoordinates) <= Config.StoppingDistance)
return;
Vector2 nextCoordinates = Vector2.MoveTowards(
MapCoordinates,
playerCoordinates,
Config.MovementSpeed * deltaTime);
SetMapCoordinates(nextCoordinates);
}
}