当前位置: 首页>>代码示例>>C#>>正文


C# GameObject.Distance方法代码示例

本文整理汇总了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);
     }
 }
开发者ID:tingtop747,项目名称:Elobuddy-Addons,代码行数:7,代码来源:WardJumper.cs

示例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);
        }
开发者ID:Enochen,项目名称:EloBuddy,代码行数:11,代码来源:Extensions.cs

示例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;
         }
     }
 }
开发者ID:btr10,项目名称:EloBuddyAddons,代码行数:11,代码来源:CircularMissileSkillshot.cs

示例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;
                }
            }
        }
开发者ID:FireBuddy,项目名称:TheNewYasuo,代码行数:22,代码来源:SummonerMark.cs

示例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);
     }
 }
开发者ID:Real263,项目名称:EloBuddy,代码行数:8,代码来源:AxesManager.cs

示例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);
             }
         }
     }
 }
开发者ID:yashine59fr,项目名称:PortAIO-1,代码行数:28,代码来源:Soraka.cs

示例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);
             }
         }
     }
 }
开发者ID:cttbot,项目名称:LeagueSharp,代码行数:33,代码来源:Soraka.cs

示例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;
     }
 }
开发者ID:FireBuddy,项目名称:kappa-s-aio,代码行数:9,代码来源:LeeSin.cs

示例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;
         }
     }
 }
开发者ID:joeno3,项目名称:EloBuddy,代码行数:14,代码来源:Program.cs

示例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);
     }
 }
开发者ID:ibaddie,项目名称:Elobuddy-Addons,代码行数:7,代码来源:WardJumper.cs


注:本文中的GameObject.Distance方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。