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


C# GameObject.IsValid方法代码示例

本文整理汇总了C#中GameObject.IsValid方法的典型用法代码示例。如果您正苦于以下问题:C# GameObject.IsValid方法的具体用法?C# GameObject.IsValid怎么用?C# GameObject.IsValid使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在GameObject的用法示例。


在下文中一共展示了GameObject.IsValid方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: RangeAttackOnCreate

        private void RangeAttackOnCreate(GameObject sender, EventArgs args)
        {
            if (!sender.IsValid<Obj_SpellMissile>())
            {
                return;
            }

            var missile = (Obj_SpellMissile) sender;

            // Caster ally hero / not me
            if (!missile.SpellCaster.IsValid<Obj_AI_Hero>() || !missile.SpellCaster.IsAlly || missile.SpellCaster.IsMe ||
                missile.SpellCaster.IsMelee())
            {
                return;
            }

            // Target enemy hero
            if (!missile.Target.IsValid<Obj_AI_Hero>() || !missile.Target.IsEnemy)
            {
                return;
            }

            var caster = (Obj_AI_Hero) missile.SpellCaster;

            if (E.IsReady() && E.IsInRange(missile.SpellCaster) && ConfigValue<bool>("Misc.E.AA." + caster.ChampionName))
            {
                E.Cast(caster); // add delay
            }
        }
开发者ID:ChewyMoon,项目名称:Experimental,代码行数:29,代码来源:Nami.cs

示例2: OnCreateObj_FizzMarinerDoom

        private static void OnCreateObj_FizzMarinerDoom(GameObject obj, EventArgs args, SpellData spellData)
        {
            if (!obj.IsValid<MissileClient>())
                return;

            MissileClient missile = (MissileClient)obj;

            if (missile.SpellCaster != null && missile.SpellCaster.Team != ObjectManager.Player.Team &&
                missile.SData.Name == "FizzMarinerDoomMissile")
            {
                SpellDetector.CreateSpellData(missile.SpellCaster, missile.StartPosition, missile.EndPosition,
                spellData, null, 500, true, SpellType.Circular, false, spellData.secondaryRadius);

                /*foreach (KeyValuePair<int, Spell> entry in SpellDetector.spells)
                {
                    var spell = entry.Value;

                    if (spell.info.spellName == "FizzMarinerDoom" &&
                        spell.spellObject != null && spell.spellObject.NetworkId == missile.NetworkId)
                    {
                        if (spell.spellType == SpellType.Circular)
                        {                            
                            spell.spellObject = null;
                        }
                    }
                }*/
            }
        }
开发者ID:aikoy,项目名称:ezEvade,代码行数:28,代码来源:Fizz.cs

示例3: ObjMissileClientOnCreate

 private static void ObjMissileClientOnCreate(GameObject sender, EventArgs args)
 {
     if (!sender.IsValid<MissileClient>())
     {
         return;
     }
     var missile = (MissileClient) sender;
     if (!missile.SpellCaster.IsValid<Obj_AI_Hero>() || missile.SpellCaster.Team == ObjectManager.Player.Team)
     {
         return;
     }
     var unit = (Obj_AI_Hero) missile.SpellCaster;
     var spellData = SpellDatabase.GetByMissileName(missile.SData.Name);
     if (spellData == null)
     {
         return;
     }
     var missilePosition = missile.Position.To2D();
     var unitPosition = missile.StartPosition.To2D();
     var endPos = missile.EndPosition.To2D();
     var direction = (endPos - unitPosition).Normalized();
     if (unitPosition.Distance(endPos) > spellData.Range || spellData.FixedRange)
     {
         endPos = unitPosition + direction * spellData.Range;
     }
     if (spellData.ExtraRange != -1)
     {
         endPos = endPos +
                  Math.Min(spellData.ExtraRange, spellData.Range - endPos.Distance(unitPosition)) * direction;
     }
     var castTime = Utils.GameTimeTickCount - Game.Ping / 2 - (spellData.MissileDelayed ? 0 : spellData.Delay) -
                    (int) (1000 * missilePosition.Distance(unitPosition) / spellData.MissileSpeed);
     TriggerOnDetectSkillshot(DetectionType.RecvPacket, spellData, castTime, unitPosition, endPos, unit);
 }
开发者ID:HeheheM,项目名称:LeagueSharp-25,代码行数:34,代码来源:SkillshotDetector.cs

示例4: GameObject_OnCreate

        static void GameObject_OnCreate(GameObject obj, EventArgs args)
        {
            if (obj.IsValid<MissileClient>())
                return;

            foreach (var troy in Gametroy.Objects)
            {
                if (obj.Name.Contains(troy.Name) && obj.IsValid<GameObject>())
                {
                    troy.Obj = obj;
                    troy.Start = Utils.GameTimeTickCount;

                    if (!troy.Included)
                         troy.Included = Essentials.HeroInGame(troy.Owner);
                }
            }
        }
