当前位置: 首页>>代码示例>>C#>>正文


C# AssetList类代码示例

本文整理汇总了C#中AssetList的典型用法代码示例。如果您正苦于以下问题:C# AssetList类的具体用法?C# AssetList怎么用?C# AssetList使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


AssetList类属于命名空间,在下文中一共展示了AssetList类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: DoOpen

 private void DoOpen(AssetList assets, bool alreadyOpen)
 {
   if (alreadyOpen)
   {
     using (List<Asset>.Enumerator enumerator = assets.GetEnumerator())
     {
       while (enumerator.MoveNext())
       {
         Asset current = enumerator.Current;
         bool flag = false;
         int count = this.assetList.Count;
         for (int index = 0; index < count; ++index)
         {
           if (this.assetList[index].path == current.path)
           {
             flag = true;
             this.assetList[index] = current;
             break;
           }
         }
         if (!flag)
           this.assetList.Add(current);
       }
     }
   }
   else
     this.assetList.AddRange((IEnumerable<Asset>) assets);
   this.RefreshList();
 }
开发者ID:BlakeTriana,项目名称:unity-decompiled,代码行数:29,代码来源:WindowCheckoutFailure.cs

示例2: Open

		public static void Open(AssetList assets)
		{
			Task task = Provider.Status(assets);
			task.Wait();
			WindowResolve window = WindowResolve.GetWindow();
			window.DoOpen(task.assetList);
		}
开发者ID:guozanhua,项目名称:UnityDecompiled,代码行数:7,代码来源:WindowResolve.cs

示例3: DoOpen

 private void DoOpen(AssetList assets, bool alreadyOpen)
 {
     if (alreadyOpen)
     {
         foreach (Asset asset in assets)
         {
             bool flag = false;
             int count = this.assetList.Count;
             for (int i = 0; i < count; i++)
             {
                 if (this.assetList[i].path == asset.path)
                 {
                     flag = true;
                     this.assetList[i] = asset;
                     break;
                 }
             }
             if (!flag)
             {
                 this.assetList.Add(asset);
             }
         }
     }
     else
     {
         this.assetList.AddRange(assets);
     }
     this.RefreshList();
 }
开发者ID:CarlosHBC,项目名称:UnityDecompiled,代码行数:29,代码来源:WindowCheckoutFailure.cs

示例4: WriteAssetList

        public void WriteAssetList(AssetList assets, int total, int pagesize, int pagestart)
        {
            writer.WriteStartElement("Assets");

            if (total > -1)
            {
                writer.WriteAttributeString("total", total.ToString());
            }

            if (pagesize > -1)
            {
                writer.WriteAttributeString("pageSize", pagesize.ToString());
            }

            if (pagestart > -1)
            {
                writer.WriteAttributeString("pageStart", pagestart.ToString());
            }

            foreach (var asset in assets)
            {
                WriteAsset(asset);
            }

            writer.WriteEndElement();
        }
开发者ID:xtremeRacer,项目名称:VersionOne.SDK.NET.APIClient,代码行数:26,代码来源:XmlApiWriter.cs

示例5: Open

 public static void Open(AssetList assets)
 {
     Task task = Provider.Status(assets);
     task.Wait();
     AssetList revert = task.assetList.Filter(true, new Asset.States[] { Asset.States.CheckedOutLocal });
     GetWindow().DoOpen(revert);
 }
开发者ID:CarlosHBC,项目名称:UnityDecompiled,代码行数:7,代码来源:WindowRevert.cs

示例6: DoOpen

 private void DoOpen(AssetList resolve)
 {
     bool includeFolder = true;
     Asset.States[] states = new Asset.States[] { Asset.States.Conflicted };
     this.assetList = resolve.Filter(includeFolder, states);
     this.RefreshList();
 }
开发者ID:randomize,项目名称:VimConfig,代码行数:7,代码来源:WindowResolve.cs

示例7: Open

 public static void Open(AssetList assets)
 {
     Task task = Provider.Status(assets);
     task.Wait();
     Asset.States[] states = new Asset.States[] { Asset.States.CheckedOutLocal, Asset.States.DeletedLocal, Asset.States.AddedLocal, Asset.States.Missing };
     AssetList revert = task.assetList.Filter(true, states);
     GetWindow().DoOpen(revert);
 }
