Esempio n. 1
0
        void DoOpen(AssetList resolve, bool selectAll = false)
        {
            if (assetList.Count == 0 && assetPaths.Count != 0)
            {
                assetPaths.ForEach(assetPath => assetList.Add(Provider.CacheStatus(assetPath)));
            }

            bool includeFolders = true;

            assetList  = resolve.Filter(includeFolders, Asset.States.Conflicted);
            assetPaths = assetList.Select(asset => asset.path).ToList();
            RefreshList(selectAll);
        }
Esempio n. 2
0
        internal static bool HandlePreCheckoutCallback(ref string[] paths, ref ChangeSet changeSet)
        {
            if (preCheckoutCallback == null)
            {
                return(true);
            }

            var assetList = new AssetList();

            assetList.AddRange(paths.Select(GetAssetByPath));

            try
            {
                var    id   = changeSet == null ? ChangeSet.defaultID : changeSet.id;
                string desc = null;
                if (preCheckoutCallback(assetList, ref id, ref desc))
                {
                    var task = CheckAndCreateUserSuppliedChangeSet(id, desc, ref changeSet);
                    if (task != null)
                    {
                        Debug.LogError(
                            "Tried to create/rename remote ChangeSet to match the one specified in user-supplied callback but failed with error code: " +
                            task.resultCode);
                        return(false);
                    }

                    paths = assetList.Select(asset => asset.path).ToArray();
                }
                else
                {
                    Debug.LogWarning("User-created pre-checkout callback has blocked this checkout.");
                    return(false);
                }
            }
            catch (System.Exception ex)
            {
                Debug.LogWarning("User-created pre-checkout callback has thrown an exception: " + ex.Message);
                return(false);
            }

            return(true);
        }