| | 1 | | using System; |
| | 2 | | using UnityEngine; |
| | 3 | | using UnityEngine.UI; |
| | 4 | |
|
| | 5 | | namespace DCL.Guests.HUD.ConnectWallet |
| | 6 | | { |
| | 7 | | public class ConnectWalletComponentView : BaseComponentView, IConnectWalletComponentView |
| | 8 | | { |
| | 9 | | [SerializeField] internal Button backgroundButton; |
| | 10 | | [SerializeField] internal Button closeButton; |
| | 11 | | [SerializeField] internal ButtonComponentView connectButton; |
| | 12 | | [SerializeField] internal ButtonComponentView helpButton; |
| | 13 | |
|
| | 14 | | public event Action OnCancel; |
| | 15 | | public event Action OnConnect; |
| | 16 | | public event Action OnHelp; |
| | 17 | |
|
| | 18 | | public override void Awake() |
| | 19 | | { |
| 5 | 20 | | base.Awake(); |
| | 21 | |
|
| 5 | 22 | | if (backgroundButton != null) |
| 5 | 23 | | backgroundButton.onClick.AddListener(() => OnCancel?.Invoke()); |
| | 24 | |
|
| 5 | 25 | | if (closeButton != null) |
| 5 | 26 | | closeButton.onClick.AddListener(() => OnCancel?.Invoke()); |
| | 27 | |
|
| 6 | 28 | | connectButton.onClick.AddListener(() => OnConnect?.Invoke()); |
| 6 | 29 | | helpButton.onClick.AddListener(() => OnHelp?.Invoke()); |
| 5 | 30 | | } |
| | 31 | |
|
| | 32 | | public override void Dispose() |
| | 33 | | { |
| 9 | 34 | | if (backgroundButton != null) |
| 8 | 35 | | backgroundButton.onClick.RemoveAllListeners(); |
| | 36 | |
|
| 9 | 37 | | if (closeButton != null) |
| 8 | 38 | | closeButton.onClick.RemoveAllListeners(); |
| | 39 | |
|
| 9 | 40 | | connectButton.onClick.RemoveAllListeners(); |
| 9 | 41 | | helpButton.onClick.RemoveAllListeners(); |
| | 42 | |
|
| 9 | 43 | | base.Dispose(); |
| 9 | 44 | | } |
| | 45 | |
|
| 0 | 46 | | public override void RefreshControl() { } |
| | 47 | |
|
| | 48 | | internal static ConnectWalletComponentView Create() |
| | 49 | | { |
| 4 | 50 | | ConnectWalletComponentView connectWalletComponenView = Instantiate(Resources.Load<GameObject>("ConnectWallet |
| 4 | 51 | | connectWalletComponenView.name = "_ConnectWalletHUD"; |
| | 52 | |
|
| 4 | 53 | | return connectWalletComponenView; |
| | 54 | | } |
| | 55 | | } |
| | 56 | | } |