Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. public class PlayerCollisons : MonoBehaviour {
  6.  
  7. private GameSetup gameSetup;
  8.  
  9. void Start()
  10. {
  11. gameSetup = GameSetup.GetInstance();
  12. }
  13.  
  14. private void OnCollisionEnter2D(Collision2D collision)
  15. {
  16. if (collision.otherCollider.tag == "ScoreGate")
  17. {
  18. gameSetup.Score++;
  19. gameSetup.ScoreValueChanged = true;
  20. }
  21. else
  22. {
  23. gameSetup.GameOver();
  24. }
  25. }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement