Exemplo n.º 1
0
 private void OnCollisionEnter(Collision collision)
 {
     if (collision.gameObject.CompareTag("Player1") || collision.gameObject.CompareTag("Player2"))
     {
         m_mainCameraRef.BeginShake(m_shakeLength, m_shakeStrength);
     }
 }
Exemplo n.º 2
0
 private void OnCollisionEnter(Collision collision)
 {
     if (collision.collider.CompareTag("Player1"))
     {
         m_p1Hit = true;
         StartCoroutine(CheckWinCondition());
         m_mainCameraRef.BeginShake(m_shakeLength, m_shakeStrength);
     }
     else if (collision.collider.CompareTag("Player2"))
     {
         m_p2Hit = true;
         StartCoroutine(CheckWinCondition());
         m_mainCameraRef.BeginShake(m_shakeLength, m_shakeStrength);
     }
     else if (collision.collider.CompareTag("PowerUp"))
     {
         // SAD FACE TOO MUCH LAZINESS TO CACHE
         m_powerUpManagerRef.CollectAt(collision.gameObject.GetComponent <PowerUp>().GetIdx());
     }
 }