public static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAssets, string[] movedAssets, string[] movedFromAssetPaths)
        {
            if (SceneSaved == null)
            {
                return;
            }

            XDebug.AssertDelegate(SceneSaved);
            importedAssets.Where(p => p.EndsWith(".unity")).Distinct().ForEach(p => SceneSaved(p));
        }
Beispiel #2
0
        public static string[] OnWillSaveAssets(string[] paths)
        {
            if (SceneSaving != null)
            {
                XDebug.AssertDelegate(SceneSaving);
                paths.Where(path => path.EndsWith(".unity")).ForEach(p => SceneSaving(p));
            }

            return(paths);
        }
Beispiel #3
0
        private static void Update()
        {
            if ((s_LastSelection == Selection.activeObject) && (s_LastSelectionCount == Selection.gameObjects.Length))
            {
                return;
            }

            XDebug.AssertDelegate(SelectionChanged);

            s_LastSelection      = Selection.activeObject;
            s_LastSelectionCount = Selection.gameObjects.Length;

            if (SelectionChanged != null)
            {
                SelectionChanged(Selection.activeObject);
            }
        }
        private void ApplyFilter()
        {
            m_SearchBits = m_SearchString.ToLower().Split(new char[] { ' ', '\t', '\n' }, StringSplitOptions.RemoveEmptyEntries);

            //reset all the filters;
            VisitItems(item => item.PassedFilter = false);

            //Apply filters
            VisitItems(item => item.PassedFilter = Filter(item));

            //Count visible
            m_FilteredItemCount = 0;
            m_TotalItemCount    = 0;
            m_FilteredItemWidth = 0;
            m_TotalItemWidth    = 0;
            VisitItems(item => {
                float min, max;
                LabelStyle.CalcMinMaxWidth(item.Content, out min, out max);
                float itemWidth = item.Depth * kIndent + max;
                if (item.PassedFilter)
                {
                    m_FilteredItemWidth = Mathf.Max(m_FilteredItemWidth, itemWidth);
                    m_FilteredItemCount++;
                }
                m_TotalItemWidth = Mathf.Max(m_TotalItemWidth, itemWidth);
                m_TotalItemCount++;
            });

            if (EditorWindow != null)
            {
                EditorWindow.Repaint();
            }

            if (SearchChanged != null)
            {
                XDebug.AssertDelegate(SearchChanged, EditorWindow);
                SearchChanged(m_SearchString);
            }
        }