Beispiel #1
0
    public IEnumerator GetSceneLoadProgress()
    {
        for (int i = 0; i < scenesLoading.Count; i++)
        {
            while (!scenesLoading[i].isDone)
            {
                totalSceneProgress = 0;
                foreach (AsyncOperation operation in scenesLoading)
                {
                    totalSceneProgress += operation.progress;
                }

                totalSceneProgress = (totalSceneProgress / scenesLoading.Count) * 100.0f;

                progressBar.SetCurrentFill(Mathf.RoundToInt(totalSceneProgress), 0, 100);
                yield return(null);
            }
        }

        loadingCamera.gameObject.SetActive(false);

        //Try to get animator
        JUCLUIAnimator animator = loadingScreen.GetComponent <JUCLUIAnimator>();

        //If animator is present
        if (animator != null)
        {
            //Run disable animation
            animator.Disable();
        }
        else
        {
            //Disable body window
            loadingScreen.SetActive(false);
        }
    }
Beispiel #2
0
    void SetStatusUIElement(GameObject UIElement, bool status)
    {
        //Try to get animator
        JUCLUIAnimator animator = UIElement.GetComponent <JUCLUIAnimator>();

        //If animator is present
        if (animator != null)
        {
            //Run disable animation
            if (status == true)
            {
                animator.Show();
            }
            else
            {
                animator.Disable();
            }
        }
        else
        {
            //Disable body window
            UIElement.SetActive(status);
        }
    }