Esempio n. 1
0
        public void DrawToolBar()
        {
            using (new EditorGUILayout.HorizontalScope(EditorStyles.toolbar)) {
                var r = AssetProcessEventRecord.GetRecord();

                if (GUILayout.Button("Clear", EditorStyles.toolbarButton, GUILayout.Height(Model.Settings.GUI.TOOLBAR_HEIGHT)))
                {
                    AssetProcessEventRecord.GetRecord().Clear(true);
                    m_logViewController.EventSelectionChanged(null);
                    RefreshView();
                }

                GUILayout.Space(4);

                var clearOnBuild = m_clearOnBuild;
                clearOnBuild = GUILayout.Toggle(m_clearOnBuild, new GUIContent("Clear on Build"), EditorStyles.toolbarButton, GUILayout.Height(Model.Settings.GUI.TOOLBAR_HEIGHT));
                if (clearOnBuild != m_clearOnBuild)
                {
                    UserPreference.ClearAssetLogOnBuild = m_clearOnBuild = clearOnBuild;
                }

                GUILayout.FlexibleSpace();

                var showInfo  = GUILayout.Toggle(m_showInfo, new GUIContent(r.InfoEventCount.ToString(), m_infoIcon, "Toggle Show Info"), EditorStyles.toolbarButton, GUILayout.Height(Model.Settings.GUI.TOOLBAR_HEIGHT));
                var showError = GUILayout.Toggle(m_showError, new GUIContent(r.ErrorEventCount.ToString(), m_errorIcon, "Toggle Show Errors"), EditorStyles.toolbarButton, GUILayout.Height(Model.Settings.GUI.TOOLBAR_HEIGHT));

                if (showInfo != m_showInfo || showError != m_showError)
                {
                    m_showInfo  = showInfo;
                    m_showError = showError;
                    r.SetFilterCondition(m_showInfo, m_showError);
                    m_logViewController.Reload();
                }
            }
        }
 protected override void SelectionChanged(IList <int> selectedIds)
 {
     if (selectedIds.Count == 0)
     {
         m_controller.EventSelectionChanged(null);
     }
     else
     {
         var item = FindItem(selectedIds[0], rootItem) as AssetProcessEventListTreeItem;
         if (item != null)
         {
             m_controller.EventSelectionChanged(item.Event);
             PingAssetAtId(selectedIds[0]);
         }
     }
 }
Esempio n. 3
0
        public void DrawToolBar()
        {
            using (new EditorGUILayout.HorizontalScope(EditorStyles.toolbar))
            {
                var r = AssetProcessEventRecord.GetRecord();

                if (GUILayout.Button("Clear", EditorStyles.toolbarButton, GUILayout.Height(_assetGraphGuiConfig.TOOLBAR_HEIGHT)))
                {
                    AssetProcessEventRecord.GetRecord().Clear(true);
                    m_logViewController.EventSelectionChanged(null);
                    RefreshView();
                }

                GUILayout.Space(4);

                var clearOnBuild = m_clearOnBuild;
                clearOnBuild = GUILayout.Toggle(m_clearOnBuild, new GUIContent("Clear on Build"), EditorStyles.toolbarButton,
                                                GUILayout.Height(_assetGraphGuiConfig.TOOLBAR_HEIGHT));
                if (clearOnBuild != m_clearOnBuild)
                {
                    UserPreference.Preferences._clearAssetLogOnBuild = m_clearOnBuild = clearOnBuild;
                }

                GUILayout.FlexibleSpace();

                EditorGUI.BeginChangeCheck();

                m_searchKeywords = m_search.OnToolbarGUI(m_searchKeywords);

                if (EditorGUI.EndChangeCheck())
                {
                    r.SetFilterKeyword(m_searchKeywords);
                    m_logViewController.Reload();
                }

                var infoEventCountStr  = (string.IsNullOrEmpty(m_searchKeywords)) ? r.InfoEventCount.ToString() : r.FilteredInfoEventCount.ToString();
                var errorEventCountStr = (string.IsNullOrEmpty(m_searchKeywords)) ? r.ErrorEventCount.ToString() : r.FilteredErrorEventCount.ToString();

                var showInfo = GUILayout.Toggle(m_showInfo, new GUIContent(infoEventCountStr, m_infoIcon, "Toggle Show Info"), EditorStyles.toolbarButton,
                                                GUILayout.Height(_assetGraphGuiConfig.TOOLBAR_HEIGHT));
                var showError = GUILayout.Toggle(m_showError, new GUIContent(errorEventCountStr, m_errorIcon, "Toggle Show Errors"), EditorStyles.toolbarButton,
                                                 GUILayout.Height(_assetGraphGuiConfig.TOOLBAR_HEIGHT));

                if (showInfo != m_showInfo || showError != m_showError)
                {
                    m_showInfo  = showInfo;
                    m_showError = showError;
                    r.SetFilterCondition(m_showInfo, m_showError);
                    m_logViewController.Reload();
                }
            }
        }