Skip to content

Commit fc9f1a8

Browse files
author
Ovidiu Arion
committed
Demo scene done
1 parent b0f26b8 commit fc9f1a8

File tree

12 files changed

+24
-35
lines changed

12 files changed

+24
-35
lines changed

Assets/ElrondUnityTools/Example/Scripts/ConnectedScreen.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,14 @@ private void RefreshAccount(AccountDto connectedAccount)
2828
ht.text = "HT: " + connectedAccount.Username;
2929
}
3030

31+
32+
//linked to the UI button to open the Transactions screen
3133
public void ShowTransactions()
3234
{
3335
DemoScript.Instance.LoadScreen(Screens.Transactions);
3436
}
3537

36-
//linked to a button to open the SC screen
38+
//linked to the UI button to open the SC screen
3739
public void ShowSCScreen()
3840
{
3941
DemoScript.Instance.LoadScreen(Screens.SC);

Assets/ElrondUnityTools/Example/Scripts/GenericUIScreen.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
using System.Collections;
2-
using System.Collections.Generic;
31
using UnityEngine;
42

53
namespace ElrondUnityExamples

Assets/ElrondUnityTools/Example/Scripts/HomeScreen.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
using System.Collections;
2-
using System.Collections.Generic;
3-
using UnityEngine;
4-
51
namespace ElrondUnityExamples
62
{
73
public class HomeScreen : GenericUIScreen

Assets/ElrondUnityTools/Example/Scripts/LoginScreen.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
using Erdcsharp.Domain;
2-
using Erdcsharp.Provider.Dtos;
3-
using System.Collections;
4-
using System.Collections.Generic;
5-
using UnityEngine;
61
using UnityEngine.UI;
72

83
namespace ElrondUnityExamples

Assets/ElrondUnityTools/Example/Scripts/NftsScreen.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
using ElrondUnityTools;
2-
using System;
3-
using System.Collections;
42
using System.Linq;
53
using UnityEngine;
6-
using UnityEngine.Networking;
74
using UnityEngine.UI;
8-
using Image = UnityEngine.UI.Image;
95

106
namespace ElrondUnityExamples
117
{
@@ -78,8 +74,6 @@ private void DisplayNft(NFTMetadata nFTMetadata)
7874
}
7975

8076

81-
82-
8377
/// <summary>
8478
/// Refresh the wallet NFTs after sending an NFT
8579
/// </summary>

Assets/ElrondUnityTools/Example/Scripts/SCScreen.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
using System;
2-
using System.Collections;
3-
using System.Collections.Generic;
42
using UnityEngine;
53
using UnityEngine.UI;
64

@@ -132,8 +130,8 @@ private void SCTransactionListener(ElrondUnityTools.OperationStatus operationSta
132130
if (message == "success")
133131
{
134132
//do something
135-
ElrondUnityTools.Manager.RefreshAccount();
136133
}
134+
ElrondUnityTools.Manager.RefreshAccount();
137135
}
138136
}
139137
}

Assets/ElrondUnityTools/Example/Scripts/TokenHolder.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
using System.Collections;
2-
using System.Collections.Generic;
31
using UnityEngine;
42
using UnityEngine.UI;
53

Assets/ElrondUnityTools/Example/Scripts/TransactionsScreen.cs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
using ElrondUnityTools;
2-
using Erdcsharp.Domain;
3-
using System;
42
using System.Numerics;
53
using UnityEngine;
64
using UnityEngine.UI;
@@ -30,7 +28,7 @@ public override void Init(params object[] args)
3028
base.Init(args);
3129
destination.text = defaultAddress;
3230
message.text = defaultMessage;
33-
amount.text = esdtAmount.text = egld.ToString();
31+
amount.text = egld.ToString();
3432
PopulateDropDown();
3533
status.text = "Start loading tokens";
3634
Manager.LoadAllTokens(TokensLoaded);
@@ -155,10 +153,9 @@ private void BlockchainTransactionListener(ElrondUnityTools.OperationStatus oper
155153
{
156154
if (message == "success")
157155
{
158-
ElrondUnityTools.Manager.RefreshAccount(RefreshDone);
159156
status.text = "Success -> Refreshing tokens";
160-
161157
}
158+
ElrondUnityTools.Manager.RefreshAccount(RefreshDone);
162159
}
163160
}
164161
}

Assets/ElrondUnityTools/Scripts/ConnectionManager.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,6 @@ private void AccountRefreshed()
285285
public async void RefreshAccount(UnityAction CompleteMethod)
286286
{
287287
connectedAccount = await provider.GetAccount(WalletConnect.ActiveSession.Accounts[0]);
288-
Debug.LogWarning(connectedAccount.Nonce);
289288
if (CompleteMethod != null)
290289
{
291290
CompleteMethod();
@@ -295,7 +294,6 @@ public async void RefreshAccount(UnityAction CompleteMethod)
295294

296295
private void ActiveSessionOnDisconnect(object sender, EventArgs e)
297296
{
298-
Debug.Log("ActiveSessionOnDisconnect");
299297
WalletConnect.ActiveSession.OnSessionDisconnect -= ActiveSessionOnDisconnect;
300298
walletConnected = false;
301299
OnWalletDisconnected();
@@ -383,7 +381,6 @@ private IEnumerator GetWalletNFTs(string address, UnityAction<OperationStatus, s
383381
{
384382
case UnityWebRequest.Result.Success:
385383
totalNfts = int.Parse(webRequest.downloadHandler.text);
386-
Debug.Log(totalNfts);
387384
break;
388385
default:
389386
LoadNFTsComplete(OperationStatus.Error, webRequest.error, null);

Assets/ElrondUnityTools/Scripts/ESDTToken.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public ESDTToken(string name, string identifier, int decimals)
2323

2424
public Token ToToken()
2525
{
26-
return new Token(name, "AAA", decimals);
26+
return new Token(name, identifier.Split("-")[0], decimals);
2727
}
2828
}
2929
}

0 commit comments

Comments
 (0)