コード例 #1
0
        public void RemovePage(int index, RectTransform page)
        {
            FileSelectorPage fileSelectorPage = page.GetComponent <FileSelectorPage>();

            fileSelectorPage.Reset();
            PagePool.Return(page.gameObject);
        }
コード例 #2
0
        public override void ApplyEffect(BaseScrollEffect.UpdateData updateData)
        {
            FileSelectorPage page = updateData.page.GetComponent <FileSelectorPage>();

            if (page != null)
            {
                page.IsInTransition = updateData.moveDistance < maxMoveDistance;
            }
        }
コード例 #3
0
        public RectTransform ProvidePage(int index)
        {
            Debug.Log("5555555555555555555555ProvidePageindex" + index);
            GameObject    pageObj = PagePool.Borrow();
            RectTransform page    = pageObj.GetComponent <RectTransform>();

            Vector2 middleAnchor = new Vector2(0.5f, 0.5f);

            page.anchorMax = middleAnchor;
            page.anchorMin = middleAnchor;

            FileSelectorPage fileSelectorPage = page.GetComponent <FileSelectorPage>();
            int maxChildrenPerPage            = MaxChildrenPerPage;
            int startingChildIndex            = index * maxChildrenPerPage;
            int childIndex = startingChildIndex;

            Debug.Log("directories.Length" + directories.Length + "files.Length" + files.Length);
            while (childIndex < startingChildIndex + maxChildrenPerPage && childIndex < childCount)
            {
                FileSelectorTile tile;
                if (childIndex < directories.Length)
                {
                    Debug.Log("directories[childIndex]:name" + directories[childIndex].name);
                    tile = fileSelectorPage.AddDirectoryTile(directories[childIndex]);
                    tile.SetToDirectory(directories[childIndex]);
                    tile.OnDirectorySelected += OnDirectorySelected;
                }
                else
                {
                    int fileIndex = childIndex - directories.Length;
                    tile = fileSelectorPage.AddFileTile(files[fileIndex], fileIndex);
                    tile.OnFileSelected += OnFileSelected;
                }

                childIndex++;
            }

            return(page);
        }