| | 1 | | using UnityEngine; |
| | 2 | | using TMPro; |
| | 3 | |
|
| | 4 | | public class UIEventMarker : MonoBehaviour { |
| | 5 | | private TextMeshProUGUI _text; |
| | 6 | |
|
| 0 | 7 | | void Awake() { |
| 0 | 8 | | _text = GetComponentInChildren<TextMeshProUGUI>(); |
| 0 | 9 | | if (_text == null) { |
| 0 | 10 | | Debug.LogError("No TextMeshProUGUI component found in children."); |
| 0 | 11 | | } |
| 0 | 12 | | } |
| | 13 | |
|
| 0 | 14 | | public void SetEventHit() { |
| 0 | 15 | | _text.text = "x"; |
| 0 | 16 | | _text.color = Color.green; |
| 0 | 17 | | } |
| | 18 | |
|
| 0 | 19 | | public void SetEventMiss() { |
| 0 | 20 | | _text.text = "o"; |
| 0 | 21 | | _text.color = Color.red; |
| 0 | 22 | | } |
| | 23 | |
|
| 0 | 24 | | void LateUpdate() { |
| 0 | 25 | | transform.LookAt(Camera.main.transform); |
| 0 | 26 | | } |
| | 27 | | } |