コード例 #1
0
        private ManageInfoView CreateManageInfoView(ManageInfo manageInfo, AssetCollectInfo[] collectInfos, bool opened, bool edited)
        {
            var manageAssetPath = AssetDatabase.GetAssetPath(manageInfo.assetObject);
            var ignoreType      = assetManageManager.GetIgnoreType(manageAssetPath);
            var assetInfos      = collectInfos
                                  .Where(x => x.AssetInfo != null)
                                  .Where(x => x.ManageInfo == manageInfo)
                                  .ToArray();

            var view = new ManageInfoView(manageInfo, assetInfos, ignoreType, opened, edited);

            view.OnUpdateManageInfoAsObservable()
            .Subscribe(_ =>
            {
                assetManageManager.UpdateManageInfo(view.ManageInfo);
                UpdateAssetInfo(view.Infos.Select(x => x.AssetPath).ToArray());
                BuildManageInfoViews();
            })
            .AddTo(Disposable);

            view.OnDeleteManageInfoAsObservable()
            .Subscribe(_ =>
            {
                assetManageManager.DeleteManageInfo(selectionGroupInfo.groupName, view.ManageInfo);
                UpdateAssetInfo(view.Infos.Select(x => x.AssetPath).ToArray());
                BuildManageInfoViews();
            })
            .AddTo(Disposable);

            return(view);
        }
コード例 #2
0
        private bool IsSearchedHit(ManageInfoView view)
        {
            if (string.IsNullOrEmpty(searchText))
            {
                return(true);
            }

            var keywords = searchText.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);

            for (var i = 0; i < keywords.Length; ++i)
            {
                keywords[i] = keywords[i].ToLower();
            }

            var isHit = false;

            // アセットバンドル名が一致.
            isHit |= view.Infos
                     .Where(x => x.AssetInfo.IsAssetBundle)
                     .Any(x => x.AssetInfo.AssetBundle.AssetBundleName.IsMatch(keywords));

            // 管理下のアセットのパスが一致.
            isHit |= view.Infos.Any(x => x.AssetPath.IsMatch(keywords));

            return(isHit);
        }
コード例 #3
0
        private ManageInfoView CreateManageInfoView(ManageInfo manageInfo, bool opened, bool edited)
        {
            var manageAssetPath = AssetDatabase.GUIDToAssetPath(manageInfo.guid);
            var ignoreType      = assetManagement.GetIgnoreType(manageAssetPath);

            var view = new ManageInfoView(assetManagement, manageInfo, externalResourcesPath, shareResourcesPath, ignoreType, opened, edited);

            view.OnUpdateManageInfoAsObservable()
            .DelayFrame(1)
            .Subscribe(_ =>
            {
                assetManagement.UpdateManageInfo(view.ManageInfo);

                var updateAssetPaths = assetManagement.GetManageAssetPaths(view.ManageInfo);

                UpdateAssetInfo(updateAssetPaths);

                BuildManageInfoViews();
            })
            .AddTo(Disposable);

            view.OnDeleteManageInfoAsObservable()
            .DelayFrame(1)
            .Subscribe(_ =>
            {
                var updateAssetPaths = assetManagement.GetManageAssetPaths(view.ManageInfo);

                assetManagement.DeleteManageInfo(view.ManageInfo);

                UpdateAssetInfo(updateAssetPaths);

                BuildManageInfoViews();
            })
            .AddTo(Disposable);

            return(view);
        }