예제 #1
0
        private bool OpenWindow()
        {
            if (!prefabsValid && !CheckPrefabs())
            {
                return(false);
            }

            if (canvas == null)
            {
                canvas      = Instantiate(prefabCanvas).GetComponent <Canvas>();
                canvas.name = "Canvas SkywardFileBrowser";
            }
            if (window == null)
            {
                window = Instantiate(prefabWindow).GetComponent <SfbWindow>();
                window.transform.SetParent(canvas.transform, false);
                window.name = "Window";
                window.Init(this);
            }
            if (loadingAnimation == null)
            {
                loadingAnimation = Instantiate(prefabLoadingAnimation);
                loadingAnimation.transform.SetParent(window.transform, false);
                loadingAnimation.name = "LoadingAnimation";
                loadingAnimation.SetActive(false);
            }

            canvas.gameObject.SetActive(true);
            window.gameObject.SetActive(true);
            SetSelectedExtension();

            return(true);
        }
예제 #2
0
        private bool OpenWindow()
        {
            if (!prefabsValid && !CheckPrefabs()) {
                return false;
            }

            if (canvas == null) {
                canvas = Instantiate(prefabCanvas).GetComponent<Canvas>();
                canvas.name = "Canvas SkywardFileBrowser";
            }
            if (window == null) {
                window = Instantiate(prefabWindow).GetComponent<SfbWindow>();
                window.transform.SetParent(canvas.transform, false);
                window.name = "Window";
                window.Init(this);
            }
            if (loadingAnimation == null) {
                loadingAnimation = Instantiate(prefabLoadingAnimation);
                loadingAnimation.transform.SetParent(window.transform, false);
                loadingAnimation.name = "LoadingAnimation";
                loadingAnimation.SetActive(false);
            }

            canvas.gameObject.SetActive(true);
            window.gameObject.SetActive(true);
            SetSelectedExtension();

            return true;
        }