Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using System.Collections;
- using UnityEngine.UI;
- public class ScoringSystem : MonoBehaviour {
- public Text scoreTextRight;
- public Text scoreTextLeft;
- public string scorePlayerLeft;
- public string scorePlayerRight;
- void Start () {
- }
- void OnCollisionEnter2D(Collision2D col)
- {
- if (col.gameObject.name == "WallLeft") {
- scoreTextLeft.text = scorePlayerLeft;
- scorePlayerLeft += 1;
- scoreTextLeft.text = scorePlayerLeft;
- } else if (col.gameObject.name == "WallRight") {
- scoreTextRight.text = scorePlayerRight;
- scorePlayerRight += 1;
- scoreTextRight.text = scorePlayerRight;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement