using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UIElements; //using Nethereum.JsonRpc.UnityClient; using System; using Nethereum.Hex.HexTypes; using System.Numerics; using ERC721ContractLibrary.Contracts.ERC721PresetMinterPauserAutoId.ContractDefinition; using Nethereum.Unity.Metamask; using Nethereum.Unity.Contracts; using Nethereum.Contracts; using Nethereum.Unity.Contracts.Standards.ERC721; using Nethereum.Contracts.Standards.ERC721; using Nethereum.Unity.Utils.Drawing; using Nethereum.Unity.Rpc; using Nethereum.Metamask; //Test external contract 0x345c2fa23160c63218dfaa25d37269f26c85ca47 //0x2002050e7084f5db6ac4e81d54fbb6b35c257592 address //This is example uses coroutines, you can use the async await pattern if you prefer using the WebglThreadPatcher and vanilla Nethereum //Check the https://github.com/Nethereum/Unity3dSampleTemplate for more examples using the async await pattern public class MetamaskController : MonoBehaviour { private Button _btnMetamaskConnect; private Button _btnDeployNFTContract; private Button _btnViewNFTs; private Button _btnMintNFT; private Label _lblAccountSelected; private Label _lblError; private ListView _lstViewNFTs; private TextField _txtSmartContractAddress; private string _selectedAccountAddress; // = "0x12890D2cce102216644c59daE5baed380d84830c"; private bool _isMetamaskInitialised= false; private BigInteger _currentChainId; //444444444500; private string _currentContractAddress; // = "0x32eb97b8ad202b072fd9066c03878892426320ed"; void Start() { var root = GetComponent().rootVisualElement; _lblAccountSelected = root.Q