| | 1 | | using TMPro; |
| | 2 | | using UnityEngine; |
| | 3 | | using UnityEngine.UI; |
| | 4 | |
|
| | 5 | | public class QuickBarSlot : MonoBehaviour |
| | 6 | | { |
| | 7 | | [SerializeField] internal RawImage image; |
| | 8 | | [SerializeField] internal TMP_Text text; |
| | 9 | | [SerializeField] internal CanvasGroup canvasGroup; |
| | 10 | |
|
| 3 | 11 | | public bool isEmpty => !image.enabled; |
| 3 | 12 | | public Transform slotTransform => transform; |
| | 13 | |
|
| | 14 | | public void SetTexture(Texture texture) |
| | 15 | | { |
| 4 | 16 | | image.texture = texture; |
| 4 | 17 | | image.enabled = true; |
| 4 | 18 | | } |
| | 19 | |
|
| 64 | 20 | | public void SetEmpty() { image.enabled = false; } |
| | 21 | |
|
| | 22 | | public void EnableDragMode() |
| | 23 | | { |
| 30 | 24 | | text.enabled = false; |
| 30 | 25 | | canvasGroup.blocksRaycasts = false; |
| 30 | 26 | | canvasGroup.alpha = 0.6f; |
| 30 | 27 | | } |
| | 28 | |
|
| 66 | 29 | | public void SetActive(bool isActive) { gameObject.SetActive(isActive); } |
| | 30 | | } |