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


C# GameEvents.GetType方法代码示例

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


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

示例1: receiveEvent

 public void receiveEvent(GameEvents.GameEvent e)
 {
     if(e.GetType().Name.Equals("Restart"))
     {
         Application.LoadLevel(2);
     }
     if(e.GetType().Name.Equals("Win"))
     {
         Invoke ("TriggerWin", 3f);
     }
 }
开发者ID:paulkelly,项目名称:pkbitshop,代码行数:11,代码来源:Restarter.cs

示例2: receiveEvent

 public void receiveEvent(GameEvents.GameEvent e)
 {
     if(e.GetType().Name.Equals("EnterRoom"))
     {
         target = ((EnterRoom) e).getNewRoom();
     }
     if(e.GetType ().Name.Equals("CameraShake"))
     {
         jiggleAmt = ((CameraShake) e).getAmount();
         StartCoroutine(jiggleCam2(((CameraShake) e).getDuration()));
     }
 }
开发者ID:paulkelly,项目名称:pkbitshop,代码行数:12,代码来源:CameraFollow.cs

示例3: receiveEvent

 public void receiveEvent(GameEvents.GameEvent e)
 {
     if(e.GetType().Name.Equals("UpdateHud"))
     {
         updateHud();
     }
 }
开发者ID:paulkelly,项目名称:pkbitshop,代码行数:7,代码来源:Hud.cs

示例4: receiveEvent

 public void receiveEvent(GameEvents.GameEvent e)
 {
     if(e.GetType().Name.Equals("CelebrateEvent"))
     {
         confetti.Play();
     }
 }
开发者ID:paulkelly,项目名称:BlowyBalloon,代码行数:7,代码来源:ConfettiCelebration.cs

示例5: receiveEvent

 public void receiveEvent(GameEvents.GameEvent e)
 {
     if(e.GetType().Name.Equals("PassGateEvent"))
     {
         PassGate();
     }
 }
开发者ID:paulkelly,项目名称:BlowyBalloon,代码行数:7,代码来源:ScoreKeeper.cs

示例6: receiveEvent

 public void receiveEvent(GameEvents.GameEvent e)
 {
     if(e.GetType().Name.Equals("CelebrateEvent"))
     {
         GetComponent<BalloonFaceAnim>().Celebrate();
     }
 }
开发者ID:paulkelly,项目名称:BlowyBalloon,代码行数:7,代码来源:BalloonMovement.cs

示例7: receiveEvent

 public void receiveEvent(GameEvents.GameEvent e)
 {
     if(e.GetType().Name.Equals("BackgroundScrollEvent"))
     {
         amountToMoveX += ((BackgroundScrollEvent) e).MoveX;
         amountToMoveY += ((BackgroundScrollEvent) e).MoveY;
     }
 }
开发者ID:paulkelly,项目名称:pkbitshop,代码行数:8,代码来源:BackgroundScroll.cs

示例8: receiveEvent

    public void receiveEvent(GameEvents.GameEvent e)
    {
        string gateExistScreenEventName = "GateExitScreenEvent";

        if(e.GetType().Name.Equals(gateExistScreenEventName))
        {
            AddGateToPool(((GateExitScreenEvent) e).GetGate());
        }
    }
开发者ID:paulkelly,项目名称:BlowyBalloon,代码行数:9,代码来源:SpawnGates.cs

示例9: receiveEvent

    public void receiveEvent(GameEvents.GameEvent e)
    {
        if(e.GetType().Name.Equals("InputEvent"))
        {
            InputEvent inputEvent = (InputEvent) e;

            GetInput(inputEvent.GetDevice());
        }
    }
开发者ID:paulkelly,项目名称:BlowyBalloon,代码行数:9,代码来源:FanController.cs

示例10: receiveEvent

    public void receiveEvent(GameEvents.GameEvent e)
    {
        if(e.GetType().Name.Equals("DamagePlayer"))
        {
            int damage = ((DamagePlayer) e).getDamageValue();
            bool doKnockback = !(tookDamage || invunerable) && ((DamagePlayer) e).bounceAfterTakingDamage();
            doDamage(damage);

            if(doKnockback)
            {
                GameObject damager = ((DamagePlayer) e).getDamager();

                if(damager.tag.Equals("Enemy"))
                {
                    Vector2 direction = new Vector2(transform.position.x - damager.transform.position.x,
                                                    transform.position.y - damager.transform.position.y);
                    rigidbody2D.AddForce(direction * bounceForce);
                }
                else
                {
                    Vector2 direction = rigidbody2D.velocity.normalized * -1;;
                    rigidbody2D.AddForce(direction * bounceForce);
                }
            }
        }
        else if(e.GetType().Name.Equals("EnterRoom"))
        {
            bool isFirstTime = ((EnterRoom) e).isFirstTime();
            if(isFirstTime)
            {
                gainShieldCharge();
            }
        }
        else if(e.GetType().Name.Equals("CollectPower"))
        {
            shipSounds.playPowerup();
            int type = ((CollectPower) e).getPowerupType();
            if(type == 1)
            {
                gainShield();
            }
            else if(type == 2)
            {
                gainDamage();
            }
            else if(type == 3)
            {
                gainRateofFire();
            }
            else if(type == 4)
            {
                has5Shot = true;
            }

        }
    }
开发者ID:paulkelly,项目名称:pkbitshop,代码行数:56,代码来源:PlayerShip2D.cs

示例11: receiveEvent

 public void receiveEvent(GameEvents.GameEvent e)
 {
     if(e.GetType().Name.Equals("InputEvent"))
     {
         InputEvent inputEvent = (InputEvent) e;
         if(inputEvent.GetPlayerNumber() == playerNumber)
         {
             GetInput(inputEvent.GetDevice());
         }
     }
 }
开发者ID:paulkelly,项目名称:gamecraft5,代码行数:11,代码来源:PlayerMenu.cs


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