Skip to content

Commit f42eac5

Browse files
committed
Fix network sprites prefab/script
1 parent e032057 commit f42eac5

File tree

3 files changed

+28
-120
lines changed

3 files changed

+28
-120
lines changed

Assets/Thirdweb/Examples/Prefabs/Prefab_ConnectWallet.prefab

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2323,33 +2323,33 @@ MonoBehaviour:
23232323
networkDropdown: {fileID: 8325283099334609011}
23242324
networkButtonPrefab: {fileID: 6070093235809079241, guid: 814bcc588eda3914ab104d1c06491bc8, type: 3}
23252325
networkSprites:
2326-
- chain: 1
2326+
- chain: 0
23272327
sprite: {fileID: 21300000, guid: bf76ffa047029554199b8d79b2306f6d, type: 3}
2328-
- chain: 5
2328+
- chain: 1
23292329
sprite: {fileID: 21300000, guid: bf76ffa047029554199b8d79b2306f6d, type: 3}
2330-
- chain: 137
2330+
- chain: 2
23312331
sprite: {fileID: 21300000, guid: a4ac9bda74166b740bf880e481d41f55, type: 3}
2332-
- chain: 80001
2332+
- chain: 3
23332333
sprite: {fileID: 21300000, guid: a4ac9bda74166b740bf880e481d41f55, type: 3}
2334-
- chain: 250
2334+
- chain: 4
23352335
sprite: {fileID: 21300000, guid: 54be2d2440a31164f8679e1bd550abf9, type: 3}
2336-
- chain: 4002
2336+
- chain: 5
23372337
sprite: {fileID: 21300000, guid: 54be2d2440a31164f8679e1bd550abf9, type: 3}
2338-
- chain: 43114
2338+
- chain: 6
23392339
sprite: {fileID: 21300000, guid: 3fe24f7fb0232e844988758a3ba03773, type: 3}
2340-
- chain: 43113
2340+
- chain: 7
23412341
sprite: {fileID: 21300000, guid: 3fe24f7fb0232e844988758a3ba03773, type: 3}
2342-
- chain: 10
2342+
- chain: 8
23432343
sprite: {fileID: 21300000, guid: b5be42ae0f66ca441beff78a90fe1680, type: 3}
2344-
- chain: 420
2344+
- chain: 9
23452345
sprite: {fileID: 21300000, guid: b5be42ae0f66ca441beff78a90fe1680, type: 3}
2346-
- chain: 42161
2346+
- chain: 10
23472347
sprite: {fileID: 21300000, guid: 44b9a8a5b27749046b8fe998a084c7cc, type: 3}
2348-
- chain: 421613
2348+
- chain: 11
23492349
sprite: {fileID: 21300000, guid: 44b9a8a5b27749046b8fe998a084c7cc, type: 3}
2350-
- chain: 56
2350+
- chain: 12
23512351
sprite: {fileID: 21300000, guid: 427f73b440444d3428c9d1101f7c0646, type: 3}
2352-
- chain: 97
2352+
- chain: 13
23532353
sprite: {fileID: 21300000, guid: 427f73b440444d3428c9d1101f7c0646, type: 3}
23542354
--- !u!1 &1335404546759128316
23552355
GameObject:

Assets/Thirdweb/Examples/Scenes/Scene_Prefabs.unity

