| | 1 | | using UnityEngine; |
| | 2 | | using System; |
| | 3 | |
|
| | 4 | | public class ControlsHUDView : MonoBehaviour |
| | 5 | | { |
| | 6 | | [SerializeField] internal InputAction_Trigger closeAction; |
| | 7 | | [SerializeField] internal ShowHideAnimator showHideAnimator; |
| | 8 | | [SerializeField] internal Button_OnPointerDown closeButton; |
| | 9 | | [SerializeField] internal GameObject voiceChatButton; |
| | 10 | | [SerializeField] internal GameObject builderInWorldButton; |
| | 11 | |
|
| | 12 | | public event Action<bool> onCloseActionTriggered; |
| | 13 | |
|
| | 14 | | private void Awake() |
| | 15 | | { |
| 3 | 16 | | closeAction.OnTriggered += OnCloseActionTriggered; |
| 3 | 17 | | closeButton.onPointerDown += () => Close(true); |
| 3 | 18 | | } |
| | 19 | |
|
| 6 | 20 | | private void OnDestroy() { closeAction.OnTriggered -= OnCloseActionTriggered; } |
| | 21 | |
|
| 0 | 22 | | private void OnCloseActionTriggered(DCLAction_Trigger action) { Close(false); } |
| | 23 | |
|
| 0 | 24 | | private void Close(bool closedByButtonPress) { onCloseActionTriggered?.Invoke(closedByButtonPress); } |
| | 25 | | } |