本文整理汇总了C#中System.Vector2.IsDangerousPosition方法的典型用法代码示例。如果您正苦于以下问题:C# Vector2.IsDangerousPosition方法的具体用法?C# Vector2.IsDangerousPosition怎么用?C# Vector2.IsDangerousPosition使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Vector2
的用法示例。
在下文中一共展示了Vector2.IsDangerousPosition方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetTumblePos
public static Vector3 GetTumblePos(this Obj_AI_Base target)
{
//if the target is not a melee and he's alone he's not really a danger to us, proceed to 1v1 him :^ )
if (!target.IsMelee && Heroes.Player.CountEnemiesInRange(800) == 1) return Game.CursorPos;
var aRC = new Geometry.Circle(Heroes.Player.ServerPosition.To2D(), 300).ToPolygon().ToClipperPath();
var cursorPos = Game.CursorPos;
var targetPosition = target.ServerPosition;
var pList = new List<Vector3>();
var additionalDistance = (0.106 + Game.Ping / 2000f) * target.MoveSpeed;
if (!cursorPos.IsDangerousPosition()) return cursorPos;
foreach (var p in aRC)
{
var v3 = new Vector2(p.X, p.Y).To3D();
if (target.IsFacing(Heroes.Player))
{
if (!v3.IsDangerousPosition() && v3.Distance(targetPosition) < 550) pList.Add(v3);
}
else
{
if (!v3.IsDangerousPosition() && v3.Distance(targetPosition) < 550 - additionalDistance) pList.Add(v3);
}
}
if (Heroes.Player.UnderTurret() || Heroes.Player.CountEnemiesInRange(800) == 1)
{
return pList.Count > 1 ? pList.OrderBy(el => el.Distance(cursorPos)).FirstOrDefault() : Vector3.Zero;
}
return pList.Count > 1 ? pList.OrderBy(el => el.Distance(cursorPos)).FirstOrDefault() : Vector3.Zero;
}
示例2: GetPositioning
public static Vector3 GetPositioning(this Obj_AI_Base target)
{
var cursorPos = Game.CursorPos;
//if the target is not a melee and he's alone he's not really a danger to us, proceed to 1v1 him :^ )
if (!target.IsMelee && Heroes.Player.CountEnemiesInRange(800) == 1) return cursorPos;
if (!cursorPos.IsDangerousPosition()) return cursorPos;
var aRC = new Geometry.Circle(Heroes.Player.ServerPosition.To2D(), 575).ToPolygon().ToClipperPath();
var targetPosition = Prediction.GetPrediction(target, 1800f).UnitPosition;
var pList = new List<Vector3>();
if (!cursorPos.IsDangerousPosition() || Player.UnderTurret() || Game.CursorPos.UnderTurret(true) || Player.CountEnemiesInRange(1400) == 1) return cursorPos;
foreach (var p in aRC)
{
var v3 = new Vector2(p.X, p.Y).To3D();
if (!v3.IsDangerousPosition() && v3.Distance(targetPosition) > 375 && v3.Distance(targetPosition) < 600) pList.Add(v3);
}
return pList.Count > 1 ? pList.OrderBy(el => el.Distance(cursorPos)).FirstOrDefault() : Vector3.Zero;
}