本文整理汇总了C#中Vector3.LSDistance方法的典型用法代码示例。如果您正苦于以下问题:C# Vector3.LSDistance方法的具体用法?C# Vector3.LSDistance怎么用?C# Vector3.LSDistance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Vector3
的用法示例。
在下文中一共展示了Vector3.LSDistance方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetBestPosition
public static Vector3 GetBestPosition(AIHeroClient target, Vector3 firstPosition, Vector3 secondPosition)
{
if (firstPosition.IsWall() && !secondPosition.IsWall() &&
secondPosition.LSDistance(target.ServerPosition) < firstPosition.LSDistance(target.ServerPosition))
// if firstposition is a wall and second position isn't
{
return secondPosition; //return second position
}
if (secondPosition.IsWall() && !firstPosition.IsWall() &&
firstPosition.LSDistance(target.ServerPosition) < secondPosition.LSDistance(target.ServerPosition))
// if secondPosition is a wall and first position isn't
{
return firstPosition; // return first position
}
return firstPosition;
}
示例2: GetFirstWallPoint
public static Vector3 GetFirstWallPoint(Vector3 start, Vector3 end, int step = 1)
{
if (start.IsValid() && end.IsValid())
{
var distance = start.LSDistance(end);
for (var i = 0; i < distance; i = i + step)
{
var newPoint = start.LSExtend(end, i);
if (NavMesh.GetCollisionFlags(newPoint) == CollisionFlags.Wall || newPoint.LSIsWall())
{
return newPoint;
}
}
}
return Vector3.Zero;
}
示例3: InAARange
public bool InAARange(Vector3 point)
{
if (!getCheckBoxItem("AAcheck"))
return true;
if (Orbwalker.LastTarget != null && Orbwalker.LastTarget.Type == GameObjectType.AIHeroClient)
{
return point.LSDistance(Orbwalker.LastTarget.Position) < Player.AttackRange;
}
return point.CountEnemiesInRange(Player.AttackRange) > 0;
}