Skip to content

Emergence SDK

Emergence serves as a Web3 SDK tailored for game developers, seamlessly integrating with Unreal Engine and Unity through.

It provides features such as:

  • wallet authentication
  • smart contracts calls
  • NFT inventory services

Implementation Example

  1. Package Install

    Get the package on the Unity Asset Store

  2. Contract Call
    public class NFTMint : MonoBehaviour
    {
    public DeployedSmartContract deployedSmart;
    // Public string array that is used as input data for the smart contract method
    private string[] body = new string[] { "0x...SomeAddress" };
    // Public string that is used as input data for the smart contract method
    private string value = "0";
    private IContractService ContractService => contractService ??= EmergenceServices.GetService<IContractService>();
    private IContractService contractService;
    private void Awake()
    {
    // contractService = EmergenceServices.GetService<IContractService>();
    }
    // Start is called before the first frame update
    void Start()
    {
    WriteMethod();
    }
    // This method is called once the contract is loaded
    private void WriteMethod()
    {
    // Creates a ContractInfo object with the smart contract address, method name, network name, and default node URL
    var contractInfo = new ContractInfo(deployedSmart, "safeMint");
    ContractService.WriteMethod(contractInfo, "", "100000", value, body, OnWriteSuccess, EmergenceLogger.LogError);
    }
    private void OnWriteSuccess(BaseResponse<string> response)
    {
    // Logs the response to the console
    Debug.Log($"{response}");
    }
    }

Additional Emergence SDK Documentation

Click here for the official documentation.