本文整理汇总了C#中System.Vector2.Perpendicular方法的典型用法代码示例。如果您正苦于以下问题:C# Vector2.Perpendicular方法的具体用法?C# Vector2.Perpendicular怎么用?C# Vector2.Perpendicular使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Vector2
的用法示例。
在下文中一共展示了Vector2.Perpendicular方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Rectangle
public Rectangle(Vector2 start, Vector2 end, float width)
{
RStart = start;
REnd = end;
Width = width;
Direction = (end - start).Normalized();
Perpendicular = Direction.Perpendicular();
}
示例2: OnSpellHitDetected
public void OnSpellHitDetected(Vector2 direction, Obj_AI_Base target)
{
EvadeData edata;
Vector2 evade_direction = direction.Perpendicular();
Vector2 evade_pos = ObjectManager.Player.ServerPosition.To2D() + evade_direction * EvadeSpell.Range;
bool position_needed = SpecialMethod.HasFlag(EvadeMethods.Dash) || SpecialMethod.HasFlag(EvadeMethods.Blink);
if (position_needed)
{
switch (evade.Item("EVADEMETHOD").GetValue<StringList>().SelectedIndex)
{
case 0: //near turret
CorrectNearTurret(ref evade_pos, evade_direction);
break;
case 1: //less enemies
CorrectLessEnemies(ref evade_pos, evade_direction);
break;
case 2: //both
if (!CorrectLessEnemies(ref evade_pos, evade_direction))
CorrectNearTurret(ref evade_pos, evade_direction);
break;
}
}
edata = new EvadeData
(evade_pos,
ObjectManager.Player.CharData.BaseSkinName == "Morgana" || ObjectManager.Player.CharData.BaseSkinName == "Lissandra",
ObjectManager.Player.CharData.BaseSkinName == "Sivir" || ObjectManager.Player.CharData.BaseSkinName == "Nocturne" || ObjectManager.Player.CharData.BaseSkinName == "Vladimir",
target);
m_evade_queue.Enqueue(edata);
}
示例3: OnSpellHitDetected
public void OnSpellHitDetected(Vector2 direction, Obj_AI_Base target)
{
EvadeData edata;
Vector2 evade_direction = direction.Perpendicular();
Vector2 evade_pos = ObjectManager.Player.ServerPosition.To2D() + direction.Perpendicular() * EvadeSpell.Range;
bool position_needed = !(SpecialMethod.HasFlag(EvadeMethods.MorganaE) || SpecialMethod.HasFlag(EvadeMethods.LissandraR) || SpecialMethod.HasFlag(EvadeMethods.KayleR) || SpecialMethod.HasFlag(EvadeMethods.SivirE) || SpecialMethod.HasFlag(EvadeMethods.NocturneW) || SpecialMethod.HasFlag(EvadeMethods.VladimirW));
if (position_needed)
{
switch (evade.Item("EVADEMETHOD").GetValue<StringList>().SelectedIndex)
{
case 0: //near turret
CorrectNearTurret(ref evade_pos, evade_direction.Perpendicular());
break;
case 1: //less enemies
CorrectLessEnemies(ref evade_pos, evade_direction.Perpendicular());
break;
case 2: //both
if (!CorrectLessEnemies(ref evade_pos, evade_direction.Perpendicular()))
CorrectNearTurret(ref evade_pos, evade_direction.Perpendicular());
break;
}
}
edata = new EvadeData
(evade_pos,
SpecialMethod.HasFlag(EvadeMethods.MorganaE) || SpecialMethod.HasFlag(EvadeMethods.LissandraR) || SpecialMethod.HasFlag(EvadeMethods.KayleR),
SpecialMethod.HasFlag(EvadeMethods.SivirE) || SpecialMethod.HasFlag(EvadeMethods.NocturneW) || SpecialMethod.HasFlag(EvadeMethods.VladimirW),
target);
m_evade_queue.Enqueue(edata);
}
示例4: Line
public Line(Vector2 start, Vector2 direction)
{
Start = start;
Normal = direction.Normal;
_perpendicular = direction.Perpendicular();
}