Skip to content

Commit 39e8bb1

Browse files
committed
Merge branch 'main' into features/web3api_async
2 parents 8063ed7 + dfeadca commit 39e8bb1

38 files changed

+2434
-2433
lines changed

Assembly-CSharp-Editor.csproj

Lines changed: 210 additions & 204 deletions
Large diffs are not rendered by default.

Assembly-CSharp.Player.csproj

Lines changed: 182 additions & 191 deletions
Large diffs are not rendered by default.

Assembly-CSharp.csproj

Lines changed: 193 additions & 202 deletions
Large diffs are not rendered by default.

Assets/MoralisWeb3ApiSdk/Example/DemoScene.unity

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47700,7 +47700,7 @@ PrefabInstance:
4770047700
objectReference: {fileID: 0}
4770147701
- target: {fileID: 6266890725912523073, guid: 116667ed98661304da1568439e2a3426, type: 3}
4770247702
propertyPath: MoralisServerURI
47703-
value: SERVER URL
47703+
value: SERVER URI
4770447704
objectReference: {fileID: 0}
4770547705
- target: {fileID: 6266890725912523073, guid: 116667ed98661304da1568439e2a3426, type: 3}
4770647706
propertyPath: MoralisApplicationId

Assets/MoralisWeb3ApiSdk/Example/Scripts/AwardableController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ async void Awake()
6464
{
6565

6666
}
67-
67+
6868
// Update is called once per frame
6969
async void Update()
7070
{

Assets/MoralisWeb3ApiSdk/Example/Scripts/MainMenuScript.cs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,10 @@ public class MainMenuScript : MonoBehaviour
6666

6767
Image menuBackground;
6868

69+
void OnApplicationQuit()
70+
{
71+
walletConnect.CLearSession();
72+
}
6973
async void Start()
7074
{
7175
menuBackground = (Image)gameObject.GetComponent(typeof(Image));
@@ -192,8 +196,27 @@ public async void WalletConnectHandler(WCSessionData data)
192196
}
193197

194198
HideWalletSelection();
199+
200+
SaveScore(10.0f);
195201
}
196202

203+
public class MyScores : MoralisObject
204+
{
205+
public string Name;
206+
public float Seconds;
207+
}
208+
209+
async void SaveScore(float time)
210+
{
211+
var user = await MoralisInterface.GetUserAsync();
212+
var addr = user.authData["moralisEth"]["id"].ToString();
213+
//var ens = MoralisInterface.GetClient().Web3Api.Resolve.ResolveAddress(addr);
214+
var score = MoralisInterface.GetClient().Create<MyScores>();
215+
score.Name = "Bob"; // !string.IsNullOrEmpty(ens.Name) ? ens.Name : addr;
216+
score.Seconds = time;
217+
await score.SaveAsync();
218+
Debug.Log("SavedScore");
219+
}
197220
/// <summary>
198221
/// Closeout connections and quit the application.
199222
/// </summary>

Assets/MoralisWeb3ApiSdk/Moralis/Moralis.Network/Client/WebSocket.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using System;
1+
#if UNITY_WEBGL
2+
using System;
23
using System.Collections.Generic;
34
using AOT;
45
using System.Runtime.InteropServices;
@@ -169,3 +170,4 @@ public void DelegateOnCloseEvent (int closeCode) {
169170

170171
}
171172
}
173+
#endif

Assets/MoralisWeb3ApiSdk/Moralis/Moralis.Network/Client/WebSocketFactory.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using System;
1+
#if UNITY_WEBGL
2+
using System;
23
using System.Collections.Generic;
34
using System.IO;
45
using System.Net.WebSockets;
@@ -143,3 +144,4 @@ public static WebSocket CreateInstance(string url)
143144
*/
144145
}
145146
}
147+
#endif

Assets/MoralisWeb3ApiSdk/Moralis/Moralis.WebGL/MoralisDotNet/MoralisClient.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,9 @@ public T Create<T>(object[] parameters = null) where T : MoralisObject
163163

164164
public void Dispose()
165165
{
166+
#if UNITY_WEBGL
166167
MoralisLiveQueryManager.DisposeService();
167-
168+
#endif
168169
}
169170

170171
/// <summary>

Assets/MoralisWeb3ApiSdk/Moralis/Moralis.WebGL/MoralisDotNet/MoralisDynamic.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,9 @@ public T Create<T>(object[] parameters = null) where T : MoralisObject
189189

190190
public void Dispose()
191191
{
192+
#if UNITY_WEBGL
192193
MoralisLiveQueryManager.DisposeService();
193-
194+
#endif
194195
}
195196

196197
/// <summary>

0 commit comments

Comments
 (0)