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); }
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); }