You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+13-1Lines changed: 13 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -33,6 +33,7 @@ Note: The Newtonsoft DLL is included as part of the Unity Package, feel free to
33
33
# Build
34
34
35
35
## WebGL
36
+
36
37
- Open your `Build settings`, select `WebGL` as the target platform.
37
38
- Open `Player settings` > `Resolution and Presentation` and under `WebGLTemplate` choose `Thirdweb`.
38
39
- Save and click `Build and Run` to test out your game in a browser.
@@ -42,11 +43,13 @@ If you're uploading your build, set `Compression Format` to `Disabled` in `Playe
42
43
Note that in order to communicate with the SDK on WebGL, you need to `Build and run` your project so it runs in a browser context.
43
44
44
45
## Other Platforms
46
+
45
47
- Requires a ThirdwebManager prefab in your scene.
46
48
- Use IL2CPP over Mono when possible in the Player Settings.
47
49
- Use Smaller (faster) Builds in the Build Settings.
48
50
- Using the SDK in the editor (pressing Play) is an accurate reflection of what you can expect to see on native platforms.
49
51
- If using prefabs, use Prefab_ConnectWalletNative instead of Prefab_ConnectWallet.
52
+
- If building to mobile and running into RPC issues, it is best to run Force Resolve from the Assets menu > External Dependency Manager > Android Resolver > Force Resolve for example.
50
53
51
54
# Usage
52
55
@@ -90,11 +93,13 @@ The `Examples` folder contains a demo scene using our user-friendly prefabs, che
90
93
All Prefabs require the [ThirdwebManager](https://github.com/thirdweb-dev/unity-sdk/blob/main/Assets/Thirdweb/Examples/Scripts/Prefabs/ThirdwebManager.cs) prefab to get the SDK Instance, drag and drop it into your scene and select the networks you want to support from the Inspector.
91
94
92
95
[Connect Wallet](https://github.com/thirdweb-dev/unity-sdk/blob/main/Assets/Thirdweb/Examples/Scripts/Prefabs/Prefab_ConnectWallet.cs) - All-in-one drag & drop wallet supporting multiple wallet providers, network switching, balance displaying and more!
96
+
93
97
- Drag and drop it into your scene and select the wallet providers you want to support from the Inspector.
94
98
- You may also choose whether you want to activate the Network Switching feature (leave unchecked if your app only requires one network).
95
99
- You can add callbacks from the inspector for when the wallet is connected, disconnected, fails to connect or disconnect.
- All-in-one drag & drop wallet supporting WalletConnect and Device Wallets (with or without passwords)
99
104
- Drag and drop it into your scene and select the wallet options you want to provide (recommend using only one).
100
105
- For device wallets, exporting will open the local encrypted keystore file on Standalone platforms (Application.persistentDataPath/account.json)
@@ -104,6 +109,7 @@ All Prefabs require the [ThirdwebManager](https://github.com/thirdweb-dev/unity-
104
109
- You can add callbacks from the inspector for when the wallet is connected, disconnected, fails to connect or disconnect.
105
110
106
111
[NFT Loader](https://github.com/thirdweb-dev/unity-sdk/blob/main/Assets/Thirdweb/Examples/Scripts/Prefabs/Prefab_NFTLoader.cs) - Standalone drag & drop grid/scroll view of NFTs you ask it to display!
112
+
107
113
- Go to the prefab's Settings in the Inspector.
108
114
- Load specific NFTs with token ID.
109
115
- Load a specific range of NFTs.
@@ -112,37 +118,43 @@ All Prefabs require the [ThirdwebManager](https://github.com/thirdweb-dev/unity-
112
118
- Customize the prefab's ScrollView and Content gameobjects if you want your content to behave differently.
113
119
114
120
[NFT](https://github.com/thirdweb-dev/unity-sdk/blob/main/Assets/Thirdweb/Examples/Scripts/Prefabs/Prefab_NFT.cs) - Displays an NFT by calling LoadNFT through script!
121
+
115
122
- Instantiate this Prefab through script.
116
123
- Get its Prefab_NFT component.
117
124
- Call the LoadNFT function and pass it your NFT struct to display your fetched NFT's images automatically.
118
125
- Customize the prefab to add text/decorations and customize LoadNFT to use your NFT's metadata if you want to populate that text.
126
+
119
127
```csharp
120
128
NFTnft=awaitcontract.ERC721.Get(0);
121
129
Prefab_NFTnftPrefabScript=Instantiate(nftPrefab);
122
130
nftPrefabScript.LoadNFT(nft);
123
131
```
124
132
125
133
[Events](https://github.com/thirdweb-dev/unity-sdk/blob/main/Assets/Thirdweb/Examples/Scripts/Prefabs/Prefab_Events.cs) - Fetch and manipulate Contract Events with a simple API!
134
+
126
135
- Get specific events from any contract.
127
136
- Get all events from any contract.
128
137
- Event listener support with callback actions.
129
138
- Optional query filters.
130
139
131
140
[Reading](https://github.com/thirdweb-dev/unity-sdk/blob/main/Assets/Thirdweb/Examples/Scripts/Prefabs/Prefab_Reading.cs) - Reading from a contract!
141
+
132
142
- Fetch ERC20 Token(s).
133
143
- Fetch ERC721 NFT(s).
134
144
- Fetch ERC1155 NFT(s).
135
145
- Fetch Marketplace Listing(s).
136
146
- Fetch Pack contents.
137
147
138
148
[Writing](https://github.com/thirdweb-dev/unity-sdk/blob/main/Assets/Thirdweb/Examples/Scripts/Prefabs/Prefab_Writing.cs) - Writing to a contract!
149
+
139
150
- Mint ERC20 Token(s).
140
151
- Mint ERC721 NFT(s).
141
152
- Mint ERC1155 NFT(s).
142
153
- Buy Marketplace Listing(s).
143
154
- Buy a Pack.
144
155
145
156
[Miscellaneous](https://github.com/thirdweb-dev/unity-sdk/blob/main/Assets/Thirdweb/Examples/Scripts/Prefabs/Prefab_Miscellaneous.cs) - More examples!
0 commit comments