本文整理汇总了C#中Vector3.IsValid方法的典型用法代码示例。如果您正苦于以下问题:C# Vector3.IsValid方法的具体用法?C# Vector3.IsValid怎么用?C# Vector3.IsValid使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Vector3
的用法示例。
在下文中一共展示了Vector3.IsValid方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CastFlash
public void CastFlash(Vector3 position)
{
var flash = Player.Spells.FirstOrDefault(a => a.SData.Name == "summonerflash");
if (flash != null && position.IsValid() && flash.IsReady)
{
Player.CastSpell(flash.Slot, position);
}
}
示例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: GetWallWidth
private static float GetWallWidth(Vector3 start, Vector3 direction, int maxWallWidth = 350, int step = 1)
{
var thickness = 0f;
if (!start.IsValid() || !direction.IsValid())
{
return thickness;
}
for (var i = 0; i < maxWallWidth; i = i + step)
{
if (NavMesh.GetCollisionFlags(start.Extend(direction, i)) == CollisionFlags.Wall || start.Extend(direction, i).IsWall())
{
thickness += step;
}
}
return thickness;
}
示例4: FirstWallPoint
/// <summary>
/// Gets the first wall point/node, w/e.
/// </summary>
/// <param name="playerPosition"></param>
/// <param name="endPosition"></param>
/// <param name="step"></param>
/// <returns></returns>
public Vector3 FirstWallPoint(Vector3 playerPosition, Vector3 endPosition, int step = 1)
{
if (!playerPosition.IsValid() || !endPosition.IsValid())
{
return Vector3.Zero;
}
var distance = playerPosition.Distance(endPosition);
for (var i = 0; i < distance; i = i + step)
{
var newPoint = playerPosition.Extend(endPosition, i);
if (NavMesh.GetCollisionFlags(newPoint) == CollisionFlags.Wall || newPoint.IsWall())
{
return newPoint;
}
}
return Vector3.Zero;
}
示例5: GetWallWidth
public static float GetWallWidth(Vector3 start, Vector3 direction, int maxWallWidth = 350, int step = 1)
{
var thickness = 0f;
if (start.IsValid() && direction.IsValid())
{
for (var i = 0; i < maxWallWidth; i = i + step)
{
if (NavMesh.GetCollisionFlags(start.Extend(direction, i)) == CollisionFlags.Wall
|| start.Extend(direction, i).IsWall())
{
// Console.WriteLine("Thickness: " + thickness);
thickness += step;
}
else
{
return thickness;
}
}
}
return thickness;
}
示例6: GetMinionsPredictedPositions
/// <summary>
/// Returns a list of predicted minion positions.
/// </summary>
/// <param name="minions">
/// Given Minion List
/// </param>
/// <param name="delay">
/// Skill-shot Delay
/// </param>
/// <param name="width">
/// Skill-shot Width
/// </param>
/// <param name="speed">
/// Skill-shot Speed
/// </param>
/// <param name="from">
/// The From
/// </param>
/// <param name="range">
/// Skill-shot Range
/// </param>
/// <param name="collision">
/// Has Collision Flag
/// </param>
/// <param name="stype">
/// Skill-shot Type
/// </param>
/// <param name="rangeCheckFrom">
/// Range check from Vector3 source
/// </param>
/// <returns>
/// List of Points in <see cref="Vector2" /> type
/// </returns>
public static List<Vector2> GetMinionsPredictedPositions(
List<Obj_AI_Minion> minions,
float delay,
float width,
float speed,
Vector3 from,
float range,
bool collision,
SkillshotType stype,
Vector3 rangeCheckFrom = default(Vector3))
{
from = from.IsValid() ? from : ObjectManager.Player.ServerPosition;
return (from minion in minions
select
Movement.GetPrediction(
new PredictionInput
{
Unit = minion, Delay = delay, Radius = width, Speed = speed, From = @from,
Range = range, Collision = collision, Type = stype, RangeCheckFrom = rangeCheckFrom
})
into pos
where pos.Hitchance >= HitChance.High
select pos.UnitPosition.ToVector2()).ToList();
}