本文整理汇总了C#中System.Vector2.To3D方法的典型用法代码示例。如果您正苦于以下问题:C# Vector2.To3D方法的具体用法?C# Vector2.To3D怎么用?C# Vector2.To3D使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Vector2
的用法示例。
在下文中一共展示了Vector2.To3D方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: isSafePoint
public static IsSafeResult isSafePoint(Vector2 point, bool igonre = false)
{
var result = new IsSafeResult();
result.SkillshotList = new List<Skillshot>();
result.casters = new List<Obj_AI_Base>();
bool safe = (Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Combo)) ||
point.To3D().CountEnemiesInRange(500) > Variables._Player.HealthPercent % 65;
if (!safe)
{
result.IsSafe = false;
return result;
}
foreach (var skillshot in Variables.EvadeDetectedSkillshots)
{
if (skillshot.IsDanger(point) && skillshot.IsAboutToHit(500, Variables._Player))
{
result.SkillshotList.Add(skillshot);
result.casters.Add(skillshot.Unit);
}
}
result.IsSafe = (result.SkillshotList.Count == 0);
return result;
}
示例2: DrawCircleOnMinimap
private static void DrawCircleOnMinimap(float positionX, float positionY, float range)
{
float step = 2 * (float)Math.PI / 70;
float h = positionX;
float k = positionY;
float r = range;
float x_save = 0;
float y_save = 0;
for (float theta = 0; theta < 2 * Math.PI + 20; theta += step)
{
float x = h + r * (float)Math.Cos(theta);
float y = k - r * (float)Math.Sin(theta);
if (theta == 0)
{
x_save = x;
y_save = y;
}
Vector2 saveVector = new Vector2(x_save, y_save);
Vector2 newVector = new Vector2(x, y);
if (x > 0 && x < 14500 && y > 0 && y < 14500 && x_save > 0 && x_save < 14500 && y_save > 0 && y_save < 14500) // Map limits (to fix bugged drawing)
Drawing.DrawLine(Drawing.WorldToMinimap(saveVector.To3D()), Drawing.WorldToMinimap(newVector.To3D()), 1,
System.Drawing.Color.YellowGreen);
x_save = x;
y_save = y;
}
}
示例3: IsCondemable
public static bool IsCondemable(this AIHeroClient unit, Vector2 pos = new Vector2())
{
if (unit.HasBuffOfType(BuffType.SpellImmunity) || unit.HasBuffOfType(BuffType.SpellShield) || LastCheck + 50 > Environment.TickCount || _Player.IsDashing()) return false;
var prediction = ESpell.GetPrediction(unit);
var predictionsList = pos.IsValid() ? new List<Vector3>() {pos.To3D()} : new List<Vector3>
{
unit.ServerPosition,
unit.Position,
prediction.CastPosition,
prediction.UnitPosition
};
var wallsFound = 0;
Program.Points = new List<Vector2>();
foreach (var position in predictionsList)
{
for (var i = 0; i < Program.CondemnMenu["pushDistance"].Cast<Slider>().CurrentValue; i += (int) unit.BoundingRadius)
{
var cPos = _Player.Position.Extend(position, _Player.Distance(position) + i).To3D();
Program.Points.Add(cPos.To2D());
if (NavMesh.GetCollisionFlags(cPos).HasFlag(CollisionFlags.Wall) ||
NavMesh.GetCollisionFlags(cPos).HasFlag(CollisionFlags.Building))
{
wallsFound++;
break;
}
}
}
if ((wallsFound/ predictionsList.Count) >= Program.CondemnMenu["condemnPercent"].Cast<Slider>().CurrentValue/100f)
{
return true;
}
return false;
}
示例4: OnProcessSpellCast
private static void OnProcessSpellCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
{
if (sender == null || !sender.IsValid || args == null)
{
return;
}
var target = args.Target;
if (target == null || !target.IsValid)
{
return;
}
if (sender.IsMe && sender.UnderTurret(true) && target.IsEnemy)
{
}
if (sender is Obj_AI_Turret && target.IsMe)
{
}
if (sender is Obj_AI_Minion && target.IsMe)
{
var orbwalkingPos = new Vector2
{
X = ObjectManager.Player.Position.X + ObjConstants.DefensiveAdditioner,
Y = ObjectManager.Player.Position.Y + ObjConstants.DefensiveAdditioner
};
ObjectManager.Player.IssueOrder(GameObjectOrder.MoveTo, orbwalkingPos.To3D());
}
}
示例5: Drawing_OnDraw
public static void Drawing_OnDraw()
{
Vector2 drakeWallQPos = new Vector2(12050, 4827);
Vector2 midWallQPos = new Vector2(6962, 8952);
if (drakeWallQPos.Distance(_Player) < 3000)
new Circle() { Color = _Player.Distance(drakeWallQPos) <= 100 ? Color.DodgerBlue : Color.White, Radius = 100 }.Draw(drakeWallQPos.To3D());
if (midWallQPos.Distance(_Player) < 3000)
new Circle() { Color = _Player.Distance(midWallQPos) <= 100 ? Color.DodgerBlue : Color.White, Radius = 100 }.Draw(midWallQPos.To3D());
}
示例6: GetPredPos
public static bool GetPredPos(Obj_AI_Hero enemy, bool additionalReactionTime = false, bool additionalBarrelTime = false)
{
PredPos = SPrediction.Prediction.GetFastUnitPosition(enemy, Config.Menu.Item("misc.enemyReactionTime").GetValue<Slider>().Value);
float reactionDistance = Config.Menu.Item("misc.enemyReactionTime").GetValue<Slider>().Value + (additionalReactionTime? Config.Menu.Item("misc.additionalReactionTime").GetValue<Slider>().Value : 0) * enemy.MoveSpeed*0.001f;
if (PredPos.Distance(enemy) > reactionDistance)
{
PredPos = enemy.Position.Extend(PredPos.To3D(), reactionDistance).To2D();
}
return true;
}
示例7: quickscope
//Quickscope : Attempt to cast QE quickcombo to target position, pos : target position (use correctThisPos for optimal results), targettarget (1hp required) : the initial barrel to use, if the target barrel is within E range and distance to player is greater than 500 (avoid long backward walking) it will move to it before casting the combo
public static void quickscope(BarrelsManager.Barrel target, Vector2 pos)
{
bool canconnect = false;
bool shouldmove = false;
bool inposition = false;
bool done = false;
//Verify if the wanted position is within range
if (Program.Player.Position.Distance(pos.To3D()) < Program.E.Range)
{
canconnect = true;
}
else
{
canconnect = false;
}
//Verify if we should move in order to get the combo
if ((Program.Player.Distance(target.barrel) > 610 && Program.Player.Distance(target.barrel) < 1000) || (Program.Player.Distance(target.barrel) < 590 && Program.Player.Distance(target.barrel) > 500))
shouldmove = true;
else if (Program.Player.Distance(target.barrel) >= 590 && Program.Player.Distance(target.barrel) <= 610)
{
shouldmove = false;
inposition = true;
}
else
shouldmove = false;
//If requirements are K we move
if (shouldmove && canconnect)
{
Vector3 position = Program.Player.Position;
double vX = position.X - target.barrel.Position.X;
double vY = position.Y - target.barrel.Position.Y;
double magV = Math.Sqrt(vX * vX + vY * vY);
double aX = Math.Round(target.barrel.Position.X + vX / magV * 600);
double aY = Math.Round(target.barrel.Position.Y + vY / magV * 600);
Vector2 newPosition = new Vector2(Convert.ToInt32(aX), Convert.ToInt32(aY));
if (position.Distance(target.barrel.Position) - 580 >= 50) //If correction is far from hero
Program.Player.IssueOrder(GameObjectOrder.MoveTo, newPosition.To3D());
else //If correction is within hero hitbox (wont move cauz distance too small)
{
Program.Player.IssueOrder(GameObjectOrder.MoveTo, new Vector2(Program.Player.Position.X - 200, Program.Player.Position.Y - 200).To3D());
Utility.DelayAction.Add(50, () => Program.Player.IssueOrder(GameObjectOrder.MoveTo, newPosition.To3D()));
}
}
//If all is K we quickscope
if (inposition && target.barrel.Health == 1 && !done)
{
Program.Q.CastOnUnit(target.barrel);
Program.E.Cast(pos);
done = true;
}
}
示例8: Insec
public static void Insec(Obj_AI_Hero target)
{
Rpos = Player.Position.To2D().Extend(target.Position.To2D(), Player.Distance(target) + 250);
if (Rpos.Distance(Player.Position) <= R.Range)
{
if (Player.Distance(Rpos.Extend(target.Position.To2D(), 700 - target.Distance(Rpos))) < E.Range && !IsWall(Rpos.To3D()) && target.IsFacing(Player))
{
R.Cast(Rpos);
}
}
}
示例9: PutWard
public static bool PutWard(Vector2 pos)
{
//Loop through inventory and place down whatever wards you have. Taken from Lee Sin scripts
int wardItem;
if ((wardItem = GetWardId()) != -1)
{
foreach (var slot in ObjectManager.Player.InventoryItems.Where(slot => slot.Id == (ItemId)wardItem))
{
Items.UseItem(wardItem, pos.To3D());
return true;
}
}
return false;
}
示例10: putWard
public static bool putWard(Vector2 pos)
{
int wardItem;
if ((wardItem = getJumpWardId()) != -1)
{
foreach (var slot in Player.InventoryItems.Where(slot => slot.Id == (ItemId) wardItem))
{
if (lastward < Environment.TickCount)
{
ObjectManager.Player.Spellbook.CastSpell(slot.SpellSlot, pos.To3D());
lastward = Environment.TickCount + 2000;
return true;
}
return false;
}
}
return false;
}
示例11: PassivePosition
public static Vector3 PassivePosition(Obj_AI_Base target)
{
var passive = FioraPassiveObjects.FirstOrDefault(x => x.Position.Distance(target.Position) <= 50);
var position = Prediction.Position.PredictUnitPosition(target, 250);
if (passive == null) return new Vector3();
if (passive.Name.Contains("NE"))
{
var pos = new Vector2
{
X = position.X,
Y = position.Y + 150
};
return pos.To3D();
}
if (passive.Name.Contains("SE"))
{
var pos = new Vector2
{
X = position.X - 150,
Y = position.Y
};
return pos.To3D();
}
if (passive.Name.Contains("NW"))
{
var pos = new Vector2
{
X = position.X + 150,
Y = position.Y
};
return pos.To3D();
}
if (passive.Name.Contains("SW"))
{
var pos = new Vector2
{
X = position.X,
Y = position.Y - 150
};
return pos.To3D();
}
return new Vector3();
}
示例12: MoveTo
public static void MoveTo(Vector2 movePos)
{
if (!Situation.ShouldDodge())
{
return;
}
Evade.lastEvadeCommand = new EvadeCommand
{
order = EvadeOrderCommand.MoveTo,
targetPosition = movePos,
timestamp = EvadeUtils.TickCount,
isProcessed = false
};
Evade.lastMoveToPosition = movePos;
Evade.lastMoveToServerPos = myHero.ServerPosition.To2D();
myHero.IssueOrder(GameObjectOrder.MoveTo, movePos.To3D(), false);
}
示例13: Condemn360
public static void Condemn360(Obj_AI_Hero hero, Vector2 pos = new Vector2())
{
if (hero.HasBuffOfType(BuffType.SpellImmunity) || hero.HasBuffOfType(BuffType.SpellShield) ||
LastCheck + 50 > Environment.TickCount || ObjectManager.Player.IsDashing())
{
return;
}
var prediction = VayneSpells.E.GetPrediction(hero);
var predictionsList = pos.IsValid() ? new List<Vector3>() { pos.To3D() } : new List<Vector3>
{
hero.ServerPosition,
hero.Position,
prediction.CastPosition,
prediction.UnitPosition
};
var wallsFound = 0;
Points = new List<Vector2>();
foreach (var position in predictionsList)
{
for (var i = 0; i < PushDistance; i += (int)hero.BoundingRadius) // 420 = push distance
{
var cPos = ObjectManager.Player.Position.Extend(position, ObjectManager.Player.Distance(position) + i).To2D();
Points.Add(cPos);
if (NavMesh.GetCollisionFlags(cPos.To3D()).HasFlag(CollisionFlags.Wall) || NavMesh.GetCollisionFlags(cPos.To3D()).HasFlag(CollisionFlags.Building))
{
wallsFound++;
break;
}
}
}
if ((wallsFound / predictionsList.Count) >= 33 / 100f)
{
VayneSpells.E.Cast(hero);
}
}
示例14: PutWard
public static void PutWard(Vector2 pos, ItemId warditem)
{
foreach (var slot in Player.InventoryItems.Where(slot => slot.Id == warditem))
{
ObjectManager.Player.Spellbook.CastSpell(slot.SpellSlot, pos.To3D());
return;
}
}
示例15: PassiveRadiusPoint
public static List<Vector3> PassiveRadiusPoint(Obj_AI_Base target)
{
var passive = FioraPassiveObjects.FirstOrDefault(x => x.Position.Distance(target.Position) <= 50);
var position = Prediction.Position.PredictUnitPosition(target, 250);
if (passive == null) return new List<Vector3>();
if (passive.Name.Contains("NE"))
{
var pos1 = new Vector2
{
X = position.X + 150/(float) Math.Sqrt(2),
Y = position.Y + 150/(float) Math.Sqrt(2)
};
var pos2 = new Vector2
{
X = position.X - 150/(float) Math.Sqrt(2),
Y = position.Y + 150/(float) Math.Sqrt(2)
};
return new List<Vector3>() { pos1.To3D(), pos2.To3D() };
}
if (passive.Name.Contains("SE"))
{
var pos1 = new Vector2
{
X = position.X - 150/(float) Math.Sqrt(2),
Y = position.Y - 150/(float) Math.Sqrt(2)
};
var pos2 = new Vector2
{
X = position.X - 150/(float) Math.Sqrt(2),
Y = position.Y + 150/(float) Math.Sqrt(2)
};
return new List<Vector3>() { pos1.To3D(), pos2.To3D() };
}
if (passive.Name.Contains("NW"))
{
var pos1 = new Vector2
{
X = position.X + 150/(float) Math.Sqrt(2),
Y = position.Y - 150/(float) Math.Sqrt(2)
};
var pos2 = new Vector2
{
X = position.X + 150/(float) Math.Sqrt(2),
Y = position.Y + 150/(float) Math.Sqrt(2)
};
return new List<Vector3>() { pos1.To3D(), pos2.To3D() };
}
if (passive.Name.Contains("SW"))
{
var pos1 = new Vector2
{
X = position.X + 150/(float) Math.Sqrt(2),
Y = position.Y - 150/(float) Math.Sqrt(2)
};
var pos2 = new Vector2
{
X = position.X - 150/(float) Math.Sqrt(2),
Y = position.Y - 150/(float) Math.Sqrt(2)
};
return new List<Vector3>() { pos1.To3D(), pos2.To3D() };
}
return new List<Vector3>();
}