Ejemplo n.º 1
0
        private static bool MakeAssetEditable(Asset asset)
        {
#if UNITY_2019_4_OR_NEWER
            if (!AssetDatabase.IsOpenForEdit(asset.path))
            {
                return(AssetDatabase.MakeEditable(asset.path));
            }
#else
            if (!Provider.IsOpenForEdit(asset))
            {
                CheckoutMode mode = asset.isMeta ? CheckoutMode.Meta : CheckoutMode.Asset;
                Task         task = Provider.Checkout(asset, mode);
                task.Wait();
                return(task.success);
            }
#endif
            return(false);
        }
Ejemplo n.º 2
0
        static string GetCheckoutModeDescription(CheckoutMode checkoutMode)
        {
            switch (checkoutMode)
            {
            case CheckoutMode.NeedsPull:
                return("update branch");

            case CheckoutMode.Switch:
                return("switch branches");

            case CheckoutMode.Fetch:
            case CheckoutMode.InvalidState:
                return("checkout pull request");

            default:
                Debug.Fail("Invalid CheckoutMode in GetCheckoutModeDescription");
                return(null);
            }
        }
Ejemplo n.º 3
0
 /// <summary>
 ///   <para>Checkout an asset or list of asset from the version control system.</para>
 /// </summary>
 /// <param name="assets">List of assets to checkout.</param>
 /// <param name="mode">Tell the Provider to checkout the asset, the .meta file or both.</param>
 /// <param name="asset">Asset to checkout.</param>
 public static Task Checkout(string asset, CheckoutMode mode)
 {
     return(Provider.Internal_CheckoutStrings(new string[1] {
         asset
     }, mode));
 }
Ejemplo n.º 4
0
 public static bool CheckoutIsValid(Asset asset, CheckoutMode mode)
 {
     return(Provider.Internal_CheckoutIsValid(new Asset[1] {
         asset
     }, mode));
 }
Ejemplo n.º 5
0
		public static Task Checkout(UnityEngine.Object asset, CheckoutMode mode)
		{
			string assetPath = AssetDatabase.GetAssetPath(asset);
			Asset assetByPath = Provider.GetAssetByPath(assetPath);
			return Provider.Internal_Checkout(new Asset[]
			{
				assetByPath
			}, mode);
		}
Ejemplo n.º 6
0
 private static extern bool Internal_CheckoutIsValid(Asset[] assets, CheckoutMode mode);
Ejemplo n.º 7
0
 static public Task Checkout(string asset, CheckoutMode mode)
 {
     return(Checkout(asset, mode, null));
 }
Ejemplo n.º 8
0
 static public Task Checkout(AssetList assets, CheckoutMode mode)
 {
     return(Checkout(assets, mode, null));
 }
Ejemplo n.º 9
0
 /// <summary>
 ///   <para>Checkout an asset or list of asset from the version control system.</para>
 /// </summary>
 /// <param name="assets">List of assets to checkout.</param>
 /// <param name="mode">Tell the Provider to checkout the asset, the .meta file or both.</param>
 /// <param name="asset">Asset to checkout.</param>
 public static Task Checkout(Object asset, CheckoutMode mode)
 {
   return Provider.Internal_Checkout(new Asset[1]{ Provider.GetAssetByPath(AssetDatabase.GetAssetPath(asset)) }, mode);
 }
Ejemplo n.º 10
0
 /// <summary>
 ///   <para>Checkout an asset or list of asset from the version control system.</para>
 /// </summary>
 /// <param name="assets">List of assets to checkout.</param>
 /// <param name="mode">Tell the Provider to checkout the asset, the .meta file or both.</param>
 /// <param name="asset">Asset to checkout.</param>
 public static Task Checkout(string asset, CheckoutMode mode)
 {
   return Provider.Internal_CheckoutStrings(new string[1]{ asset }, mode);
 }
