コード例 #1
0
        public static List <string> GetSceneLoaderPaths(SceneLoadScene loader)
        {
            var result = new List <string>();

            loader.SafeProc(l => result.AddRange(SceneLoadSceneListPathGetter.Value(loader)));
            return(result);
        }
コード例 #2
0
        private static void OnFolderChanged()
        {
            _currentRelativeFolder = _folderTreeView.CurrentRelativeFolder;

            _studioInitObject.SafeProc(sls =>
            {
                sls.OnClickCancel();
                sls.InitInfo();
                sls.SetPage(SceneLoadScene.page);
            });
        }
コード例 #3
0
        internal IEnumerator ScrollToLastLoadedSceneCoroutine(SceneLoadScene sceneLoadScene)
        {
            yield return(null);

            if (sceneLoadScene == null)
            {
                yield break;
            }
            var lastLoadedScene = GetLastLoadedScene();
            var page            = Math.Max(0, GetLoaderPageForImage(lastLoadedScene));

            SetPage(page, sceneLoadScene);

            if (sceneLoadScene == null || page == 0)
            {
                yield break;
            }


            sceneLoadScene.SafeProc(sls => sls.GetComponentsInChildren <ScrollRect>().SafeProc(0, r =>
            {
                var buttonHeight    = -1f;
                var scrollBarHeight = -1f;


                r.GetComponentsInChildren <Button>().SafeProc(0,
                                                              b => b.GetComponent <RectTransform>().SafeProc(rt => buttonHeight = rt.rect.height));
                r.verticalScrollbar.SafeProc(
                    sb => sb.GetComponent <RectTransform>().SafeProc(rt => scrollBarHeight = rt.rect.height));
                float scrollPos;
                if (buttonHeight > 0f && scrollBarHeight > 0f)
                {
                    scrollPos = 1.0f - Mathf.Max(0f, (buttonHeight * (page - 1)) - scrollBarHeight);
                }
                else
                {
                    scrollPos = 1.0f - ((GetPage() + 1f) / GetNumPages(sls));
                }

                r.verticalScrollbar.SafeProc(sb => sb.value = scrollPos);
            }));
        }