本文整理匯總了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;
}