Ejemplo n.º 1
0
        internal AssetOperations(
            WorkspaceInfo wkInfo,
            IWorkspaceWindow workspaceWindow,
            IViewSwitcher viewSwitcher,
            IHistoryViewLauncher historyViewLauncher,
            ViewHost viewHost,
            NewIncomingChangesUpdater newIncomingChangesUpdater,
            IAssetStatusCache assetStatusCache,
            IMergeViewLauncher mergeViewLauncher,
            IGluonViewSwitcher gluonViewSwitcher,
            EditorWindow parentWindow,
            IAssetSelection assetSelection,
            bool isGluonMode)
        {
            mWkInfo                    = wkInfo;
            mWorkspaceWindow           = workspaceWindow;
            mViewSwitcher              = viewSwitcher;
            mHistoryViewLauncher       = historyViewLauncher;
            mViewHost                  = viewHost;
            mNewIncomingChangesUpdater = newIncomingChangesUpdater;
            mAssetStatusCache          = assetStatusCache;
            mMergeViewLauncher         = mergeViewLauncher;
            mGluonViewSwitcher         = gluonViewSwitcher;
            mAssetSelection            = assetSelection;
            mIsGluonMode               = isGluonMode;
            mParentWindow              = parentWindow;

            mGuiMessage       = new UnityPlasticGuiMessage(parentWindow);
            mProgressControls = new EditorProgressControls(mGuiMessage);
        }
Ejemplo n.º 2
0
            internal static List <string> ForOperation(
                IAssetSelection assetSelection,
                IAssetStatusCache assetStatusCache,
                AssetMenuOperations operation)
            {
                List <string> selectedPaths = AssetsSelection.GetSelectedPaths(
                    assetSelection.GetSelectedAssets());

                List <string> result = new List <string>(selectedPaths);

                foreach (string path in selectedPaths)
                {
                    if (MetaPath.IsMetaPath(path))
                    {
                        continue;
                    }

                    string metaPath = MetaPath.GetMetaPath(path);

                    if (!File.Exists(metaPath))
                    {
                        continue;
                    }

                    if (result.Contains(metaPath))
                    {
                        continue;
                    }

                    if (!IsApplicableForOperation(
                            metaPath, false, operation, assetStatusCache))
                    {
                        continue;
                    }

                    result.Add(metaPath);
                }

                return(result);
            }