Skip to content

underscoredLabs/web3-webgl-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

web3-webgl-template

Article: https://medium.com/@leondo/unity-engine-metamask-wallet-6797d4699e45

Automagically connect your Unity game to Metamask

Screen Shot 2020-10-19 at 9 53 06 PM

How to use

Create a folder called WebGLTemplates under /Assets

Download Web3Template from here and paste under WebGLTemplates

Screen Shot 2020-10-19 at 9 52 00 PM

In Unity

Screen Shot 2020-10-19 at 9 42 27 PM

Change template

Screen Shot 2020-10-19 at 9 41 36 PM

Build as webgl

Under the hood

// Web3Template/TemplateData/web3Connect.js

if (window.ethereum) {
  web3 = new Web3(window.ethereum);
  // connect popup
  ethereum.enable();
} else {
  alert("Non-Ethereum browser detected. Please connect to a wallet");
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published