本文整理汇总了C#中Obj_AI_Base.GetPath方法的典型用法代码示例。如果您正苦于以下问题:C# Obj_AI_Base.GetPath方法的具体用法?C# Obj_AI_Base.GetPath怎么用?C# Obj_AI_Base.GetPath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Obj_AI_Base
的用法示例。
在下文中一共展示了Obj_AI_Base.GetPath方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetPath
public static float GetPath(Obj_AI_Base 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;
}
示例2: CheckPointCollision
public static bool CheckPointCollision(Obj_AI_Base unit, Vector2 movePos)
{
var path = unit.GetPath(movePos.To3D());
if (path.Length > 0)
{
if (movePos.Distance(path[path.Length - 1].To2D()) > 5)
{
return true;
}
}
return false;
}
示例3: CheckPathCollision
public static bool CheckPathCollision(Obj_AI_Base unit, Vector2 movePos)
{
var path = unit.GetPath(ObjectCache.myHeroCache.serverPos2D.To3D(), movePos.To3D());
if (path.Length > 0)
{
if (movePos.Distance(path[path.Length - 1].To2D()) > 5 || path.Length > 2)
{
return true;
}
}
return false;
}
示例4: realDistanceTill
public static float realDistanceTill(Obj_AI_Base source, AttackableUnit target)
{
float dist = 0;
var dists = source.GetPath(target.Position);
if (dists.Count() == 0)
return 0;
Vector3 from = dists[0];
foreach (var to in dists)
{
dist += Vector3.Distance(from, to);
from = to;
}
return dist;
}
示例5: CheckPathCollision
public static bool CheckPathCollision(Obj_AI_Base unit, Vector2 movePos)
{
//var path = unit.Path;
var path = unit.GetPath(GameData.HeroInfo.ServerPos2D.To3DWorld(), movePos.To3DWorld());
if (path.Length > 0)
{
if (movePos.Distance(path[path.Length - 1].To2D()) > 5 || path.Length > 2)
{
return true;
}
}
return false;
}