void ReloadMarkedList()
            {
                mMarkedPathList.Clear();

                AssetDatabase.GetAllAssetBundleNames()
                .SelectMany(n =>
                {
                    var result = AssetDatabase.GetAssetPathsFromAssetBundle(n);

                    return(result.Select(r =>
                    {
                        if (ResKitAssetsMenu.Marked(r))
                        {
                            return r;
                        }

                        if (ResKitAssetsMenu.Marked(r.GetPathParentFolder()))
                        {
                            return r.GetPathParentFolder();
                        }

                        return null;
                    }).Where(r => r != null)
                           .Distinct());
                })
                .ForEach(n => new HorizontalLayout()
                         .AddChild(EasyIMGUI.Label().Text(n))
                         .AddChild(EasyIMGUI.Button()
                                   .Text(LocaleText.Select)
                                   .OnClick(() =>
                {
                    Selection.objects = new[]
                    {
                        AssetDatabase.LoadAssetAtPath <Object>(n)
                    };
                }).Width(50))
                         .AddChild(EasyIMGUI.Button()
                                   .Text(LocaleText.CancelMark)
                                   .OnClick(() =>
                {
                    ResKitAssetsMenu.MarkAB(n);

                    EditorLifecycle.PushCommand(() => { ReloadMarkedList(); });
                }).Width(75))
                         .Parent(mMarkedPathList)
                         );
            }
Exemple #2
0
            void ReloadMarkedList()
            {
                mMarkedPathList.Clear();

                AssetDatabase.GetAllAssetBundleNames()
                .SelectMany(n =>
                {
                    var result = AssetDatabase.GetAssetPathsFromAssetBundle(n);

                    return(result.Select(r =>
                    {
                        if (ResKitAssetsMenu.Marked(r))
                        {
                            return r;
                        }

                        if (ResKitAssetsMenu.Marked(r.GetPathParentFolder()))
                        {
                            return r.GetPathParentFolder();
                        }

                        return null;
                    }).Where(r => r != null)
                           .Distinct());
                })
                .ForEach(n => new HorizontalLayout()
                         .AddChild(new LabelView(n))
                         .AddChild(new ButtonView("选择", () =>
                {
                    Selection.objects = new[]
                    {
                        AssetDatabase.LoadAssetAtPath <Object>(n)
                    };
                }).Width(50))
                         .AddChild(new ButtonView("取消标记", () =>
                {
                    ResKitAssetsMenu.MarkAB(n);

                    EditorLifecycle.PushCommand(() => { ReloadMarkedList(); });
                }).Width(75))
                         .AddTo(mMarkedPathList)
                         );
            }