josesaribeiro / nftport-unity

๐ŸŽฎ ๐Ÿ•น ๐ŸŽฒ Unity3D SDK to integrate everything NFT's crosschain at lightning speed!

Home Page:https://discord.gg/w92sXkNmBR

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

alt text

chat follow on Twitter

Getting Started:

  • Get your API keys: Your API requests are authenticated using API keys. You can get your free API key by signing up for an NFTPort account.

  • Download Unity 2020.3.18f here

    SDK is made using Unity 2020.3.18f , however is compatible with other versions as well. We'll be working towards Unity Asset Store release to make process easier.

  • Download the NFTPort extension:


First steps inside Unity:

  • Setup your NFTPort API Key in Window / NFTPort


*The best way to learn is by doing! We've provided a basic demo scene for play in demo.cs.


Quickstart via NFTPort_Interface.cs:

Add NFTPort_Interface.cs in your scene.


NFTPort_Interface provides a globally accessible class which routes into individual components. You can only have one of this in your scene, other instances will get deleted at runtime. Adding NFTPort_Interface.cs will automatically add other required components.

In your script, include NFTPort:

using NFTPort;

Usage

Getting All Addresses Of an NFT:

NFTPort_Interface.Instance.NFTsOfAccount(addressString);

Getting All NFT's of a Contract:

NFTPort_Interface.Instance.NFTsFromContract(ContractString);

Easy Mint NFT via URL:

NFTPort_Interface.Instance.Mint(FileUrlString, AddressString, NFTMintNameString);

Retrieve NFTDetails:

NFTPort_Interface.Instance.NFTDetails(ContractString, TokenIdString);

If you do not need to change chain ID at runtime, you can get most done by above and set the chain ID and include parameters in the inspector on individual components.

When you call general functions above using NFTPort_Interface.cs, the data gets sorted according to each NFT and populated in model of the following individual components below it, as seen in Unity Inpector Window. Any further actions utilising this data can be refrenced from these scripts. You can also link events from these individual components (view editor window of components(on object NFTPort) in demo scene and demo.cs)

NFTsOwnedbyanAccount._ownedbyAddressModel.nfts[i].name;

Individual Components:

Use Fetched Data : Modify chains, ID , Settings and more:

NFTs_ownedbyanAccount.cs

Component provides All NFT's owned by the account.

Setting up Variables and Run()

These can be setup directly through inspector. For Runtime or setting up through script following can be used by refrencing the component, in this example as : _NFTsOwnedbyanAccount .

_NFTsOwnedbyanAccount.Address = "0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B";
_NFTsOwnedbyanAccount.chain = "ethereum";
_NFTsOwnedbyanAccount.include = "all";
_NFTsOwnedbyanAccount.Run();

Any events after a successful fetch can be done via:

Other Individual components can be used in similar fashion.

Whats next?

Time to BUIDL.

we will be iterating this extension and this is meant to provide a starter pack and tools in your journey with NFTPort and Unity3D. NFT's and GameEngines opens up a huge metaverse of creativity where possibilities are endless! What will you build?

NFTPort has a number of api endpoints available at: https://docs.nftport.xyz/docs/nftport

Join the community :

Get support, showcase your work, share your thoughts and feedback, and engage in a vibrant community at: https://discord.gg/w92sXkNmBR

for your gaming endeavors, get in touch at sahaj@nftport.xyz

About

๐ŸŽฎ ๐Ÿ•น ๐ŸŽฒ Unity3D SDK to integrate everything NFT's crosschain at lightning speed!

https://discord.gg/w92sXkNmBR


Languages

Language:ShaderLab 65.6%Language:C# 23.0%Language:HLSL 11.4%