private void OnEnable() { assetDependencyConfig = AssetDependencyUtil.GetAssetDependencyConfig(); Selection.selectionChanged += OnSelectionChanged; EditorApplication.update += Repaint; }
private void DrawToolbar() { EditorGUILayout.BeginHorizontal("toolbar", GUILayout.ExpandWidth(true)); { if (GUILayout.Button("Reload", EditorStyles.toolbarButton, GUILayout.Width(80))) { if (EditorUtility.DisplayDialog("Warning", "This will take a lot of time.Are you sure?", "OK", "Cancel")) { assetDependencyConfig = AssetDependencyUtil.FindAllAssetData(); RefreshTreeView(); } } GUILayout.FlexibleSpace(); var newAutoRefresh = EditorGUILayout.ToggleLeft("Auto Refresh", isAutoRefresh); if (newAutoRefresh != isAutoRefresh) { isAutoRefresh = newAutoRefresh; RefreshTreeView(); } } EditorGUILayout.EndHorizontal(); }