public void OnDestroy() { if (instance == this) { instance = null; } }
void Start() { if (instance == null) { instance = this; } // retrieve the url from the Wallet Manager _url = "https://ropsten.infura.io"; TokenInfo.symbol = "???"; TokenInfo.decimals = 18; // add default values. TODO: make sure these are populated before checking balance // Here we assign the contract as a new contract and we send it the ABI and contact address this.contract = new Contract(null, ABI, TokenContractAddress); //WalletManager.Instance.LoadingIndicator.SetActive(true); StartCoroutine(GetTokenInfo()); }
void Awake() { if (instance == null) { instance = this; WalletManager wallet = gameObject.GetComponent <WalletManager>(); wallet.SetInstance(); } // retrieve the url from the Wallet Manager Debug.Log(WalletManager.Instance); _url = WalletManager.Instance.networkUrl; TokenInfo.symbol = "???"; TokenInfo.decimals = 18; // add default values. TODO: make sure these are populated before checking balance // Here we assign the contract as a new contract and we send it the ABI and contact address this.contract = new Contract(null, ABI, TokenContractAddress); WalletManager.Instance.AddInfoText("[Loading Token Info...]", true); WalletManager.Instance.LoadingIndicator.SetActive(true); StartCoroutine(GetTokenInfo()); }