Ejemplo n.º 11
0
 /// <summary>
 ///   <para>Checkout an asset or list of asset from the version control system.</para>
 /// </summary>
 /// <param name="assets">List of assets to checkout.</param>
 /// <param name="mode">Tell the Provider to checkout the asset, the .meta file or both.</param>
 /// <param name="asset">Asset to checkout.</param>
 public static Task Checkout(Asset asset, CheckoutMode mode)
 {
   return Provider.Internal_Checkout(new Asset[1]{ asset }, mode);
 }
Ejemplo n.º 12
0
 public static bool CheckoutIsValid(Asset asset, CheckoutMode mode)
 {
   return Provider.Internal_CheckoutIsValid(new Asset[1]{ asset }, mode);
 }
Ejemplo n.º 13
0
 /// <summary>
 ///   <para>Checkout an asset or list of asset from the version control system.</para>
 /// </summary>
 /// <param name="assets">List of assets to checkout.</param>
 /// <param name="mode">Tell the Provider to checkout the asset, the .meta file or both.</param>
 /// <param name="asset">Asset to checkout.</param>
 public static Task Checkout(Object[] assets, CheckoutMode mode)
 {
   AssetList assetList = new AssetList();
   foreach (Object asset in assets)
   {
     Asset assetByPath = Provider.GetAssetByPath(AssetDatabase.GetAssetPath(asset));
     assetList.Add(assetByPath);
   }
   return Provider.Internal_Checkout(assetList.ToArray(), mode);
 }
Ejemplo n.º 14
0
 static public Task Checkout(Asset asset, CheckoutMode mode)
 {
     return(Internal_Checkout(new Asset[] { asset }, mode));
 }
Ejemplo n.º 15
0
 /// <summary>
 /// <para>Checkout an asset or list of asset from the version control system.</para>
 /// </summary>
 /// <param name="assets">List of assets to checkout.</param>
 /// <param name="mode">Tell the Provider to checkout the asset, the .meta file or both.</param>
 /// <param name="asset">Asset to checkout.</param>
 public static Task Checkout(string asset, CheckoutMode mode)
 {
     string[] assets = new string[] { asset };
     return Internal_CheckoutStrings(assets, mode);
 }
Ejemplo n.º 16
0
 static public Task Checkout(AssetList assets, CheckoutMode mode)
 {
     return(Internal_Checkout(assets.ToArray(), mode));
 }
Ejemplo n.º 17
0
 /// <summary>
 /// <para>Checkout an asset or list of asset from the version control system.</para>
 /// </summary>
 /// <param name="assets">List of assets to checkout.</param>
 /// <param name="mode">Tell the Provider to checkout the asset, the .meta file or both.</param>
 /// <param name="asset">Asset to checkout.</param>
 public static Task Checkout(Asset asset, CheckoutMode mode)
 {
     Asset[] assets = new Asset[] { asset };
     return Internal_Checkout(assets, mode);
 }
Ejemplo n.º 18
0
 static public Task Checkout(Object[] assets, CheckoutMode mode)
 {
     return(Checkout(assets, mode, null));
 }
Ejemplo n.º 19
0
 /// <summary>
 /// <para>Checkout an asset or list of asset from the version control system.</para>
 /// </summary>
 /// <param name="assets">List of assets to checkout.</param>
 /// <param name="mode">Tell the Provider to checkout the asset, the .meta file or both.</param>
 /// <param name="asset">Asset to checkout.</param>
 public static Task Checkout(AssetList assets, CheckoutMode mode)
 {
     return Internal_Checkout(assets.ToArray(), mode);
 }
Ejemplo n.º 20
0
 static public Task Checkout(UnityEngine.Object asset, CheckoutMode mode)
 {
     return(Checkout(asset, mode, null));
 }
