本文整理汇总了C#中GameObject.Distance方法的典型用法代码示例。如果您正苦于以下问题:C# GameObject.Distance方法的具体用法?C# GameObject.Distance怎么用?C# GameObject.Distance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GameObject
的用法示例。
在下文中一共展示了GameObject.Distance方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GameObject_OnCreate
private static void GameObject_OnCreate(GameObject sender, EventArgs args)
{
if (sender.IsAlly && sender is Obj_AI_Base && sender.Name.ToLower().Contains("ward") && sender.Distance(_Player) < 600 && _jumpPos.Distance(sender) < 200 && WardjumpActive)
{
Program.W.Cast((Obj_AI_Base) sender);
}
}
示例2: GetRHits
public static int GetRHits(this Vector2 castPosition, GameObject targetEnemy)
{
var positions =
EntityManager.Heroes.Enemies.Where(hero => !hero.IsDead && hero.IsValidTarget(SpellManager.R.Range))
.Select(hero => Prediction.Position.PredictUnitPosition(hero, 1000).To3D())
.ToList();
return targetEnemy.Distance(castPosition) > SpellManager.R.Range
? 0
: positions.Count(enemyPos => castPosition.Distance(enemyPos) <= SpellManager.R.Radius);
}
示例3: OnDeleteObject
public override void OnDeleteObject(GameObject obj)
{
if (Missile != null && MissileDeleted && !string.IsNullOrEmpty(SpellData.ToggleParticleName))
{
var r = new Regex(SpellData.ToggleParticleName);
if (r.Match(obj.Name).Success && obj.Distance(Position, true) <= 100*100)
{
IsValid = false;
}
}
}
示例4: OnCreateObject
public override void OnCreateObject(GameObject obj)
{
var minion = obj as Obj_AI_Minion;
if (SpawnObject == null && minion != null)
{
if (minion.BaseSkinName == SpellData.MissileSpellName)
{
// Force skillshot to be removed
IsValid = false;
}
}
if (SpawnObject != null)
{
if (Utils.GetGameObjectName(obj) == SpellData.ToggleParticleName &&
obj.Distance(SpawnObject, true) <= 300.Pow())
{
IsValid = false;
}
}
}
示例5: AddReticleToAxe
private static void AddReticleToAxe(GameObject obj)
{
var a = Axes.Where(m => m.MissileIsValid && m.Reticle == null).OrderBy(m => obj.Distance(m.Missile.EndPosition, true)).FirstOrDefault();
if (a != null)
{
a.AddReticle(obj);
}
}
示例6: OnCreateObj
private void OnCreateObj(GameObject obj, EventArgs args)
{
if (obj.Name != "missile" && obj.IsEnemy && obj.Distance(ObjectManager.Player.ServerPosition) < 900)
{
//J4 wall E
if (obj.Name.ToLower() == "jarvanivwall")
{
var enemyJ4 = ValidTargets.First(h => h.CharData.BaseSkinName.Contains("Jarvan"));
if (enemyJ4 != null && enemyJ4.LSIsValidTarget())
E.Cast(enemyJ4.ServerPosition);
}
/*if (obj.Name.ToLower().Contains("soraka_base_e_rune.troy") && EntityManager.Heroes.Enemies.Count(e => e.IsHPBarRendered && e.Distance(obj.Position) < 300) > 0)
{
Q.Cast(obj.Position);
}*/
if (EntityManager.Heroes.Allies.All(h => h.CharData.BaseSkinName != "Rengar"))
{
if (obj.Name == "Rengar_LeapSound.troy")
{
E.Cast(obj.Position);
}
if (obj.Name == "Rengar_Base_P_Buf_Max.troy" || obj.Name == "Rengar_Base_P_Leap_Grass.troy")
{
E.Cast(ObjectManager.Player.ServerPosition);
}
}
}
}
示例7: OnCreateObj
private void OnCreateObj(GameObject obj, EventArgs args)
{
if (obj.Name != "missile" && obj.IsEnemy && obj.Distance(ObjectManager.Player.ServerPosition) < 900)
{
//J4 wall E
if (obj.Name.ToLower() == "jarvanivwall")
{
var enemyJ4 = ValidTargets.First(h => h.CharData.BaseSkinName.Contains("Jarvan"));
if (enemyJ4 != null && enemyJ4.IsValidTarget())
this.CastE(enemyJ4.ServerPosition);
}
/*if (obj.Name.ToLower().Contains("soraka_base_e_rune.troy") &&
GameObjects.EnemyHeroes.Count(e => e.IsHPBarRendered && e.Distance(obj.Position) < 200) > 0)
{
this.Q.Cast(obj.Position);
}*/
var rengo = GameObjects.EnemyHeroes.FirstOrDefault(e => e.CharData.BaseSkinName == "Rengar");
if (rengo != null)
{
//rengar ult
if (obj.Name == "Rengar_LeapSound.troy")
{
CastE(obj.Position);
}
//rengar passive brush jump (atm the object pos is the brush where it came from so
// we're just gonna assume he's gonna jump on us)
if (obj.Position.Distance(ObjectManager.Player.Position) < 725 && (obj.Name == "Rengar_Base_P_Buf_Max.troy" || obj.Name == "Rengar_Base_P_Leap_Grass.troy"))
{
CastE(ObjectManager.Player.ServerPosition);
}
}
}
}
示例8: GameObject_OnCreate
public static void GameObject_OnCreate(GameObject sender, System.EventArgs args)
{
if (sender != null && SpellsManager.W1 && W.IsReady() && sender.Distance(user) <= W.Range && SpellsManager.Wtimer > 1000 && !sender.IsDead && sender.IsAlly && SpellsManager.W1
&& sender.isWard() && W.IsInRange((Obj_AI_Minion)sender) && (RMenu.keybind("bubba") || JumperMenu.keybind("normal") || MiscMenu.keybind("wardjump")))
{
SpellsManager.W((Obj_AI_Base)sender, true);
WardJump.lastward = Core.GameTickCount;
}
}
示例9: Obj_AI_Base_OnDelete
private static void Obj_AI_Base_OnDelete(GameObject sender, EventArgs args)
{
if (sender.Name == "Zed_Base_Clone_idle.troy")
{
if (wClone != null && sender.Distance(wClone) <= 25 || (Environment.TickCount - wTick) >= 4500)
wClone = null;
if (rClone != null && sender.Distance(rClone) <= 25 || (Environment.TickCount - rTick) >= 7500)
{
rClone = null;
rTarg = null;
combo = 0;
}
}
}
示例10: GameObject_OnCreate
private static void GameObject_OnCreate(GameObject sender, EventArgs args)
{
if (sender.IsAlly && sender is Obj_Ward && sender.Distance(_Player) < 600 && _jumpPos.Distance(sender) < 200 && WardjumpActive)
{
Program.W.Cast((Obj_Ward) sender);
}
}