18 lines
519 B
C#
18 lines
519 B
C#
|
using UnityEngine;
|
|||
|
|
|||
|
namespace ET
|
|||
|
{
|
|||
|
[ActorMessageHandler]
|
|||
|
public class Frame_ClickMapHandler : AMActorLocationHandler<Unit, Frame_ClickMap>
|
|||
|
{
|
|||
|
protected override async ETTask Run(Unit unit, Frame_ClickMap message)
|
|||
|
{
|
|||
|
if (!unit.IsTeamLeader) return;
|
|||
|
if (unit.teamState != TeamState.None) return;
|
|||
|
if (unit.isAI) return;
|
|||
|
Vector2 target = new Vector2(message.UnitInfo.X, message.UnitInfo.Y);
|
|||
|
MoveHelper.MoveTo(unit, target, message.UnitInfo.YAngle).Coroutine();
|
|||
|
await ETTask.CompletedTask;
|
|||
|
}
|
|||
|
}
|
|||
|
}
|