Ejemplo n.º 21
0
 /// <summary>
 /// <para>Checkout an asset or list of asset from the version control system.</para>
 /// </summary>
 /// <param name="assets">List of assets to checkout.</param>
 /// <param name="mode">Tell the Provider to checkout the asset, the .meta file or both.</param>
 /// <param name="asset">Asset to checkout.</param>
 public static Task Checkout(string[] assets, CheckoutMode mode)
 {
     return Internal_CheckoutStrings(assets, mode);
 }
Ejemplo n.º 22
0
 private static extern Task Internal_CheckoutStrings(string[] assets, CheckoutMode mode);
Ejemplo n.º 23
0
 /// <summary>
 /// <para>Checkout an asset or list of asset from the version control system.</para>
 /// </summary>
 /// <param name="assets">List of assets to checkout.</param>
 /// <param name="mode">Tell the Provider to checkout the asset, the .meta file or both.</param>
 /// <param name="asset">Asset to checkout.</param>
 public static Task Checkout(Object[] assets, CheckoutMode mode)
 {
     AssetList list = new AssetList();
     foreach (Object obj2 in assets)
     {
         Asset assetByPath = GetAssetByPath(AssetDatabase.GetAssetPath(obj2));
         list.Add(assetByPath);
     }
     return Internal_Checkout(list.ToArray(), mode);
 }
Ejemplo n.º 24
0
 public static Task Checkout(Asset asset, CheckoutMode mode)
 {
     Asset[] assets = new Asset[] { asset };
     return(Internal_Checkout(assets, mode));
 }
Ejemplo n.º 25
0
 /// <summary>
 /// <para>Checkout an asset or list of asset from the version control system.</para>
 /// </summary>
 /// <param name="assets">List of assets to checkout.</param>
 /// <param name="mode">Tell the Provider to checkout the asset, the .meta file or both.</param>
 /// <param name="asset">Asset to checkout.</param>
 public static Task Checkout(Object asset, CheckoutMode mode)
 {
     Asset assetByPath = GetAssetByPath(AssetDatabase.GetAssetPath(asset));
     Asset[] assets = new Asset[] { assetByPath };
     return Internal_Checkout(assets, mode);
 }
Ejemplo n.º 26
0
 private static extern Task Internal_Checkout(Asset[] assets, CheckoutMode mode);
Ejemplo n.º 27
0
 public static bool CheckoutIsValid(Asset asset, CheckoutMode mode)
 {
     Asset[] assets = new Asset[] { asset };
     return Internal_CheckoutIsValid(assets, mode);
 }
Ejemplo n.º 28
0
 /// <summary>
 ///   <para>Checkout an asset or list of asset from the version control system.</para>
 /// </summary>
 /// <param name="assets">List of assets to checkout.</param>
 /// <param name="mode">Tell the Provider to checkout the asset, the .meta file or both.</param>
 /// <param name="asset">Asset to checkout.</param>
 public static Task Checkout(Asset asset, CheckoutMode mode)
 {
     return(Provider.Internal_Checkout(new Asset[1] {
         asset
     }, mode));
 }
Ejemplo n.º 29
0
 public static bool CheckoutIsValid(AssetList assets, CheckoutMode mode)
 {
     return Internal_CheckoutIsValid(assets.ToArray(), mode);
 }
Ejemplo n.º 30
0
 /// <summary>
 ///   <para>Checkout an asset or list of asset from the version control system.</para>
 /// </summary>
 /// <param name="assets">List of assets to checkout.</param>
 /// <param name="mode">Tell the Provider to checkout the asset, the .meta file or both.</param>
 /// <param name="asset">Asset to checkout.</param>
 public static Task Checkout(Object asset, CheckoutMode mode)
 {
     return(Provider.Internal_Checkout(new Asset[1] {
         Provider.GetAssetByPath(AssetDatabase.GetAssetPath(asset))
     }, mode));
 }
Ejemplo n.º 31
0
 private static extern Task Internal_Checkout(Asset[] assets, CheckoutMode mode);
