You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
742 B
27 lines
742 B
3 years ago
|
using System.Collections.Generic;
|
||
|
using UnityEngine;
|
||
|
|
||
|
namespace ET
|
||
|
{
|
||
|
[MessageHandler]
|
||
|
public class M2C_PathfindingResultHandler : AMHandler<M2C_PathfindingResult>
|
||
|
{
|
||
|
protected override void Run(Session session, M2C_PathfindingResult message)
|
||
|
{
|
||
|
Unit unit = session.DomainScene().CurrentScene().GetComponent<UnitComponent>().Get(message.Id);
|
||
|
|
||
|
float speed = unit.GetComponent<NumericComponent>().GetAsFloat(NumericType.Speed);
|
||
|
|
||
|
using (ListComponent<Vector3> list = ListComponent<Vector3>.Create())
|
||
|
{
|
||
|
for (int i = 0; i < message.Xs.Count; ++i)
|
||
|
{
|
||
|
list.Add(new Vector3(message.Xs[i], message.Ys[i], message.Zs[i]));
|
||
|
}
|
||
|
|
||
|
unit.GetComponent<MoveComponent>().MoveToAsync(list, speed).Coroutine();
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|