| | | 1 | | using System.Collections; |
| | | 2 | | using System.Collections.Generic; |
| | | 3 | | using UnityEngine; |
| | | 4 | | |
| | | 5 | | public class PlayerTriggers : MonoBehaviour |
| | | 6 | | { |
| | | 7 | | public WinLose winlosescript; |
| | 32 | 8 | | public int StarValue = 1; |
| | | 9 | | |
| | | 10 | | |
| | | 11 | | private void OnTriggerEnter(Collider other) |
| | 4 | 12 | | { |
| | 4 | 13 | | if (other.gameObject.CompareTag("Cars")) |
| | 0 | 14 | | { |
| | 0 | 15 | | Debug.Log("HIt"); |
| | 0 | 16 | | winlosescript.loselevel(); |
| | | 17 | | |
| | | 18 | | |
| | 0 | 19 | | } |
| | | 20 | | |
| | 4 | 21 | | else if (other.gameObject.CompareTag("WinBox")) |
| | 0 | 22 | | { |
| | 0 | 23 | | Scoremanager.instance.changescore(StarValue); |
| | 0 | 24 | | Destroy(other.gameObject); |
| | 0 | 25 | | } |
| | | 26 | | |
| | 4 | 27 | | } |
| | | 28 | | |
| | | 29 | | |
| | | 30 | | |
| | | 31 | | } |