コード例 #1
0
 /// <summary>
 /// Kills ball when the death timer finishes
 /// </summary>
 void HandleDeathTimerFinished()
 {
     // invoke event and destroy self
     AudioManager.Play(AudioClipName.BallDeath);
     ballDiedEvent.Invoke();
     Destroy(gameObject);
 }
コード例 #2
0
 /// <summary>
 /// PickUp collison checking method
 /// </summary>
 /// <param name="collision"></param>
 private void OnCollisionEnter2D(Collision2D collision)
 {
     // Checks for specific pick up ball types and then invokes for Right Paddle
     if (collision.gameObject.CompareTag("RightPaddle"))
     {
         // Freezer Effect (Right Side)
         //if (collision.gameObject.CompareTag("FreezeEffect"))
         if (ballType == PickUpEffectsEnum.FreezerEffect)
         {
             freezerEffectActivated.Invoke(ScreenSide.Right, freezeDuration);
             ballDiedEvent.Invoke();
         }
         // Speed Up Effect
         //if (collision.gameObject.CompareTag("SpeedUpEffect"))
         if (ballType == PickUpEffectsEnum.SpeedUpEffect)
         {
             //speedUpEffectActiveEvent.Invoke(speedUpDuration, speedUpEffectSpeed);
             SpeedUpActive(speedUpDuration, speedUpEffectSpeed);
             ballDiedEvent.Invoke();
             Destroy(gameObject);
         }
         Destroy(gameObject);
     }
     else if (collision.gameObject.CompareTag("LeftPaddle"))
     {
         // Freezer Effect (Left Side)
         //if (collision.gameObject.CompareTag("FreezeEffect"))
         if (ballType == PickUpEffectsEnum.FreezerEffect)
         {
             freezerEffectActivated.Invoke(ScreenSide.Left, freezeDuration);
             ballDiedEvent.Invoke();
         }
         // Speed Up Effect
         //if (collision.gameObject.CompareTag("SpeedUpEffect"))
         if (ballType == PickUpEffectsEnum.SpeedUpEffect)
         {
             //speedUpEffectActiveEvent.Invoke(speedUpDuration, speedUpEffectSpeed);
             SpeedUpActive(speedUpDuration, speedUpEffectSpeed);
             ballDiedEvent.Invoke();
             Destroy(gameObject);
         }
         Destroy(gameObject);
     }
 }
コード例 #3
0
 /// <summary>
 /// Kills ball when the death timer finishes
 /// </summary>
 void HandleDeathTimerFinished()
 {
     // invoke event and destroy self
     ballDiedEvent.Invoke();
     Destroy(gameObject);
 }
コード例 #4
0
ファイル: Ball.cs プロジェクト: Jdandrea40/GDD2200_Fall18
 /// <summary>
 /// Ball Death timer Event Method
 /// </summary>
 public virtual void BallDeathTimer()
 {
     Destroy(gameObject);
     ballDiedEvent.Invoke();
 }
コード例 #5
0
ファイル: Ball.cs プロジェクト: oabaig/Wacky-Breakout
 void TimerEventFinished()
 {
     ballDiedEvent.Invoke();
     Destroy(gameObject);
 }