예제 #1
0
        void OnEnable()
        {
            titleContent.text = "References";

            objectList            = new ScrollableObjectList();
            objectList.OnPostDraw = OnPostDrawResultItem;
            beforeTarget          = null;
            if (engine != null)
            {
                engine.Cancel();
            }
            var root = Path.GetFullPath(Application.dataPath + "/..");

            engine = new ReferenceSearchEngine(root);

            ReferenceSearchEngine.Tracer  = s => Debug.Log(s);
            AssetDependencyDatabase.Trace = s => Debug.Log(s);

            AssetDependencyDatabase.StartFullScanWorker();
        }
예제 #2
0
        public void AddItemsToMenu(GenericMenu menu)
        {
            menu.AddItem(new GUIContent("Lock #q"), isLocked, () =>
            {
                isLocked     = !isLocked;
                beforeTarget = null;
            });
            menu.AddItem(new GUIContent("Recursive #r"), isRecursive, () =>
            {
                isRecursive = !isRecursive;
            });
            menu.AddSeparator("");

            menu.AddItem(new GUIContent("Copy Result"), false, () =>
            {
                var sb = new StringBuilder();
                foreach (var file in objectList)
                {
                    sb.Append(file);
                    sb.Append('\n');
                }
                EditorGUIUtility.systemCopyBuffer = sb.ToString();
            });
            menu.AddItem(new GUIContent("Sort Result"), false, () =>
            {
                objectList.Sort();
            });
            menu.AddItem(new GUIContent("Clear Cache"), false, () =>
            {
                AssetDependencyDatabase.Truncate();
            });
            menu.AddItem(new GUIContent("Start Full Scan"), false, () =>
            {
                AssetDependencyDatabase.StartFullScanWorker();
            });
        }