private void CreateWrapper(SfbSavedLocationEntry entry)
        {
            var wrapper = SfbEntryWrapper.CreateEmpty((entryPrefabs.First(a => a.type == entry.type.Convert()).transform as RectTransform).rect.height);

            wrapper.fileSystemEntry = entry;
            wrapper.rectTransform.SetParent(content, false);
            wrapper.parent = this;
            wrappers.Add(wrapper);
        }
예제 #2
0
        private void CreateWrappers(IEnumerable <SfbFileSystemEntry> entries)
        {
            wrappers.Clear();

            foreach (var entry in entries)
            {
                var entry1  = entry;
                var wrapper = SfbEntryWrapper.CreateEmpty((entryPrefabs.First(a => a.type == entry1.type.Convert()).transform as RectTransform).rect.height);
                wrapper.fileSystemEntry = entry;
                wrapper.rectTransform.SetParent(content, false);
                wrapper.parent = this;
                wrappers.Add(wrapper);
            }
        }
        private void AddHeader(SfbEntryType type)
        {
            var go      = Instantiate(entryPrefabs.First(a => a.type == type).gameObject);
            var wrapper = SfbEntryWrapper.CreateEmpty((go.transform as RectTransform).rect.height);

            wrapper.transform.SetParent(content, false);
            wrapper.parent       = this;
            wrapper.interactable = false;
            wrappers.Add(wrapper);

            go.name = type.ToString().Replace("Header", "") + ":";
            go.transform.SetParent(wrapper.transform, false);
            go.GetComponentInChildren <Text>().text = type.ToString().Replace("Header", "") + ":";

            var entry = go.GetComponent <SfbEntry>();

            entry.wrapper        = wrapper;
            wrapper.BrowserEntry = entry;
        }