示例#1
0
        private void Init()
        {
            //Uses = new FR2_RefTree<FR2_Asset>(FR2_Asset.FindUsage, DrawAsset);
            //UsedBy = new FR2_RefTree<FR2_Asset>(FR2_Asset.FindUsedBy, DrawAsset);

            UsesDrawer   = new FR2_RefDrawer();
            UsedByDrawer = new FR2_RefDrawer();

            Duplicated = new FR2_DuplicateTree();
            //    (item=>item.GetChildren(), (item, rect, s, b) =>
            //{
            //    item.Draw(rect);
            //    return 16f;
            //});

            //Uses.Sorter = FR2_Asset.SortByExtension;
            //UsedBy.Sorter = FR2_Asset.SortByExtension;

            //Uses.BriefDrawer = DrawBrief;
            //UsedBy.BriefDrawer = DrawBrief;

            FR2_Cache.onReady -= OnReady;
            FR2_Cache.onReady += OnReady;

            //Debug.Log(" FR2_Window ---> Init");
        }
示例#2
0
 public FR2_UsedInBuild(IWindow window)
 {
     this.window            = window;
     drawer                 = new FR2_RefDrawer(window);
     dirty                  = true;
     drawer.displayFileSize = true;
     drawer.SetDirty();
 }
示例#3
0
        protected override void InitIfNeeded()
        {
            {
                if (UsesDrawer != null)
                {
                    return;
                }

                UsesDrawer = new FR2_RefDrawer(this)
                {
                    Lable = "Assets"
                };
                UsedByDrawer = new FR2_RefDrawer(this)
                {
                    Lable = "Assets"
                };
                Duplicated         = new FR2_DuplicateTree2(this);
                SceneToAssetDrawer = new FR2_RefDrawer(this)
                {
                    Lable = "Assets",
                    isDrawRefreshSceneCache = true
                };
                RefUnUse = new FR2_RefDrawer(this)
                {
                    Lable = "Unsed Asset",
                    isDrawRefreshSceneCache = false
                };

                UsedInBuild = new FR2_UsedInBuild(this);
            }


            FR2_Cache.onReady -= OnReady;
            FR2_Cache.onReady += OnReady;

            FR2_Setting.OnIgnoreChange -= OnSelectionChange;
            FR2_Setting.OnIgnoreChange += OnSelectionChange;
            //Debug.Log(" FR2_Window ---> Init");
        }
示例#4
0
        protected override void InitIfNeeded()
        {
            if (SceneUsesDrawer != null)
            {
                return;
            }

            SceneUsesDrawer = new FR2_RefDrawer(this)
            {
                Lable = "Scene Objects",
                isDrawRefreshSceneCache = true
            };
            RefInScene = new FR2_RefDrawer(this)
            {
                Lable = "Scene Objects",
                isDrawRefreshSceneCache = true
            };
            RefSceneInScene = new FR2_RefDrawer(this)
            {
                Lable = "Scene Objects",
                isDrawRefreshSceneCache = true
            };


            FR2_Cache.onReady -= OnReady;
            FR2_Cache.onReady += OnReady;

            FR2_Setting.OnIgnoreChange -= OnSelectionChange;
            FR2_Setting.OnIgnoreChange += OnSelectionChange;

#if UNITY_2018_OR_NEWER
            UnityEditor.SceneManagement.EditorSceneManager.activeSceneChangedInEditMode -= OnSceneChanged;
            UnityEditor.SceneManagement.EditorSceneManager.activeSceneChangedInEditMode += OnSceneChanged;
#elif UNITY_2017_OR_NEWER
            UnityEditor.SceneManagement.EditorSceneManager.activeSceneChanged -= OnSceneChanged;
            UnityEditor.SceneManagement.EditorSceneManager.activeSceneChanged += OnSceneChanged;
#endif
            //Debug.Log(" FR2_Window ---> Init");
        }
示例#5
0
        private void DrawSearch(string searchLable = "")
        {
            if (FR2_RefDrawer.toolbarSearchField == null)
            {
                FR2_RefDrawer.InitSearchStyle();
            }

            GUILayout.BeginHorizontal(EditorStyles.toolbar);
            {
                bool v = GUILayout.Toggle(caseSensitive, "Aa", EditorStyles.toolbarButton, GUILayout.Width(24f));
                if (v != caseSensitive)
                {
                    caseSensitive = v;
                    dirty         = true;
                }

                GUILayout.Space(2f);
                string value = GUILayout.TextField(searchTerm, FR2_RefDrawer.toolbarSearchField);
                if (searchTerm != value)
                {
                    searchTerm = value;
                    dirty      = true;
                }

                GUIStyle style = string.IsNullOrEmpty(searchTerm)
                                        ? FR2_RefDrawer.toolbarSearchFieldCancelButtonEmpty
                                        : FR2_RefDrawer.toolbarSearchFieldCancelButton;
                if (GUILayout.Button("Cancel", style))
                {
                    searchTerm = string.Empty;
                    dirty      = true;
                }

                GUILayout.Space(2f);
            }
            GUILayout.EndHorizontal();
        }
示例#6
0
        protected override void InitIfNeeded()
        {
            {
                if (UsesDrawer != null)
                {
                    return;
                }

                UsesDrawer = new FR2_RefDrawer(this)
                {
                    Lable = "Assets"
                };
                UsedByDrawer = new FR2_RefDrawer(this)
                {
                    Lable = "Assets"
                };
                Duplicated         = new FR2_DuplicateTree2(this);
                SceneToAssetDrawer = new FR2_RefDrawer(this)
                {
                    Lable = "Assets",
                    isDrawRefreshSceneCache = false
                };
                RefUnUse = new FR2_RefDrawer(this)
                {
                    Lable = "Unsed Asset",
                    isDrawRefreshSceneCache = false
                };
                UsedInBuild = new FR2_UsedInBuild(this);
            }

            if (SceneUsesDrawer != null)
            {
                return;
            }

            SceneUsesDrawer = new FR2_RefDrawer(this)
            {
                Lable = "Scene Objects",
                isDrawRefreshSceneCache = true
            };
            RefInScene = new FR2_RefDrawer(this)
            {
                Lable = "Scene Objects",
                isDrawRefreshSceneCache = true
            };
            RefSceneInScene = new FR2_RefDrawer(this)
            {
                Lable = "Scene Objects",
                isDrawRefreshSceneCache = true
            };

            lockSelection = false;

#if UNITY_2018_OR_NEWER
            UnityEditor.SceneManagement.EditorSceneManager.activeSceneChangedInEditMode -= OnSceneChanged;
            UnityEditor.SceneManagement.EditorSceneManager.activeSceneChangedInEditMode += OnSceneChanged;
#elif UNITY_2017_OR_NEWER
            UnityEditor.SceneManagement.EditorSceneManager.activeSceneChanged -= OnSceneChanged;
            UnityEditor.SceneManagement.EditorSceneManager.activeSceneChanged += OnSceneChanged;
#endif

            FR2_Cache.onReady -= OnReady;
            FR2_Cache.onReady += OnReady;

            FR2_Setting.OnIgnoreChange -= OnSelectionChange;
            FR2_Setting.OnIgnoreChange += OnSelectionChange;

            Repaint();
        }