Adding SDK
Comment on page

Add MetaGameSwap SDK to your game

Integration documentation
Metgameswap Unity3D SDK Documentation
To integrate MetagameSwap SDK unity in Unity3d game project
First, download the Unity SDK for MetaGameSwap .
Import the SDK into your Unity project by opening the Unity editor and going to "Assets > Import Package > Custom Package." Select the downloaded SDK package and import it into your project.
Once the SDK is imported, add and extract all scripts to existing game project .
Initialize the MetaGameSwap SDK by calling the "MetaGameSwap.Initialize" method,
To display the MetaGameSwap marketplace in your game, call the "MetaGameSwap.ShowMarketplace()" method. You can also customize the appearance and behavior of the marketplace by using public functions attached to the prefab .
To handle transactions, use the "MetaGameSwap.OnTransactionComplete" event, which is triggered whenever a transaction is completed. The event provides information about the transaction, including the item purchased and the player's account information.
SDK Demo To see a demo of the MetaGameSwap Unity SDK in action, you can visit the MetaGameSwap demo page on itch.io. The demo is a sample Unity game that showcases the integration of the MetaGameSwap DEX and demonstrates the SDK's various features.
Go to https://metagameswap.itch.io/unity-sdk-megs Click on the "Play" button to start the demo.
SDK Github
To use the MetaDEX Unity SDK from its source code on GitHub, you will need to compile the code and import it into your Unity project : Clone the MetaDEX Unity SDK repository from GitHub by running the command "git clone https://github.com/defi-ventures/metadex-unity.git" in your command line. Open the Unity editor and create a new Unity project. In the Unity project, go to "Assets > Import Package > Custom Package" and select the "MetaDEX.unitypackage" file from the cloned repository. Import the package into your Unity project. Once the package is imported, you can access the SDK's classes and methods by using the "using MetaDEX;" namespace in your scripts. To build the project, you can go to "File > Build Settings" and select the platform you want to build for (e.g. Windows, iOS, Android). Click on the "Build" button and select the location where you want to save the build. The SDK is now integrated into your Unity project, you will be able to use it as described in the documentation of the library. !!! The SDK's source code is provided as-is and may require additional modifications or updates to work correctly with your Unity project. It is also important to note that there may be additional dependencies that need to be installed for the SDK to function properly.
SDK Data feed The MetaDEX Unity SDK allows you to integrate the MetaDEX exchange into your Unity 3D game. It connects to the hosted backend using API connectors to pull the data from MetaDEX servers to the SDK. This means that the SDK communicates with the MetaDEX servers using a set of API calls to retrieve information such as available aggregating Prices executing price calls and swaps etc... the SDK communicates with the hosted backend to retrieve data, so a stable internet connection is required to use the SDK. Also, the SDK is dependent on the data provided by the hosted backend, so the functionality and data may change in the future.
SDK Architecture
MetaGameSwap is a software development kit (SDK) that allows game developers to integrate decentralized exchange (DEX) functionality into their Unity3D game projects, using a DEX aggregator hosted on metagameswap.io. The SDK pulls data from the metagameswap.io website using API calls, allowing players to trade ERC20 tokens on 3 chains (BSC,ETH,Polygon) within the game. The proof-of-work involves the use of smart contracts on a blockchain network, such as Ethereum, to facilitate the NFT trading functionality and ensure the integrity of the data being pulled from the metagameswap.io website.
Unity3D Game Client: This is the game client that game developers integrate the MetaGameSwap SDK into. The SDK allows players to trade ERC20 tokens within the game. DEX Aggregator: Hosted on metagameswap.io, the DEX aggregator is responsible for pulling data from various decentralized exchanges (DEXs) on Binance Smart Chain (BSC), Ethereum, and Polygon. API: The SDK uses API calls to communicate with the DEX aggregator and pull data from the metagameswap.io website. Smart Contracts: Smart contracts are used on a blockchain network such as Ethereum to facilitate the ERC tokens trading functionality and ensure the integrity of the data being pulled from the metagameswap.io website. Blockchain Network: The blockchain network is responsible for maintaining the integrity of the data and facilitating the ERC tokens trading functionality through the use of smart contracts. Database: A database is used to store the data pulled from the metagameswap.io website and the blockchain network, to provide a record of the trades and transactions that take place through the MetaGameSwap SDK.
Last modified 4mo ago