Ejemplo n.º 32
0
 static public Task Checkout(string asset, CheckoutMode mode)
 {
     return(Internal_CheckoutStrings(new string[] { asset }, mode));
 }
Ejemplo n.º 33
0
 private static extern bool Internal_CheckoutIsValid(Asset[] assets, CheckoutMode mode);
Ejemplo n.º 34
0
 static public Task Checkout(string[] assets, CheckoutMode mode)
 {
     return(Internal_CheckoutStrings(assets, mode));
 }
Ejemplo n.º 35
0
 private static extern Task Internal_CheckoutStrings(string[] assets, CheckoutMode mode);
Ejemplo n.º 36
0
 static public Task Checkout(AssetList assets, CheckoutMode mode, ChangeSet changeset)
 {
     return(CheckCallbackAndCheckout(assets, mode, changeset));
 }
Ejemplo n.º 37
0
 /// <summary>
 /// <para>Checkout an asset or list of asset from the version control system.</para>
 /// </summary>
 /// <param name="assets">List of assets to checkout.</param>
 /// <param name="mode">Tell the Provider to checkout the asset, the .meta file or both.</param>
 /// <param name="asset">Asset to checkout.</param>
 public static Task Checkout(AssetList assets, CheckoutMode mode) =>
 Internal_Checkout(assets.ToArray(), mode);
Ejemplo n.º 38
0
 static public bool CheckoutIsValid(Asset asset, CheckoutMode mode)
 {
     return(Internal_CheckoutIsValid(new Asset[] { asset }, mode));
 }
Ejemplo n.º 39
0
 /// <summary>
 /// <para>Checkout an asset or list of asset from the version control system.</para>
 /// </summary>
 /// <param name="assets">List of assets to checkout.</param>
 /// <param name="mode">Tell the Provider to checkout the asset, the .meta file or both.</param>
 /// <param name="asset">Asset to checkout.</param>
 public static Task Checkout(string[] assets, CheckoutMode mode) =>
 Internal_CheckoutStrings(assets, mode);
Ejemplo n.º 40
0
 static public Task Checkout(string asset, CheckoutMode mode, ChangeSet changeset)
 {
     return(Checkout(new string[] { asset }, mode, changeset));
 }
Ejemplo n.º 41
0
 public static bool CheckoutIsValid(AssetList assets, CheckoutMode mode) =>
 Internal_CheckoutIsValid(assets.ToArray(), mode);
Ejemplo n.º 42
0
 static public bool CheckoutIsValid(AssetList assets, CheckoutMode mode)
 {
     return(Internal_CheckoutIsValid(assets.ToArray(), mode));
 }
Ejemplo n.º 43
0
 public static bool CheckoutIsValid(Asset asset, CheckoutMode mode)
 {
     Asset[] assets = new Asset[] { asset };
     return(Internal_CheckoutIsValid(assets, mode));
 }
Ejemplo n.º 44
0
 private static extern Task Internal_Checkout(Asset[] assets, CheckoutMode mode, ChangeSet changeset);
Ejemplo n.º 45
0
 public static Task Checkout(string asset, CheckoutMode mode)
 {
     string[] assets = new string[] { asset };
     return(Internal_CheckoutStrings(assets, mode));
 }
Ejemplo n.º 46
0
 private static extern Asset[] Internal_ConsolidateAssetList(Asset[] assets, CheckoutMode mode);
Ejemplo n.º 47
0
		public static Task Checkout(UnityEngine.Object[] assets, CheckoutMode mode)
		{
			AssetList assetList = new AssetList();
			for (int i = 0; i < assets.Length; i++)
			{
				UnityEngine.Object assetObject = assets[i];
				string assetPath = AssetDatabase.GetAssetPath(assetObject);
				Asset assetByPath = Provider.GetAssetByPath(assetPath);
				assetList.Add(assetByPath);
			}
			return Provider.Internal_Checkout(assetList.ToArray(), mode);
		}