Skip to content

Commit 92c86c0

Browse files
authored
Prefab Docs (#20)
1 parent a4b2dfe commit 92c86c0

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

README.md

+29
Original file line numberDiff line numberDiff line change
@@ -71,4 +71,33 @@ var address = await sdk.deployer.DeployNFTCollection(new NFTContractDeployMetada
7171
});
7272
```
7373

74+
# Prefabs
75+
76+
The `Examples` folder contains a demo scene using our user-friendly prefabs, check it out!
77+
78+
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.
79+
80+
[Connect Wallet Prefab](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!
81+
- Drag and drop it into your scene and select the wallet providers you want to support from the Inspector.
82+
- You may also choose whether you want to activate the Network Switching feature (leave unchecked if your app only requires one network).
83+
84+
[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!
85+
- Go to the prefab's Settings in the Inspector.
86+
- Load specific NFTs with token ID.
87+
- Load a specific range of NFTs.
88+
- Load NFTs owned by a specific wallet.
89+
- Or any combination of the above - they will all be displayed automatically in a grid view with vertical scroll!
90+
- Customize the prefab's ScrollView and Content gameobjects if you want your content to behave differently.
91+
92+
[NFT Prefab](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!
93+
- Instantiate this Prefab through script.
94+
- Get its Prefab_NFT component.
95+
- Call the LoadNFT function and pass it your NFT struct to display your fetched NFT's images automatically.
96+
- Customize the prefab to add text/decorations and customize LoadNFT to use your NFT's metadata if you want to populate that text.
97+
```csharp
98+
NFT nft = await contract.ERC721.Get(0);
99+
Prefab_NFT nftPrefabScript = Instantiate(nftPrefab);
100+
nftPrefabScript.LoadNFT(nft);
101+
```
102+
74103
See full documentation on the [thirdweb portal](https://portal.thirdweb.com).

0 commit comments

Comments
 (0)