Importing Nethereum in Unity
Connect Unity games to the Ethereum blockchain
This tutorial will import Nethereum to Unity and fetch the current block number.
- Download/Create Unity project
- Download Nethereum
- Import Nethereum in Unity
- Fetch current block height
Install Unity: https://unity.com/
Create a new Unity project.
There are a few ways to use the Nethereum library. This example will download the
.dll from Github.
If you encounter errors later on, remove
Drag the folder into your Unity project under Assets. Feel free to rename the folder. The Nethereum library is now available.
Fetch Block Number
For demonstration purposes, create a script in the
Open the script
Update the script
Click Play and check the Console!
This article lays the foundation for more complex interactions such as sending and interacting with smart contracts. For another working example, check
This sample demonstrates how to transfer Ether and the interaction with as smart contract (in this scenario an ERC20…