Advertisement
Guest User

Untitled

a guest
Jun 24th, 2018
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.75 KB | None | 0 0
  1.  
  2.  
  3. // EndZone
  4. void OnTriggerEnter2D(Collider2D Other)
  5. {
  6.     Debug.Log("EndZone::OnTriggerEnter2D " + playerNumber.ToString());
  7.     if (Other.gameObject.tag == "Puck")
  8.     {
  9.         Observer.SendMessage("Score", "" + playerNumber.ToString());
  10.     }
  11. }
  12.  
  13. // PaddleController
  14. void OnCollisionEnter2D(Collision2D coll)
  15. {
  16.     // Note: the problem is not CurrVelocity.magnitude < epsilon. Already tested checking that.
  17.     // In fact, the bug still persists if I return at the beginning of this function.
  18.     Debug.Log("PaddleController::OnCollisionEnter2D " + coll.gameObject.tag);
  19.     if (coll.gameObject.tag == "Puck")
  20.     {
  21.         coll.gameObject.GetComponent<Rigidbody2D>().AddForce(CurrVelocity);
  22.         SoundManager.RandomizeSfxPitch(click);
  23.     }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement