public void ShowProgressCorrectly()
        {
            IUnpublishPopupView iview = view;

            iview.SetProgress("", 0);
            Assert.AreEqual("0%", view.loadingText.text);
            iview.SetProgress("", 0.5f);
            Assert.AreEqual("50%", view.loadingText.text);

            Assert.IsTrue(view.loadingBarContainer.gameObject.activeSelf);
            Assert.IsFalse(view.cancelButton.gameObject.activeSelf);
            Assert.IsFalse(view.unpublishButton.gameObject.activeSelf);
            Assert.IsFalse(view.infoText.gameObject.activeSelf);
            Assert.IsFalse(view.doneButton.gameObject.activeSelf);
            Assert.IsFalse(view.errorText.gameObject.activeSelf);
            Assert.IsFalse(view.closeButton.gameObject.activeSelf);
        }
Exemplo n.º 2
0
    IEnumerator ProgressRoutine()
    {
        float progress = 0;

        while (true)
        {
            progress = Mathf.Clamp(progress + UnityEngine.Random.Range(0.01f, 0.03f), 0, 0.99f);
            view.SetProgress(PROGRESS_TITLE, progress);
            yield return(new WaitForSeconds(UnityEngine.Random.Range(0f, 0.5f)));
        }
    }