Beispiel #1
0
        /// <inheritdoc/>
        protected override void UpdateViewsHolder(FileSystemEntryViewsHolder newOrRecycled)
        {
            // Initialize the views from the associated model
            FileSystemEntryModel model = _Params.flattenedVisibleHierarchy[newOrRecycled.ItemIndex];

            newOrRecycled.UpdateViews(model);
        }
Beispiel #2
0
        public void UpdateViews(FileSystemEntryModel model)
        {
            titleText.text = model.title;
            bool isDir = model.IsDirectory;

            foldoutButton.interactable = isDir;
            _DirectoryIconImage.gameObject.SetActive(isDir);
            _FileIconImage.gameObject.SetActive(!isDir);
            foldoutArrowImage.gameObject.SetActive(isDir);
            if (isDir)
            {
                foldoutArrowImage.rectTransform.localRotation = Quaternion.Euler(0, 0, model.expanded ? -90 : 0);
            }

            _RootLayoutGroup.padding.left = 25 * model.depth;             // the higher the depth, the higher the padding
        }