LYNC
Search
K
Comment on page

Metamask Wallet

Integrate Metamask Wallet into game engine
LYNC Metamask Wallet SDK is a one-stop solution for game developers to easily integrate Metamask into their game engine and deploy their game on multiple networks with just a few clicks. This SDK allows game developers to monitor gamers’ data via LYNC analytics system and update the SDK without leaving the game engine.
Integrate Metamask wallet inside any game using LYNC SDK

Get Your API Key

Please get your API key before downloading the SDK from here

Installation

Download the LYNC - Metamask Wallet SDK from here
Import the SDK .unitypackage file to your project. or simply drag and drop .unitypackage file to your project.
Assets -> Import Package -> Custom Package
Once the Metamask Wallet SDK package has finished importing into your Unity project, you can begin integrating it into your game. To do this, open the ConnectWallet scene provided by the LYNC - Metamask SDK. Path : Assets ->LYNC-Metamask-SDK -> Scenes
Assets ->LYNC-Metamask-SDK -> Scenes

Choose blockchain network

If you haven't generated an API Key, please check Get Your API Key
the After opening ConnectWallet scene, Go to Interface. In the "Inspector" window, go to the API key & Enter the API key.
To choose the blockchain network, simply go to the CurrentChain drop-down menu and pick the network of your preference to deploy your game on.
Interface -> CurrentChain -> Choose Your Chain

Integrating ConnetWallet scene into the build

To deploy your Unity project, it's necessary to set up the Player Settings in Unity. Follow these steps to select the LYNC WebGL template.
File -> Build Settings
In the "Build Settings" window, place ConnectWallet and FetchWallet at the top of this section.
Add ConnectWallet & FetchWallet Scene to the top of Scenes in Build
Go to "Player Settings" and navigate to "Resolution and Presentation". Select LYNC - Template in WebGL Template
Player Settings -> Resolution and Presentation -> Select LYNC - Template
After completing all the necessary steps and configuring the Player Settings with the LYNC WebGL template, you can now build and run your game.
  • To do this, go to "File" on the top menu bar in the Unity editor and select "Build and Run."
Build and Run
Congratulation, you have successfully integrated the Metamask wallet with your favourite blockchain network using LYNC SDK. NOTE: If you wish to use wallet address inside game after user's wallet is connected, use:
PlayerPrefs.GetString("WalletAddress");
If you face any error, while Build and Run. PLEASE ADD, Unity package install by git link com.unity.nuget.newtonsoft-json