开发者ID:randomize,项目名称:VimConfig,代码行数:8,代码来源:WindowRevert.cs

示例8: UpdateFilesInVCIfNeeded

 private static void UpdateFilesInVCIfNeeded()
 {
     if (Provider.enabled)
     {
         string[] strArray = Directory.GetFiles("Temp/ScriptUpdater/", "*.*", SearchOption.AllDirectories);
         AssetList assets = new AssetList();
         foreach (string str in strArray)
         {
             assets.Add(Provider.GetAssetByPath(str.Replace("Temp/ScriptUpdater/", string.Empty)));
         }
         Task task = Provider.Checkout(assets, CheckoutMode.Exact);
         task.Wait();
         if (<>f__am$cache0 == null)
         {
开发者ID:randomize,项目名称:VimConfig,代码行数:14,代码来源:APIUpdaterHelper.cs

示例9: Export

        public override void Export(AssetList asset, string path)
        {
            var materials = (asset as MaterialList);
            var mat = new MAT();

            foreach (Material material in materials.Entries)
            {
                mat.Materials.Add(
                    new MATMaterial(
                        material.Name,
                        material.Texture.Name
                    )
                );
            }

            mat.Save(path);
        }
开发者ID:DevilboxGames,项目名称:Flummery,代码行数:17,代码来源:MATExporter.cs

示例10: DoOpen

 private void DoOpen(ChangeSet change, AssetList assets)
 {
     this.taskSubmit = null;
     this.submitResultCode = 0x100;
     this.submitErrorMessage = null;
     this.changeSet = change;
     this.description = (change != null) ? this.SanitizeDescription(change.description) : "";
     this.assetList = null;
     if (change == null)
     {
         this.taskStatus = Provider.Status(assets);
     }
     else
     {
         this.taskDesc = Provider.ChangeSetDescription(change);
         this.taskStat = Provider.ChangeSetStatus(change);
     }
 }
开发者ID:CarlosHBC,项目名称:UnityDecompiled,代码行数:18,代码来源:WindowChange.cs

示例11: DoOpen

		private void DoOpen(ChangeSet change, AssetList assets)
		{
			this.taskSubmit = null;
			this.submitResultCode = 256;
			this.submitErrorMessage = null;
			this.changeSet = change;
			this.description = string.Empty;
			this.assetList = null;
			if (change == null)
			{
				this.taskStatus = Provider.Status(assets);
			}
			else
			{
				this.taskDesc = Provider.ChangeSetDescription(change);
				this.taskStat = Provider.ChangeSetStatus(change);
			}
		}
开发者ID:guozanhua,项目名称:UnityDecompiled,代码行数:18,代码来源:WindowChange.cs

示例12: LoadAssetsAsync

 public void LoadAssetsAsync(AssetList list, FloatRef progress)
 {
     List<Asset> assets = new List<Asset>();
     foreach (string path in datapaths)
     {
         try
         {
             if (!Directory.Exists(path))
             {
                 continue;
             }
             foreach (string s in Directory.GetFiles(path, "*.*", SearchOption.AllDirectories))
             {
                 try
                 {
                     FileInfo f = new FileInfo(s);
                     if (f.Name.Equals("thumbs.db", StringComparison.InvariantCultureIgnoreCase))
                     {
                         continue;
                     }
                     Asset a = new Asset();
                     a.data = File.ReadAllBytes(s);
                     a.dataLength = a.data.Length;
                     a.name = f.Name.ToLowerInvariant();
                     a.md5 = Md5(a.data);
                     assets.Add(a);
                 }
                 catch
                 {
                 }
             }
         }
         catch
         {
         }
     }
     progress.value = 1;
     list.count = assets.Count;
     list.items = new Asset[2048];
     for (int i = 0; i < assets.Count; i++)
     {
         list.items[i] = assets[i];
     }
 }
开发者ID:YoungGames,项目名称:manicdigger,代码行数:44,代码来源:PlatformNative.cs

示例13: UpdateFilesInVCIfNeeded

		private static void UpdateFilesInVCIfNeeded()
		{
			if (!Provider.enabled)
			{
				return;
			}
			string[] files = Directory.GetFiles("Temp/ScriptUpdater/", "*.*", SearchOption.AllDirectories);
			AssetList assetList = new AssetList();
			string[] array = files;
			for (int i = 0; i < array.Length; i++)
			{
				string text = array[i];
				assetList.Add(Provider.GetAssetByPath(text.Replace("Temp/ScriptUpdater/", string.Empty)));
			}
			Task task = Provider.Checkout(assetList, CheckoutMode.Both);
			task.Wait();
			IEnumerable<Asset> source = 
				from a in task.assetList
				where (a.state & Asset.States.ReadOnly) == Asset.States.ReadOnly
				select a;
			if (!task.success || source.Any<Asset>())
			{
				string arg_103_0 = "[API Updater] Files cannot be updated (failed to checkout): {0}";
				object[] expr_BA = new object[1];
				expr_BA[0] = (
					from a in source
					select string.Concat(new object[]
					{
						a.fullName,
						" (",
						a.state,
						")"
					})).Aggregate((string acc, string curr) => acc + Environment.NewLine + "\t" + curr);
				Debug.LogErrorFormat(arg_103_0, expr_BA);
				ScriptUpdatingManager.ReportExpectedUpdateFailure();
				return;
			}
			FileUtil.CopyDirectoryRecursive("Temp/ScriptUpdater/", ".", true);
			FileUtil.DeleteFileOrDirectory("Temp/ScriptUpdater/");
		}
开发者ID:guozanhua,项目名称:UnityDecompiled,代码行数:40,代码来源:APIUpdaterHelper.cs

示例14: UpdateFilesInVCIfNeeded

 private static void UpdateFilesInVCIfNeeded()
 {
   if (!Provider.enabled)
     return;
   string[] files = Directory.GetFiles("Temp/ScriptUpdater/", "*.*", SearchOption.AllDirectories);
   AssetList assets = new AssetList();
   foreach (string str in files)
     assets.Add(Provider.GetAssetByPath(str.Replace("Temp/ScriptUpdater/", string.Empty)));
   Task task = Provider.Checkout(assets, CheckoutMode.Exact);
   task.Wait();
   IEnumerable<Asset> source = task.assetList.Where<Asset>((Func<Asset, bool>) (a => (a.state & Asset.States.ReadOnly) == Asset.States.ReadOnly));
   if (!task.success || source.Any<Asset>())
   {
     Debug.LogErrorFormat("[API Updater] Files cannot be updated (failed to check out): {0}", (object) source.Select<Asset, string>((Func<Asset, string>) (a => a.fullName + " (" + (object) a.state + ")")).Aggregate<string>((Func<string, string, string>) ((acc, curr) => acc + Environment.NewLine + "\t" + curr)));
     ScriptUpdatingManager.ReportExpectedUpdateFailure();
   }
   else
   {
     FileUtil.CopyDirectoryRecursive("Temp/ScriptUpdater/", ".", true);
     FileUtil.DeleteFileOrDirectory("Temp/ScriptUpdater/");
   }
 }
开发者ID:BlakeTriana,项目名称:unity-decompiled,代码行数:22,代码来源:APIUpdaterHelper.cs

示例15: OpenIfCheckoutFailed

 public static void OpenIfCheckoutFailed(AssetList assets)
 {
   Object[] objectsOfTypeAll = Resources.FindObjectsOfTypeAll(typeof (WindowCheckoutFailure));
   bool alreadyOpen = (objectsOfTypeAll.Length <= 0 ? (Object) null : (Object) (objectsOfTypeAll[0] as WindowCheckoutFailure)) != (Object) null;
   bool flag = alreadyOpen;
   if (!flag)
   {
     using (List<Asset>.Enumerator enumerator = assets.GetEnumerator())
     {
       while (enumerator.MoveNext())
       {
         if (!enumerator.Current.IsState(Asset.States.CheckedOutLocal))
         {
           flag = true;
           break;
         }
       }
     }
   }
   if (!flag)
     return;
   WindowCheckoutFailure.GetWindow().DoOpen(assets, alreadyOpen);
 }
开发者ID:BlakeTriana,项目名称:unity-decompiled,代码行数:23,代码来源:WindowCheckoutFailure.cs


注:本文中的AssetList类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。