本文整理汇总了C#中AIHeroClient.GetPath方法的典型用法代码示例。如果您正苦于以下问题:C# AIHeroClient.GetPath方法的具体用法?C# AIHeroClient.GetPath怎么用?C# AIHeroClient.GetPath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AIHeroClient
的用法示例。
在下文中一共展示了AIHeroClient.GetPath方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetPath
public static float GetPath(AIHeroClient hero, Vector3 b)
{
var path = hero.GetPath(b);
var lastPoint = path[0];
var distance = 0f;
foreach (var point in path.Where(point => !point.Equals(lastPoint)))
{
distance += lastPoint.LSDistance(point);
lastPoint = point;
}
return distance;
}
示例2: GetPointAfterTimeFromPath
public static Vector3 GetPointAfterTimeFromPath(AIHeroClient hero, Vector3 b, float timeInSec)
{
var path = hero.GetPath(b);
var lastPoint = path[0];
var distance = 0f;
var maxDist = hero.MoveSpeed * timeInSec;
foreach (var point in path.Where(point => !point.Equals(lastPoint)))
{
if (distance > maxDist)
{
break;
}
distance += lastPoint.LSDistance(point);
lastPoint = point;
}
return lastPoint;
}
示例3: IsPathSafeEx
public bool IsPathSafeEx(Vector2 end, AIHeroClient hero = null)
{
hero = hero ?? Player.Instance;
return IsPathSafeEx(hero.GetPath(end.To3DWorld(), true).ToVector2(), hero);
}
示例4: GetPath
public static float GetPath(AIHeroClient hero, Vector3 b)
{
var path = hero.GetPath(b);
Vector3[] lastPoint = {path[0]};
var distance = 0f;
foreach (var point in path.Where(point => !point.Equals(lastPoint[0])))
{
distance += Extensions.Distance(lastPoint[0], point);
lastPoint[0] = point;
}
return distance;
}