Example #1
0
 public void DeselectItem()
 {
     if (selectedItem != null)
     {
         selectedItem.thumbnail.color = Color.white;
         selectedItemOptions.SetActive(false);
         selectedItem = null;
     }
 }
Example #2
0
        public void SelectItem(BrowserItem item)
        {
            if (selectedItem != null)
            {
                DeselectItem();
            }

            selectedItem = item;
            selectedItem.thumbnail.color = selectedUIColor;
            selectedItemName.text        = Path.GetFileNameWithoutExtension(item.meshPath);
            selectedItemThumb.texture    = item.thumbnail.texture;
            selectedItemOptions.SetActive(true);
        }
Example #3
0
        public void SetBrowserItemPaths(BrowserItem item, string rootDirectoryName)
        {
            if (Directory.Exists(filteredSearchResults[rootDirectoryName]))
            {
                string[] files = Directory.GetFiles(filteredSearchResults[rootDirectoryName]);//Note: may be able to get .jpg and .obj files using search pattern instead of below with Path.GetExtension.
                foreach (string path in files)
                {
                    if (File.Exists(path))
                    {
                        string extension = Path.GetExtension(path);

                        if (extension == ".jpg")
                        {
                            item.thumbPath = path;
                        }
                        else if (extension == ".obj")
                        {
                            item.meshPath = path;
                        }
                    }
                }
            }
        }
Example #4
0
 /// <summary>
 /// Show or hide a browser item.
 /// </summary>
 /// <param name="item">The item to enable or disable.</param>
 /// <param name="enabled">Enable or disable the item.</param>
 public void ToggleHideBrowserItem(BrowserItem item, bool enabled)
 {
     item.thumbnail.enabled = enabled;
     item.enabled           = enabled;
 }