本文整理汇总了C#中GameObject.InLineOfSight方法的典型用法代码示例。如果您正苦于以下问题:C# GameObject.InLineOfSight方法的具体用法?C# GameObject.InLineOfSight怎么用?C# GameObject.InLineOfSight使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GameObject
的用法示例。
在下文中一共展示了GameObject.InLineOfSight方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CheckRangeToggle
public static void CheckRangeToggle(GameObject o)
{
//Core.Player.Distance2D(Core.Player.CurrentTarget.Location) > Core.Player.Distance2D(OldTargetLocation))
if (!InternalSettings.Instance.General.Movement || !InternalSettings.Instance.General.StopInRange || o == null) return;
if (!RangeToggle && IsInSafeRange(o) && o.InLineOfSight())
{
StopMove();
RangeToggle = true;
}//use last targObjId after i make universal
if (RangeToggle && !IsInSafeRange(o)) RangeToggle = false;
}
示例2: Cast
//.........这里部分代码省略.........
if (!target.CanAttack &&
CastType != CastType.Self)
{
switch (SpellType)
{
case SpellType.Damage:
case SpellType.DoT:
case SpellType.Movement:
case SpellType.Cooldown:
case SpellType.Interrupt:
case SpellType.Execute:
case SpellType.Knockback:
case SpellType.Debuff:
case SpellType.Flank:
case SpellType.Behind:
return false;
}
}
#endregion
#region Ninjutsu Exception
if (SpellType == SpellType.Ninjutsu ||
SpellType == SpellType.Mudra)
{
#region Player Movement
if (BotManager.Current.IsAutonomous)
{
switch (Actionmanager.InSpellInRangeLOS(2247, target))
{
case SpellRangeCheck.ErrorNotInLineOfSight:
Navigator.MoveTo(target.Location);
return false;
case SpellRangeCheck.ErrorNotInRange:
Navigator.MoveTo(target.Location);
return false;
case SpellRangeCheck.ErrorNotInFront:
if (!target.InLineOfSight())
{
Navigator.MoveTo(target.Location);
return false;
}
target.Face();
return false;
case SpellRangeCheck.Success:
if (MovementManager.IsMoving)
{
Navigator.PlayerMover.MoveStop();
}
break;
}
}
#endregion
#region IsMounted Check
if (Core.Player.IsMounted)
{
return false;
}
#endregion
示例3: CheckFace
#pragma warning disable 1998
public static async Task CheckFace(GameObject o)
#pragma warning restore 1998
{//&& !Helpers.Rogue.me.MovementInfo.IsStrafing
if (InternalSettings.Instance.General.Movement && o != null && MovementManager.IsMoving
&& !TooClose(o) && o.InLineOfSight() && !IsFacingMovement(Core.Player, o)
) Face(o);
}
示例4: PullMove
#pragma warning disable 1998
public static async Task<bool> PullMove(GameObject o)
#pragma warning restore 1998
{
if (!InternalSettings.Instance.General.Movement || o == null) return false;
CheckRangeToggle(o);
OldTargetLocation = Core.Player.CurrentTarget.Location;
if (o.InLineOfSight() && IsInSafeRange(o))
{
StopMove();
return false;
}
if (!(MovementManager.IsMoving && IsFacingMovement(Core.Player, o))) MoveTo(o);
return true;
}
示例5: MoveTo
public static MoveResult MoveTo(GameObject o)
{//Math.Abs(o.Z - Core.Player.Z) > 1 ?
//MovementManager.IsMoving && Movement.IsFacingMovement(Core.Player, o)
if (o == null) return MoveResult.Failed;
if (MovementManager.IsMoving && IsFacingMovement(Core.Player, o)) return MoveResult.Moving;
if (!o.InLineOfSight() || Running || !InternalSettings.Instance.General.MeshFreeMovement
|| (Core.Player.Location.Z + 2) < o.Location.Z
|| InternalSettings.Instance.General.MeshOnStillTargets && Core.Player.CurrentTarget.Distance2D(OldTargetLocation) < 0.05)
{
MoveResult mr = Navigator.MoveTo(o.Location);
if (mr == MoveResult.ReachedDestination)
{
StopMove();
Logging.Write(Colors.OrangeRed, "[YourRaidingBuddy] Location Reached?");
return mr;
}//add timer for generating/ed
if (mr != MoveResult.Moving)
Logging.Write(Colors.OrangeRed, "[YourRaidingBuddy] Movement Result: " + mr);
if (mr == MoveResult.Done || mr == MoveResult.Moved || mr == MoveResult.Moving
|| mr == MoveResult.GeneratingPath || mr == MoveResult.PathGenerated)
return mr;
}
if (InternalSettings.Instance.General.MeshFreeMovement)
{
Navigator.Clear();
Logging.Write(Colors.OrangeRed, "[YourRaidingBuddy] Moving Mesh Free");
MyMover.MoveTowards(o.Location);
}
//MathEx.GetPointAt(o.Location, CombatMovementRange(o), MathEx.NormalizeRadian(MathHelper.CalculateHeading(Core.Player.Location, o.Location))));
return MoveResult.Moving;
//return !o.InLineOfSight() ? Navigator.MoveTo(o.Location) : Navigator.NavigationProvider.MoveToRandomSpotWithin(MathEx.GetPointAt(o.Location, CombatMovementRange(o), MathEx.NormalizeRadian(MathHelper.CalculateHeading(Core.Player.Location, Core.Player.CurrentTarget.Location))), 1f);
}