using ET; using System.Collections.Generic; using System.Threading; using UnityEngine; namespace ET { public class UnitPathComponentAwakeSystem : AwakeSystem { public override void Awake(UnitPathComponent self) { } } public class UnitPathComponent : Entity { private MonoAnimancer animancer; private Unit unit; public ETCancellationToken cancellationTokenSource; public async ETVoid StartMove(Vector2 currPos,Vector2 targetPos,float speed) { unit = GetParent(); using var listComponent = ListComponent.Create(); listComponent.List.Add(new Vector3(currPos.x, currPos.y, PosHelper.PlayerPos_Z)); listComponent.List.Add(new Vector3(targetPos.x, targetPos.y, PosHelper.PlayerPos_Z)); await this.parent.GetComponent().MoveToAsync(listComponent.List, speed); } } }