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


C# GameObject.GetType方法代码示例

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


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

示例1: GameObject_OnCreate

        private static void GameObject_OnCreate(GameObject sender, EventArgs args)
        {
            if (!sender.IsValid || !sender.Name.Contains("Baron"))
                return;

            if (sender.Name.Contains("Minion") || sender.Name.Contains("_Turret_Cas.troy") || sender.Name.Contains("SRU") || sender.GetType().Name == "MissileClient" || sender.Name.Contains("FeelNoPain") || sender.Name.Contains("crystal_beam"))
                return;

            Console.WriteLine("Add\tType: {0} | Name: {1} | NetID: {2} | objectName: {3}", sender.GetType().Name, sender.Name, sender.NetworkId, sender.BaseObjectName());
        }
开发者ID:SuperNova911,项目名称:EloBuddy,代码行数:10,代码来源:Debug.cs

示例2: OnTouch

 internal override void OnTouch(GameObject touchedObject)
 {
     if (touchedObject.GetType() == typeof(Marimo) && Marimo.IsStarMario((Marimo)touchedObject))
     {
         UpsideDownDeath();
     }
     else if (touchedObject.GetType() == typeof(Shell) && Shell.ShellIsMoving((Shell)touchedObject))
     {
         UpsideDownDeath();
     }
 }
开发者ID:Exor,项目名称:SuperMarimoBros,代码行数:11,代码来源:Beetle.cs

示例3: GameObject_OnDelete

        private static void GameObject_OnDelete(GameObject sender, EventArgs args)
        {
            if (!sender.IsValid || !sender.Name.Contains("Baron"))
                return;

            if (sender.Name.Contains("NAV") || sender.Name.Contains("Odin") || sender.Name.Contains("Shopkeeper") ||
                sender.GetType().Name == "MissileClient" || sender.GetType().Name == "DrawFX" || sender.Name.Contains("empty.troy") || sender.Name.Contains("LevelProp")
                 || sender.Name.Contains("FeelNoPain") || sender.Name.Contains("LaserSight") || sender.Name.Contains("SRU"))
                return;

            Console.WriteLine("Delete\tType: {0} | Name: {1}", sender.GetType().Name, sender.Name);
        }
开发者ID:SuperNova911,项目名称:Dev,代码行数:12,代码来源:Debug.cs