Lines changed: 12 additions & 104 deletions
Original file line numberDiff line numberDiff line change
@@ -966,6 +966,18 @@ PrefabInstance:
966966
propertyPath: m_SizeDelta.y
967967
value: 0
968968
objectReference: {fileID: 0}
969+
- target: {fileID: 7702873693758646612, guid: 487e6840fccf4594ca24581d2b3e9d25, type: 3}
970+
propertyPath: m_AnchorMax.x
971+
value: 0
972+
objectReference: {fileID: 0}
973+
- target: {fileID: 7702873693758646612, guid: 487e6840fccf4594ca24581d2b3e9d25, type: 3}
974+
propertyPath: m_AnchorMax.y
975+
value: 0
976+
objectReference: {fileID: 0}
977+
- target: {fileID: 7702873693758646612, guid: 487e6840fccf4594ca24581d2b3e9d25, type: 3}
978+
propertyPath: m_SizeDelta.x
979+
value: 0
980+
objectReference: {fileID: 0}
969981
m_RemovedComponents: []
970982
m_SourcePrefab: {fileID: 100100000, guid: 487e6840fccf4594ca24581d2b3e9d25, type: 3}
971983
--- !u!224 &866517574 stripped
@@ -1346,114 +1358,10 @@ PrefabInstance:
13461358
m_Modification:
13471359
m_TransformParent: {fileID: 574059470}
13481360
m_Modifications:
1349-
- target: {fileID: 351517270, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3}
1350-
propertyPath: m_AnchorMax.y
1351-
value: 0
1352-
objectReference: {fileID: 0}
1353-
- target: {fileID: 351517270, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3}
1354-
propertyPath: m_AnchorMin.y
1355-
value: 0
1356-
objectReference: {fileID: 0}
1357-
- target: {fileID: 351517270, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3}
1358-
propertyPath: m_SizeDelta.x
1359-
value: 0
1360-
objectReference: {fileID: 0}
1361-
- target: {fileID: 351517270, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3}
1362-
propertyPath: m_AnchoredPosition.x
1363-
value: 0
1364-
objectReference: {fileID: 0}
1365-
- target: {fileID: 351517270, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3}
1366-
propertyPath: m_AnchoredPosition.y
1367-
value: 0
1368-
objectReference: {fileID: 0}
1369-
- target: {fileID: 679192014, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3}
1370-
propertyPath: m_AnchorMax.y
1371-
value: 0
1372-
objectReference: {fileID: 0}
1373-
- target: {fileID: 679192014, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3}
1374-
propertyPath: m_AnchorMin.y
1375-
value: 0
1376-
objectReference: {fileID: 0}
1377-
- target: {fileID: 679192014, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3}
1378-
propertyPath: m_SizeDelta.x
1379-
value: 0
1380-
objectReference: {fileID: 0}
1381-
- target: {fileID: 679192014, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3}
1382-
propertyPath: m_AnchoredPosition.x
1383-
value: 0
1384-
objectReference: {fileID: 0}
1385-
- target: {fileID: 679192014, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3}
1386-
propertyPath: m_AnchoredPosition.y
1387-
value: 0
1388-
objectReference: {fileID: 0}
1389-
- target: {fileID: 1045367076, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3}
1390-
propertyPath: m_AnchorMax.y
1391-
value: 0
1392-
objectReference: {fileID: 0}
1393-
- target: {fileID: 1045367076, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3}
1394-
propertyPath: m_AnchorMin.y
1395-
value: 0
1396-
objectReference: {fileID: 0}
1397-
- target: {fileID: 1045367076, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3}
1398-
propertyPath: m_SizeDelta.x
1399-
value: 0
1400-
objectReference: {fileID: 0}
1401-
- target: {fileID: 1045367076, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3}
1402-
propertyPath: m_AnchoredPosition.x
1403-
value: 0
1404-
objectReference: {fileID: 0}
1405-
- target: {fileID: 1045367076, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3}
1406-
propertyPath: m_AnchoredPosition.y
1407-
value: 0
1408-
objectReference: {fileID: 0}
14091361
- target: {fileID: 696252699284340127, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3}
14101362
propertyPath: m_Name
14111363
value: 'Prefab_ConnectWallet '
14121364
objectReference: {fileID: 0}
1413-
- target: {fileID: 1335404546759128317, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3}
1414-
propertyPath: m_AnchorMax.y
1415-
value: 0
1416-
objectReference: {fileID: 0}
1417-
- target: {fileID: 1335404546759128317, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3}
1418-
propertyPath: m_AnchorMin.y
1419-
value: 0
1420-
objectReference: {fileID: 0}
1421-
- target: {fileID: 1335404546759128317, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3}
1422-
propertyPath: m_SizeDelta.x
1423-
value: 0
1424-
objectReference: {fileID: 0}
1425-
- target: {fileID: 1335404546759128317, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3}
1426-
propertyPath: m_AnchoredPosition.x
1427-
value: 0
1428-
objectReference: {fileID: 0}
1429-
- target: {fileID: 1335404546759128317, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3}
1430-
propertyPath: m_AnchoredPosition.y
1431-
value: 0
1432-
objectReference: {fileID: 0}
1433-
- target: {fileID: 1335404547797609897, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3}
1434-
propertyPath: m_SizeDelta.y
1435-
value: 0
1436-
objectReference: {fileID: 0}
1437-
- target: {fileID: 6243171688188928066, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3}
1438-
propertyPath: m_AnchorMax.y
1439-
value: 0
1440-
objectReference: {fileID: 0}
1441-
- target: {fileID: 6243171688188928066, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3}
1442-
propertyPath: m_AnchorMin.y
1443-
value: 0
1444-
objectReference: {fileID: 0}
1445-
- target: {fileID: 6243171688188928066, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3}
1446-
propertyPath: m_SizeDelta.x
1447-
value: 0
1448-
objectReference: {fileID: 0}
1449-
- target: {fileID: 6243171688188928066, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3}
1450-
propertyPath: m_AnchoredPosition.x
1451-
value: 0
1452-
objectReference: {fileID: 0}
1453-
- target: {fileID: 6243171688188928066, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3}
1454-
propertyPath: m_AnchoredPosition.y
1455-
value: 0
1456-
objectReference: {fileID: 0}
14571365
- target: {fileID: 6539300962087038060, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3}
14581366
propertyPath: m_Pivot.x
14591367
value: 1

Assets/Thirdweb/Examples/Scripts/Prefabs/Prefab_ConnectWallet.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ public async void OnSwitchNetwork(Chain _chain)
187187
try
188188
{
189189
ThirdwebManager.Instance.chain = _chain;
190-
await ThirdwebManager.Instance.SDK.wallet.SwitchNetwork((int)_chain);
190+
await ThirdwebManager.Instance.SDK.wallet.SwitchNetwork(int.Parse(ThirdwebManager.Instance.supportedChainData[_chain].chainId));
191191
OnConnected();
192192
OnSwitchNetworkCallback?.Invoke();
193193
print($"Switched Network Successfully: {_chain}");
@@ -230,7 +230,7 @@ public void OnClickNetworkSwitch()
230230
GameObject networkButton = Instantiate(networkButtonPrefab, networkDropdown.transform);
231231
networkButton.GetComponent<Button>().onClick.RemoveAllListeners();
232232
networkButton.GetComponent<Button>().onClick.AddListener(() => OnSwitchNetwork(chain));
233-
networkButton.transform.Find("Text_Network").GetComponent<TMP_Text>().text = ThirdwebManager.Instance.supportedChainData[ThirdwebManager.Instance.chain].identifier;
233+
networkButton.transform.Find("Text_Network").GetComponent<TMP_Text>().text = ThirdwebManager.Instance.supportedChainData[chain].identifier;
234234
networkButton.transform.Find("Icon_Network").GetComponent<Image>().sprite = networkSprites.Find(x => x.chain == chain).sprite;
235235
}
236236
}

0 commit comments

Comments
 (0)