Current Version
Last updated
Last updated
On the top bar in unity, navigate to Window
-> Package Manager
-> Gear icon
-> Advanced Project Settings
.
Add a new scoped registry or edit the existing OpenUPM entry if it's already there.
Save the following details to the scope:
Name: package.openupm.com
Scope: io.chainsafe.web3-unity
Add a new package by name by pressing + ->
Add package by name io.chainsafe.web3-unity
& io.chainsafe.web3-unity.web3auth
.
Next go to the web3.unity SDK package and install the examples by going to the samples tab and pressing import.
Please note that unity versions 2021 and below may require a restart if you experience assembly errors.
Updating the SDK is easy. Simply go to window
-> package manager
-> select the ChainSafe SDK package
& press update
. The same can be done for any additional packages you have installed, web3auth, loot boxes etc.
As the package is installed, you'll be prompted with the settings window. First of all you have to set up your Project ID
. You can get one here.
For more information on Project ID, see Project ID Registration.
After you've completed the registration process, copy your Project ID
into the project settings window. Save settings. You should see a message in the console saying your Project ID
is valid.
If the Settings do not appear, please restart the project and they should appear under the windows tab.
You need to set up default settings for the RPC node you're going to use for the Cronos chain.
Chain ID - 25
Chain name - Cronos
Network - Mainnet
Symbol - CRO
RPC - https://evm-dev.cronos.org
If you navigate to Window -> Package Manager -> Web3Unity SDK -> Samples, you can import an example package to help you understand the SDK. Press import and let it load into the project. You'll see some new files in your project under samples, these files contain everything we need to get started with the SDK. Have a look around, check out the script and the scene locations.
You'll notice when you import the samples into the project that some scenes are added to your build configuration. This is to show you a demo of how all the functions in the SDK work. Simply go to the sample log in scene and press play to connect a wallet to get started with some examples.
Once you've logged in it will take you to the main scene. You can play around in the menus and check out each script's functionality by pressing the show script button, this will highlight the script in the editor and allow you to inspect it further. If you're an advanced developer you should have enough to work with from the sample scripts in front of you. If you're just beginning we suggest you take a look at our easy to use prefabs below.
This is a Cheat Sheet which can be used as a shorthand reference for the new ways of accomplishing tasks with the SDK. Refer to this if you need help with the new code structure.
For Additional configuration, please refer to the official Chainsafe Documentation here.