示例4: OnCreateObj_FizzMarinerDoom

        private static void OnCreateObj_FizzMarinerDoom(GameObject obj, EventArgs args, SpellData spellData)
        {
            if (obj.GetType() != typeof(MissileClient) || !((MissileClient) obj).IsValidMissile())
                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:lolgamers55,项目名称:EloBuddy.Addons,代码行数:28,代码来源:Fizz.cs

示例5: OnTouch

 internal override void OnTouch(GameObject touchedObject)
 {
     if (touchedObject.GetType().Name == "Fireball")
     {
         UpsideDownDeath();
         FireballExplode((Fireball)touchedObject);
     }
     else if (touchedObject.GetType() == typeof(Marimo) && Marimo.IsStarMario((Marimo)touchedObject))
     {
         UpsideDownDeath();
     }
     else if (touchedObject.GetType().Name == "Shell" && Shell.ShellIsMoving((Shell)touchedObject))
     {
         UpsideDownDeath();
     }
 }
开发者ID:Exor,项目名称:SuperMarimoBros,代码行数:16,代码来源:Enemy.cs

示例6: validateCase

 //------------------------------------------------------------------------------------------------------------------------
 //                                                        validateCase()
 //------------------------------------------------------------------------------------------------------------------------
 private void validateCase(GameObject gameObject)
 {
     MethodInfo info = gameObject.GetType().GetMethod("Update", BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance | BindingFlags.IgnoreCase);
     if (info != null) {
         throw new Exception("'Update' function was not binded for '" + gameObject + "'. Please check it's case. (capital U?)");
     }
 }
开发者ID:mtesseracttech,项目名称:ArcadeGame,代码行数:10,代码来源:UpdateManager.cs

示例7: OnCreate

 private static void OnCreate(GameObject sender, EventArgs args)
 {
     #if DEBUG
     Console.WriteLine("Type: {0} | Name: {1}", sender.GetType().Name, sender.Name);
     #endif
     foreach (var avoidObject in ObjectDatabase.AvoidObjects)
     {
         var baseObject = sender as Obj_AI_Base;
         var objectName = baseObject == null ? sender.Name : baseObject.BaseSkinName;
         if (avoidObject.ObjectName == objectName)
         {
     #if !DEBUG
             if (!string.IsNullOrWhiteSpace(avoidObject.BuffName) && !sender.IsEnemy)
             {
                 continue;
             }
     #endif
             // Fire the event
             if (OnAvoidObjectAdded != null)
             {
                 OnAvoidObjectAdded(sender, avoidObject);
             }
             break;
         }
     }
 }
开发者ID:a544243739,项目名称:LeagueSharp,代码行数:26,代码来源:ObjectDetector.cs

示例8: CheckType

        public static string CheckType(GameObject obj)
        {
            if (obj.GetType() == typeof(BulletBill))
            {
                return "BulletBill";
            }
            if (obj.GetType() == typeof(Goomba))
            {
                return "Goomba";
            }
            if (obj.GetType() == typeof(KoopaGreen))
            {
                return "KoopaGreen";
            }

            return "GameObject";
        }
开发者ID:Kilst,项目名称:SpaceInvaders,代码行数:17,代码来源:CastTypeHelper.cs

示例9: OnTouch

 internal override void OnTouch(GameObject touchedObject)
 {
     if (touchedObject.GetType().Name == "Marimo")
     {
         shouldRemove = true;
         Player.AddPoints(points);
     }
 }
开发者ID:Exor,项目名称:SuperMarimoBros,代码行数:8,代码来源:FireFlower.cs

示例10: OnSideCollision

 public override void OnSideCollision(GameObject touchedObject)
 {
     if (touchedObject.GetType().Namespace == "SuperMarimoBros.Blocks")
     {
         Explode();
     }
     base.OnSideCollision(touchedObject);
 }
开发者ID:Exor,项目名称:SuperMarimoBros,代码行数:8,代码来源:Fireball.cs

示例11: OnHeadbutt

 public override void OnHeadbutt(GameObject touchedObject)
 {
     if (touchedObject.GetType() == typeof(Marimo))
     {
         this.shouldRemove = true;
         World.AddObject(new Shell(position, false));
     }
     base.OnHeadbutt(touchedObject);
 }
开发者ID:Exor,项目名称:SuperMarimoBros,代码行数:9,代码来源:Beetle.cs

示例12: OnSideCollision

 public override void OnSideCollision(GameObject touchedObject)
 {
     if (touchedObject.GetType().Name == "Marimo")
     {
         Kick(touchedObject);
     }
     else
         base.OnSideCollision(touchedObject);
 }
开发者ID:Exor,项目名称:SuperMarimoBros,代码行数:9,代码来源:Shell.cs

示例13: OnHeadbutt

 public override void OnHeadbutt(GameObject touchedObject)
 {
     if (touchedObject.GetType().Name == "Marimo")
     {
         wasStomped = true;
         Player.AddPoints(points);
     }
     base.OnHeadbutt(touchedObject);
 }
开发者ID:Exor,项目名称:SuperMarimoBros,代码行数:9,代码来源:Goomba.cs

示例14: OnTouch

 internal override void OnTouch(GameObject touchedObject)
 {
     if (touchedObject.GetType() == typeof(Marimo))
     {
         Player.AddCoin();
         shouldRemove = true;
     }
     base.OnTouch(touchedObject);
 }
开发者ID:Exor,项目名称:SuperMarimoBros,代码行数:9,代码来源:Coin.cs

示例15: OnStomp

        public override void OnStomp(GameObject touchedObject)
        {
            if (touchedObject.GetType().Namespace == "SuperMarimoBros.Blocks")
            {
                velocity.Y = -150f;
            }

            base.OnStomp(touchedObject);
            isOnSolidTile = false;
        }
开发者ID:Exor,项目名称:SuperMarimoBros,代码行数:10,代码来源:Fireball.cs


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