A basic example showcasing a simple Unity game interacting with an EVM-based Loom DappChain, using Loom Unity SDK.
It uses Truffle
and Loom Truffle Provider for deployment and contract testing.
Use the mouse cursor to click on the black canvas area to create colored tiles, each new player will have a different color the canvas which is shared amongst all players.
Please consult the Loom SDK docs for further instructions on running your own DappChain.
git clone https://github.com/loomnetwork/unity-tiles-chain-evm
Open a console.
cd unity-tiles-chain-evm
cd DAppChain
# Configure and Run
./start-chain.sh
Open another console.
cd unity-tiles-chain-evm
cd TruffleProject
# Restore packages
npm install
# Build and copy contract ABI into Unity project
npm run build
# Deploy to local node
npm run deploy
After deployment, take note of the address of the deployed contract.
- Open the Unity project located in
UnityClient
. - Open the
LoomTilesChainEvm
scene. - Select the
Controller
object and copy the deployed contract address into theContractAddressHex
field. - Run the scene to check if everything works, and build the project.
MIT