开发者ID:CONANLXF,项目名称:AIO,代码行数:17,代码来源:Gametroys.cs

示例5: OnObjCreate

 private void OnObjCreate(GameObject sender, System.EventArgs args)
 {
     if (sender.IsValid<Obj_AI_Minion>() 
         && sender.IsAlly 
         && sender.Name.Equals("ThreshLantern", StringComparison.OrdinalIgnoreCase))
     {
         LanternObject = sender;
     }
 }
开发者ID:DZ191,项目名称:LeagueSharp,代码行数:9,代码来源:ThreshLanternCatcher.cs

示例6: GameObject_OnCreate

        /// <summary>
        ///     Handles the OnCreate event of the GameObject class.
        /// </summary>
        /// <param name="sender">
        ///     The sender.
        /// </param>
        /// <param name="args">
        ///     The <see cref="EventArgs" /> instance containing the event data.
        /// </param>
        private static void GameObject_OnCreate(GameObject sender, EventArgs args)
        {
            if (!sender.IsAlly || !sender.IsValid<Obj_AI_Base>())
            {
                return;
            }

            var obj = (Obj_AI_Base)sender;

            if (obj.CharData.BaseSkinName.Equals("syndrasphere"))
            {
                Orbs.Add(obj);
            }
        }
开发者ID:seniseviy,项目名称:League-Sharp,代码行数:23,代码来源:OrbManager.cs

示例7: SpellMissile_OnCreate

        private void SpellMissile_OnCreate(GameObject obj, EventArgs args)
        {
            if (!obj.IsValid<Obj_SpellMissile>())
                return;

            Obj_SpellMissile missile = (Obj_SpellMissile)obj;
            SpellData spellData;

            if (missile.SpellCaster != null && missile.SpellCaster.Team != myHero.Team &&
                missile.SData.Name != null && onMissileSpells.TryGetValue(missile.SData.Name, out spellData)
                && missile.StartPosition != null && missile.EndPosition != null)
            {
                if (missile.StartPosition.Distance(myHero.Position) < spellData.range + 1000)
                {
                    var hero = missile.SpellCaster;

                    if (hero.IsVisible)
                    {
                        if (spellData.usePackets)
                        {
                            CreateSpellData(hero, missile.StartPosition, missile.EndPosition, spellData, obj);
                            return;
                        }


                        foreach (KeyValuePair<int, Spell> entry in spells)
                        {
                            Spell spell = entry.Value;

                            if (spell.info.missileName == missile.SData.Name
                                && spell.heroID == missile.SpellCaster.NetworkId)
                            {
                                if (spell.info.isThreeWay == false && spell.info.isSpecial == false)
                                {
                                    spell.spellObject = obj;
                                    //Game.PrintChat("aquired: " + (obj.Position.To2D().Distance(spell.startPos)));
                                }
                            }
                        }
                    }
                    else
                    {
                        if (Evade.menu.SubMenu("Main").Item("DodgeFOWSpells").GetValue<bool>())
                        {
                            CreateSpellData(hero, missile.StartPosition, missile.EndPosition, spellData, obj);
                        }
                    }
                }
            }
        }
开发者ID:qktlfflzk,项目名称:Backup5.4,代码行数:50,代码来源:SpellDetector.cs

示例8: GameObject_OnCreate

        static void GameObject_OnCreate(GameObject obj, EventArgs args)
        {
            foreach (var troy in Troy.Troys)
            {
                if (obj.Name.Contains(troy.Name) && obj.IsValid<GameObject>())
                {
                    troy.Obj = obj;
                    troy.Start = Utils.GameTimeTickCount;

                    if (!troy.Included)
                         troy.Included = true;
                }
            }
        }
开发者ID:kuro1915,项目名称:KurisuSolutions,代码行数:14,代码来源:Troys.cs

示例9: Obj_SpellMissile_OnDelete

        private void Obj_SpellMissile_OnDelete(GameObject sender, EventArgs args)
        {
            if (sender.IsEnemy || sender.Type != GameObjectType.MissileClient || !sender.IsValid<MissileClient>())
                return;

            MissileClient missile = (MissileClient)sender;

            if ( missile.SData.Name != null)
            {
                if(missile.SData.Name == "AhriOrbReturn")
                    QMissile = null;
                if (missile.SData.Name == "AhriSeduceMissile")
                    EMissile = null;
            }
        }
开发者ID:MrWenzoxfs,项目名称:elobuddy,代码行数:15,代码来源:Ahri.cs

