Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Webgl metamask connect #153

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ sysinfo.txt
*.aab
*.unitypackage
*.app
webglbuild

# Crashlytics generated file
crashlytics-build.properties
Expand Down
Binary file modified Assets/Thirdweb/Runtime/NET/Thirdweb.dll
Binary file not shown.
17 changes: 14 additions & 3 deletions Assets/Thirdweb/Runtime/Unity/Browser/CrossPlatformUnityBrowser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,23 @@ public CrossPlatformUnityBrowser(string htmlOverride = null)
htmlOverride = null;
}

var go = new GameObject("WebGLInAppWalletBrowser");

#if UNITY_EDITOR
_unityBrowser = new InAppWalletBrowser(htmlOverride);
#elif UNITY_WEBGL
_unityBrowser = go.AddComponent<WebGLInAppWalletBrowser>();
#if UNITY_6000_0_OR_NEWER
var existingBrowser = UnityEngine.Object.FindAnyObjectByType<WebGLInAppWalletBrowser>();
#else
var existingBrowser = GameObject.FindObjectOfType<WebGLInAppWalletBrowser>();
#endif
if (existingBrowser != null)
{
_unityBrowser = existingBrowser;
}
else
{
var go = new GameObject("WebGLInAppWalletBrowser");
_unityBrowser = go.AddComponent<WebGLInAppWalletBrowser>();
}
#elif UNITY_ANDROID
_unityBrowser = new AndroidBrowser();
#elif UNITY_IOS
Expand Down
2 changes: 1 addition & 1 deletion Assets/Thirdweb/Runtime/Unity/ThirdwebManagerBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ public abstract class ThirdwebManagerBase : MonoBehaviour

public static ThirdwebManagerBase Instance { get; protected set; }

public static readonly string THIRDWEB_UNITY_SDK_VERSION = "5.17.2";
public static readonly string THIRDWEB_UNITY_SDK_VERSION = "5.18.5";

protected const string THIRDWEB_AUTO_CONNECT_OPTIONS_KEY = "ThirdwebAutoConnectOptions";

Expand Down
Loading