Esempio n. 1
0
 private void AddUsedBy(string path)
 {
     if (UsedBy.Contains(path))
     {
         return;
     }
     UsedBy.Add(path);
     m_FilteredUsedBy = null;
 }
Esempio n. 2
0
            private List <string> GetFilteredUsing(bool showProgress)
            {
                // Grab all the references.
                HashSet <string> childPaths = new HashSet <string>(Using);

                for (int i = 0; i < Using.Count; i++)
                {
                    string path = Using[i];

                    // Avoid infinite loops where assets reference each other.
                    if (UsedBy.Contains(path))
                    {
                        if (childPaths.Contains(path))
                        {
                            childPaths.Remove(path);
                        }
                        continue;
                    }

                    UsageInfo info = GetUsageInfo(path);

                    // Only show progress if there is a significant number of sub-paths to search through.
                    if (showProgress && (info.Using.Count > 20) && EditorUtility.DisplayCancelableProgressBar("Gathering Child File References for " + FileName, path, i * 1f / Using.Count))
                    {
                        EditorUtility.ClearProgressBar();
                        return(new List <string>());
                    }

                    // Go through each sub path and remove any found in childPaths.
                    foreach (string subPath in info.Using)
                    {
                        if (childPaths.Contains(subPath))
                        {
                            childPaths.Remove(subPath);
                        }
                    }
                }

                if (showProgress)
                {
                    EditorUtility.ClearProgressBar();
                }

                // Return final child paths as an ordered list.
                return(childPaths.ToList());
            }
Esempio n. 3
0
 public bool HasUsedBy(string path)
 {
     return(UsedBy.Contains(path));
 }
Esempio n. 4
0
 private bool CanShow(string path)
 {
     return(!path.IsNullOrEmpty() && (path != Path) && !UsedBy.Contains(path));
 }