示例10: SpellMissile_OnCreateOld

        private void SpellMissile_OnCreateOld(GameObject sender, EventArgs args)
        {
            if (sender.IsEnemy || sender.Type != GameObjectType.MissileClient || !sender.IsValid<MissileClient>())
                return;

            MissileClient missile = (MissileClient)sender;

            if (missile.SData.Name != null)
            {
                if (missile.SData.Name == MissileName || missile.SData.Name == MissileReturnName)
                {
                    Missile = missile;
                }
            }
        }
开发者ID:MrWenzoxfs,项目名称:elobuddy,代码行数:15,代码来源:MissileReturn.cs

示例11: OnDeleteObj_FizzMarinerDoom

        private static void OnDeleteObj_FizzMarinerDoom(GameObject obj, EventArgs args, SpellData spellData)
        {
            //need to track where bait is attached to

            if (!obj.IsValid<MissileClient>())
                return;

            MissileClient missile = (MissileClient)obj;

            if (missile.SpellCaster != null && missile.SpellCaster.Team != ObjectManager.Player.Team &&
                missile.SData.Name == "FizzMarinerDoomMissile")
            {
                SpellDetector.CreateSpellData(missile.SpellCaster, missile.StartPosition, missile.EndPosition,
                spellData, null, 1000, true, SpellType.Circular, false, 350);
            }
        }
开发者ID:aikoy,项目名称:ezEvade,代码行数:16,代码来源:Fizz.cs

示例12: GameObject_OnDelete

        static void GameObject_OnDelete(GameObject obj, EventArgs args)
        {
            if (obj.IsValid<MissileClient>())
                return;

            foreach (var troy in Gametroy.Objects)
            {
                if (obj.Name.Contains(troy.Name))
                {
                    troy.Obj = null;
                    troy.Start = 0;
                    troy.Limiter = 0; // reset limiter

                    if (troy.Included)
                        troy.Included = false;
                }
            }
        }
开发者ID:CONANLXF,项目名称:AIO,代码行数:18,代码来源:Gametroys.cs

示例13: ObjMissileClientOnCreate

 private static void ObjMissileClientOnCreate(GameObject sender, EventArgs args)
 {
     if (!sender.IsValid<MissileClient>())
     {
         return;
     }
     var missile = (MissileClient) sender;
     if (!missile.SpellCaster.IsValid<Obj_AI_Hero>() || missile.SpellCaster.Team == ObjectManager.Player.Team)
     {
         return;
     }
     var spellData = SpellDatabase.GetByMissileName(missile.SData.Name);
     if (spellData == null)
     {
         return;
     }
     Utility.DelayAction.Add(0, () => ObjMissileClientOnCreateDelayed(missile, spellData));
 }
开发者ID:WTayllor,项目名称:LeagueSharp-6,代码行数:18,代码来源:SkillshotDetector.cs

示例14: RangeAttackOnCreate

        private void RangeAttackOnCreate(GameObject sender, EventArgs args)
        {
            if (!sender.IsValid<Obj_SpellMissile>())
                return;

            var missile = (Obj_SpellMissile) sender;

            // Caster ally hero / not me
            if (!missile.SpellCaster.IsValid<Obj_AI_Hero>() || !missile.SpellCaster.IsAlly ||
                missile.SpellCaster.IsMe || !missile.SpellCaster.IsHeroType(HeroType.Ad) ||
                missile.SpellCaster.IsMelee())
                return;

            // Target enemy hero
            if (!missile.Target.IsValid<Obj_AI_Hero>() || !missile.Target.IsEnemy)
                return;

            if (E.IsReady() && E.IsInRange(missile.SpellCaster) && ConfigValue<bool>("MiscE"))
            {
                E.CastOnUnit(missile.SpellCaster, UsePackets);
            }
        }
开发者ID:CupidL0ve,项目名称:LeagueSharp,代码行数:22,代码来源:Nami.cs

示例15: OnCreateObj_ViktorDeathRay3

        private static void OnCreateObj_ViktorDeathRay3(GameObject obj, EventArgs args)
        {
            if (!obj.IsValid<MissileClient>())
                return;

            MissileClient missile = (MissileClient)obj;

            SpellData spellData;

            if (missile.SpellCaster != null && missile.SpellCaster.Team != ObjectManager.Player.Team &&
                missile.SData.Name != null && missile.SData.Name == "viktoreaugmissile"
                && SpellDetector.onMissileSpells.TryGetValue("ViktorDeathRay3", out spellData)
                && missile.StartPosition != null && missile.EndPosition != null)
            {
                var missileDist = missile.EndPosition.To2D().Distance(missile.StartPosition.To2D());
                var delay = missileDist / 1.5f + 600;

                spellData.spellDelay = delay;

                SpellDetector.CreateSpellData(missile.SpellCaster, missile.StartPosition, missile.EndPosition, spellData);
            }
        }
开发者ID:joduskarne,项目名称:EloBuddyAddons,代码行数:22,代码来源:Viktor.cs


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