本文整理汇总了C#中Obj_AI_Hero.GetPath方法的典型用法代码示例。如果您正苦于以下问题:C# Obj_AI_Hero.GetPath方法的具体用法?C# Obj_AI_Hero.GetPath怎么用?C# Obj_AI_Hero.GetPath使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Obj_AI_Hero
的用法示例。
在下文中一共展示了Obj_AI_Hero.GetPath方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetNeededMoveTimeHeavy
public static float GetNeededMoveTimeHeavy(Obj_AI_Hero hero, Vector3 moveTo)
{
var path = hero.GetPath(moveTo);
var time = (path[0] - hero.Position).Length() / hero.MoveSpeed;
for (int i = 1; i < path.Length; i++)
time += (path[i] - path[i - 1]).Length() / hero.MoveSpeed;
return time;
}
示例2: GetNeededMoveTimeWithoutMsHeavy
public static float GetNeededMoveTimeWithoutMsHeavy(Obj_AI_Hero hero, Vector3 moveTo)
{
Console.WriteLine(hero.Name);
var path = hero.GetPath(moveTo);
var time = (path[0] - hero.Position).Length();
for (int i = 1; i < path.Length; i++)
time += (path[i] - path[i - 1]).Length();
return time;
}
示例3: GetPointAfterTimeFromPath
public static Vector3 GetPointAfterTimeFromPath(Obj_AI_Hero 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.Distance(point);
lastPoint = point;
}
return lastPoint;
}
示例4: DrawWaypoint
private void DrawWaypoint(Obj_AI_Hero hero, Vector3 endPos)
{
List<Vector3> waypoints = hero.GetPath(endPos).ToList();
for (int i = 0; i < waypoints.Count - 1; i++)
{
Vector2 oWp = Drawing.WorldToScreen(waypoints[i]);
Vector2 nWp = Drawing.WorldToScreen(waypoints[i + 1]);
Drawing.DrawLine(oWp[0], oWp[1], nWp[0], nWp[1], 1, System.Drawing.Color.GreenYellow);
}
}
示例5: GetPath
public static float GetPath(Obj_AI_Hero 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.Distance(point);
lastPoint = point;
}
return distance;
}