Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
b535637
Revert "automated duplicating imported samples modifications (#595)"
robGG1997 Sep 14, 2023
95fb832
Merge branch 'main' of https://github.com/ChainSafe/web3.unity
robGG1997 Sep 14, 2023
e3ab3c2
Merge branch 'main' of https://github.com/ChainSafe/web3.unity
robGG1997 Sep 14, 2023
a536df0
Merge branch 'main' of https://github.com/ChainSafe/web3.unity
robGG1997 Sep 15, 2023
c12a0de
Merge branch 'main' of https://github.com/ChainSafe/web3.unity
robGG1997 Sep 18, 2023
8e1ea0a
Merge branch 'main' of https://github.com/ChainSafe/web3.unity
robGG1997 Sep 18, 2023
1318cd7
Merge branch 'main' of https://github.com/ChainSafe/web3.unity
robGG1997 Sep 21, 2023
33b8e52
Merge branch 'main' of https://github.com/ChainSafe/web3.unity
robGG1997 Sep 22, 2023
0a205bd
Merge branch 'main' of https://github.com/ChainSafe/web3.unity
robGG1997 Sep 25, 2023
df4795a
Merge branch 'main' of https://github.com/ChainSafe/web3.unity
robGG1997 Sep 29, 2023
abc34f6
Merge branch 'main' of https://github.com/ChainSafe/web3.unity
robGG1997 Sep 29, 2023
031e8d3
Merge branch 'main' of https://github.com/ChainSafe/web3.unity
robGG1997 Oct 18, 2023
3a4bdd9
Merge branch 'main' of https://github.com/ChainSafe/web3.unity
robGG1997 Oct 24, 2023
67d871d
Merge branch 'main' of https://github.com/ChainSafe/web3.unity
robGG1997 Oct 25, 2023
3c1d099
Merge branch 'main' of https://github.com/ChainSafe/web3.unity
robGG1997 Oct 30, 2023
ed22cb7
Merge branch 'main' of https://github.com/ChainSafe/web3.unity
robGG1997 Oct 31, 2023
4c8b282
Merge branch 'main' of https://github.com/ChainSafe/web3.unity
robGG1997 Nov 1, 2023
ea609de
Merge branch 'main' of https://github.com/ChainSafe/web3.unity
robGG1997 Nov 2, 2023
adcb974
Merge branch 'main' of https://github.com/ChainSafe/web3.unity
robGG1997 Nov 2, 2023
77dd93a
Merge branch 'main' of https://github.com/ChainSafe/web3.unity
robGG1997 Nov 3, 2023
12af139
Merge branch 'main' of https://github.com/ChainSafe/web3.unity
robGG1997 Nov 7, 2023
3080de3
Merge branch 'main' of https://github.com/ChainSafe/web3.unity
robGG1997 Nov 8, 2023
87a1dcc
Merge branch 'main' of https://github.com/ChainSafe/web3.unity
robGG1997 Nov 8, 2023
f25d202
Merge branch 'main' of https://github.com/ChainSafe/web3.unity
robGG1997 Nov 9, 2023
300d906
Merge branch 'main' of https://github.com/ChainSafe/web3.unity
robGG1997 Nov 14, 2023
f28d9f4
Merge branch 'main' of https://github.com/ChainSafe/web3.unity
robGG1997 Nov 16, 2023
ab26fa3
Merge branch 'main' of https://github.com/ChainSafe/web3.unity
robGG1997 Nov 17, 2023
c5c0cb4
Merge branch 'main' of https://github.com/ChainSafe/web3.unity
robGG1997 Nov 17, 2023
a1671d7
Merge branch 'main' of https://github.com/ChainSafe/web3.unity
robGG1997 Nov 20, 2023
a4755d1
Merge branch 'main' of https://github.com/ChainSafe/web3.unity
robGG1997 Nov 21, 2023
0398dba
added WebGL threading patcher from - https://github.com/VolodymyrBS/W…
robGG1997 Nov 21, 2023
6ca4ea7
Merge branch 'main' of https://github.com/ChainSafe/web3.unity
robGG1997 Nov 21, 2023
07cee0a
Merge branch 'main' of https://github.com/ChainSafe/web3.unity
robGG1997 Nov 22, 2023
38556cc
Merge branch 'main' into rob/meta-mask-integration-517
robGG1997 Nov 22, 2023
69a84ec
WebGLThreadingPatcherInstaller dialog
robGG1997 Nov 22, 2023
266d110
Merge branch 'main' into rob/wallet-connect-WebGL-patch-749
robGG1997 Nov 22, 2023
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
using System;
using System.Collections.Generic;
using System.IO;
using Newtonsoft.Json;
using UnityEditor;
using UnityEngine;

[InitializeOnLoad]
public static class WebGLThreadPatcherInstaller
{
private const string WebGLThreadPatchedInstalled = "IsWebGLThreadPatcherInstalled";

private const string ManifestPath = "Packages/manifest.json";

private const string WebGLThreadPatcherPackageName = "com.tools.webglthreadingpatcher";

private const string WebGLThreadPatcherPackageLink = "https://github.com/VolodymyrBS/WebGLThreadingPatcher.git";

static WebGLThreadPatcherInstaller()
{
#if UNITY_WEBGL
if (SessionState.GetBool(WebGLThreadPatchedInstalled, false))
{
return;
}

TryInstallThreadPatcher();

SessionState.SetBool(WebGLThreadPatchedInstalled, true);
#else
// reset.
SessionState.SetBool(WebGLThreadPatchedInstalled, false);
#endif
}

[MenuItem("Window/ChainSafe SDK/Install WebGLThreadingPatcher")]
public static void TryInstallThreadPatcher()
{
Manifest manifest = JsonConvert.DeserializeObject<Manifest>(File.ReadAllText(ManifestPath));

// check if ThreadPatcher is already installed.
if (manifest.Dependencies.ContainsKey(WebGLThreadPatcherPackageName))
{
return;
}

if (EditorUtility.DisplayDialog("Web3.Unity", "For Web3.Unity to fully work on a WebGL build you need to install a WebGLThreadingPatcher, this will make sure async operations can run to completion.\nInstall WebGLThreadingPatcher?", "Yes", "No"))
{
// Add the package as a dependency.
manifest.Dependencies.Add(WebGLThreadPatcherPackageName, WebGLThreadPatcherPackageLink);

File.WriteAllText(ManifestPath, JsonConvert.SerializeObject(manifest, Formatting.Indented));
}
}

private struct Manifest
{
[JsonProperty("dependencies")]
public Dictionary<string, string> Dependencies { get; private set; }
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/UnitySampleProject/Packages/manifest.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"dependencies": {
"com.tools.webglthreadingpatcher": "https://github.com/VolodymyrBS/WebGLThreadingPatcher.git",
"com.unity.collab-proxy": "2.0.7",
"com.unity.feature.2d": "1.0.0",
"com.unity.ide.rider": "3.0.25",
Expand Down