本文整理汇总了C#中System.Vector3.DistanceToPlayer方法的典型用法代码示例。如果您正苦于以下问题:C# Vector3.DistanceToPlayer方法的具体用法?C# Vector3.DistanceToPlayer怎么用?C# Vector3.DistanceToPlayer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Vector3
的用法示例。
在下文中一共展示了Vector3.DistanceToPlayer方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CanDash
private static bool CanDash(
Obj_AI_Base target,
bool inQCir = false,
bool underTower = true,
Vector3 pos = new Vector3())
{
if (HaveE(target))
{
return false;
}
if (!pos.IsValid())
{
pos = target.ServerPosition;
}
var posAfterE = GetPosAfterDash(target);
return (underTower || !posAfterE.IsUnderEnemyTurret())
&& posAfterE.Distance(pos) < (inQCir ? Q3.Range : pos.DistanceToPlayer())
&& Evade.IsSafePoint(posAfterE.ToVector2()).IsSafe;
}
示例2: DashCheck
private static bool DashCheck(
Obj_AI_Base target,
bool inQCir = false,
bool underTower = true,
Vector3 pos = new Vector3())
{
if (!pos.IsValid())
{
pos = target.ServerPosition;
}
var posAfterE = PosAfterE(target);
return CanCastE(target) && (underTower || !posAfterE.IsUnderEnemyTurret())
&& posAfterE.Distance(pos) <= (inQCir ? QCirWidth : pos.DistanceToPlayer())
&& Evade.IsSafePoint(posAfterE).IsSafe;
}
示例3: Flee
private static void Flee(Vector3 pos, bool isStar = false)
{
if (!W.IsReady() || !IsWOne || Variables.TickCount - W.LastCastAttemptT <= 1000)
{
return;
}
var objJump =
GameObjects.AllyHeroes.Where(i => !i.IsMe)
.Cast<Obj_AI_Base>()
.Concat(
GameObjects.AllyMinions.Where(
i => i.IsMinion() || i.IsPet() || SpecialPet.Contains(i.CharData.BaseSkinName.ToLower()))
.Concat(GameObjects.AllyWards.Where(i => i.IsWard())))
.Where(
i =>
i.IsValidTarget(W.Range, false)
&& i.Distance(Player.ServerPosition.Extend(pos, Math.Min(pos.DistanceToPlayer(), W.Range)))
< (isStar ? R.Range - 50 : 250))
.MinOrDefault(i => i.Distance(pos));
if (objJump != null)
{
W.CastOnUnit(objJump);
}
else
{
WardManager.Place(pos, false, true);
}
}
示例4: Place
internal static void Place(Vector3 pos, bool isInsecByWard = false, bool isFlee = false)
{
if (!CanWardJump)
{
return;
}
var ward = Common.GetWardSlot();
if (ward == null)
{
return;
}
var posEnd = Player.ServerPosition.Extend(pos, Math.Min(pos.DistanceToPlayer(), WardRange));
Player.Spellbook.CastSpell(ward.SpellSlot, posEnd);
if (isInsecByWard)
{
LastPlaceTime = Variables.TickCount;
}
lastJumpPos = posEnd.ToVector2();
lastJumpTime = Variables.TickCount;
if (isFlee)
{
lastJumpTime += 1100;
}
}