Unity Tiles Chain EVM Sample

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.

Game instructions

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.

Development

1. Run your own DappChain

Please consult the Loom SDK docs for further instructions on running your own DappChain.

2. Download the example project (Tiles Chain EVM)

git clone https://github.com/loomnetwork/unity-tiles-chain-evm

3. Start the DappChain local node

Open a console.

cd unity-tiles-chain-evm
cd DAppChain

# Configure and Run
./start-chain.sh

4. Build and Deploy with Truffle

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.

5. Build the Unity client

  1. Open the Unity project located in UnityClient.
  2. Open the LoomTilesChainEvm scene.
  3. Select the Controller object and copy the deployed contract address into the ContractAddressHex field.
  4. Run the scene to check if everything works, and build the project.

Loom Network

https://loomx.io

License

MIT