Emergence serves as a Web3 SDK tailored for game developers, seamlessly integrating with Unreal Engine and Unity through.
It provides features such as:
Get the package on the Unity Asset Store
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}"); }}
Click here for the official documentation.