예제 #1
0
        /// <summary>
        /// Waits one second, and then checks if the idle time has been met, if not, it continues
        /// </summary>
        /// <returns> Returns one WaitForSeconds </returns>
        private IEnumerator CheckIfIdle()
        {
            yield return(waiter);

            if (SecurePlayerPrefs.GetBool(PlayerPrefConstants.SETTING_IDLE_TIMEOUT) && uiManager.ActiveMenuType != typeof(ReEnterPasswordMenu))
            {
                if (previousMousePosition == Input.mousePosition)
                {
                    if ((currentIdleTime / 60) == SecurePlayerPrefs.GetInt(PlayerPrefConstants.SETTING_IDLE_TIME))
                    {
                        popupManager.CloseAllPopups();
                        uiManager.OpenMenu <ReEnterPasswordMenu>();
                        currentIdleTime = 0;
                    }
                    else
                    {
                        currentIdleTime++;
                    }
                }
                else
                {
                    currentIdleTime = 0;
                }
            }

            previousMousePosition = Input.mousePosition;

            if (!stopped)
            {
                CheckIfIdle().StartCoroutine();
            }
        }
예제 #2
0
    /// <summary>
    /// Disposes of all necessary components before switching to the ChooseWalletMenu.
    /// </summary>
    public void Logout()
    {
        dynamicDataCache.ClearAllData();
        disposableComponentManager.Dispose();
        popupManager.CloseAllPopups();

        uiManager.OpenMenu <ChooseWalletMenu>();
    }
예제 #3
0
    /// <summary>
    /// Sets up the actions which will be called once the wallet is loaded.
    /// </summary>
    /// <param name="onWalletLoaded"> Action to call once the wallet is loaded. </param>
    private void SetupLoadActions(Action onWalletLoaded)
    {
        this.onWalletLoaded = () =>
        {
            popupManager.CloseAllPopups();
            onWalletLoaded?.Invoke();

            GC.Collect(); // Collect any remnants of important data
        };
    }
    /// <summary>
    /// Starts to load the tokens which were put in queue earlier.
    /// Also adds the first TradableAsset which would be the EtherAsset.
    /// </summary>
    /// <param name="onTokensLoaded"> Action to call once the tokens have finshed loading. </param>
    public void StartTokenLoad(Action onTokensLoaded)
    {
        var popup = popupManager.GetPopup <LoadingPopup>();

        if (popup != null)
        {
            popup.Text = "Loading wallet";
        }

        Action onLoadFinished = (() => popupManager.CloseAllPopups()) + onTokensLoaded;

        new EtherAsset(asset => UpdateTradableAssets(asset, () => LoadToken(0, onLoadFinished)), tradableAssetImageManager, userWalletManager);
    }