You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
1.2 KiB
C#
39 lines
1.2 KiB
C#
1 month ago
|
using System.IO;
|
||
|
using System.Threading;
|
||
|
using System.Threading.Tasks;
|
||
|
using TMPro;
|
||
|
using UnityEngine;
|
||
|
using UnityEngine.UI;
|
||
|
using WalletConnectUnity.Core.Networking;
|
||
|
using WalletConnectUnity.UI;
|
||
|
|
||
|
namespace WalletConnectUnity.Modal.Views
|
||
|
{
|
||
|
public class WebAppPage : ApprovalViewPageBase
|
||
|
{
|
||
|
[Header("WebApp Page")]
|
||
|
[SerializeField] private TMP_Text _titleText;
|
||
|
|
||
|
[SerializeField] private string _titleTextFormat = "Continue in {0}";
|
||
|
[SerializeField] private GameObject _openButton;
|
||
|
|
||
|
public override async Task InitializeAsync(Wallet wallet, WCModal modal, RemoteSprite<Image> remoteWalletIcon,
|
||
|
CancellationToken cancellationToken)
|
||
|
{
|
||
|
_titleText.text = string.Format(_titleTextFormat, wallet.Name);
|
||
|
await base.InitializeAsync(wallet, modal, remoteWalletIcon, cancellationToken);
|
||
|
_openButton.SetActive(true);
|
||
|
}
|
||
|
|
||
|
public override void Disable()
|
||
|
{
|
||
|
base.Disable();
|
||
|
_openButton.SetActive(false);
|
||
|
}
|
||
|
|
||
|
public void OnOpen()
|
||
|
{
|
||
|
Application.OpenURL(Path.Combine(Wallet.WebappLink, $"wc?uri={Uri}"));
|
||
|
}
|
||
|
}
|
||
|
}
|