@@ -11,15 +11,18 @@ namespace Dojo
1111 public class WorldManager : MonoBehaviour
1212 {
1313 public SynchronizationMaster synchronizationMaster ;
14+ #if UNITY_WEBGL && ! UNITY_EDITOR
15+ public ToriiWasmClient toriiClient ;
16+ #else
1417 public ToriiClient toriiClient ;
15- public ToriiWasmClient wasmClient ;
18+ #endif
1619 [ SerializeField ] public WorldManagerData dojoConfig ;
1720
1821 async void Awake ( )
1922 {
2023#if UNITY_WEBGL && ! UNITY_EDITOR
21- wasmClient = new ToriiWasmClient ( dojoConfig . toriiUrl , dojoConfig . relayWebrtcUrl , dojoConfig . worldAddress ) ;
22- await wasmClient . CreateClient ( ) ;
24+ toriiClient = new ToriiWasmClient ( dojoConfig . toriiUrl , dojoConfig . relayWebrtcUrl , dojoConfig . worldAddress ) ;
25+ await toriiClient . CreateClient ( ) ;
2326#else
2427 toriiClient = new ToriiClient ( dojoConfig . toriiUrl , dojoConfig . relayUrl , dojoConfig . worldAddress ) ;
2528#endif
@@ -117,7 +120,7 @@ public void RemoveEntity(string key)
117120 public async Task < byte [ ] > Publish ( TypedData typedData , FieldElement [ ] signature )
118121 {
119122#if UNITY_WEBGL && ! UNITY_EDITOR
120- return await wasmClient . PublishMessage ( typedData , signature ) ;
123+ return await toriiClient . PublishMessage ( typedData , signature ) ;
121124#else
122125 return await Task . Run ( ( ) => toriiClient . PublishMessage ( typedData , signature ) . ToArray ( ) ) ;
123126#endif
0 commit comments