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.

24 lines
674 B
C#

using System;
using System.Threading.Tasks;
using Object = UnityEngine.Object;
namespace Thirdweb.Unity
{
public static class EcosystemWalletModal
{
public static async Task<EcosystemWallet> LoginWithOtp(EcosystemWallet wallet)
{
#if UNITY_6000_0_OR_NEWER
var modal = Object.FindAnyObjectByType<AbstractOTPVerifyModal>();
#else
var modal = Object.FindObjectOfType<AbstractOTPVerifyModal>();
#endif
if (modal == null)
{
throw new Exception("No OTPVerifyModal found in the scene.");
}
return await modal.LoginWithOtp(wallet) as EcosystemWallet;
}
}
}