Exemple #1
0
 public static void OnPostprocessAllAssets(string[] importedAssets,
                                           string[] deletedAssets,
                                           string[] movedAssets,
                                           string[] movedFromAssetPaths)
 {
     AssetWindow.GetWindow().MarkOutOfDate();
 }
        public void Draw(AssetWindow window)
        {
            var baseScriptable = AssetDatabase.LoadAssetAtPath <BaseScriptable>(RootPath + "/" + RelativePath);

            if (baseScriptable != null)
            {
                window.DrawDefaultInspectorFor(new SerializedObject(baseScriptable));
            }
        }
        public void Draw(AssetWindow window)
        {
            foreach (var folder in Folders)
            {
                Draw(window, folder);
            }

            foreach (var editor in Editors)
            {
                Draw(window, editor);
            }
        }
        private static void Draw(AssetWindow window, INode folder)
        {
            bool isExpanded;
            var  expandStates = window.Options.ExpandStates;

            isExpanded = !expandStates.TryGetValue(folder.RelativePath, out isExpanded) || isExpanded;
            isExpanded = EditorGUILayout.Foldout(isExpanded, folder.Name);

            expandStates[folder.RelativePath] = isExpanded;

            if (isExpanded)
            {
                EditorGUI.indentLevel++;
                folder.Draw(window);
                EditorGUI.indentLevel--;
            }
        }