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


C# BuildContext.CopyTo方法代码示例

本文整理汇总了C#中BuildContext.CopyTo方法的典型用法代码示例。如果您正苦于以下问题:C# BuildContext.CopyTo方法的具体用法?C# BuildContext.CopyTo怎么用?C# BuildContext.CopyTo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BuildContext的用法示例。


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

示例1: Build

		/// <summary>
		/// Builds asset
		/// </summary>
		/// <param name="buildContext"></param>
		public override void Build ( BuildContext buildContext )
		{														   
			string tempFileName		= buildContext.GetTempFileName( AssetPath, ".fnt" );
			string resolvedPath		= buildContext.Resolve( SourceFile );	

			//	Launch 'bmfont.com' with temporary output file :
			buildContext.RunTool( @"bmfont.com",  string.Format("-c \"{0}\" -o \"{1}\"", resolvedPath, tempFileName ) );


			//	load temporary output :
			SpriteFont.FontFile font;
			using ( var stream = File.OpenRead( tempFileName ) ) {
				font = SpriteFont.FontLoader.Load( stream );
			}


			//	perform some checks :
			if (font.Common.Pages!=1) {
				throw new ContentException("Only one page of font image is supported");
			}


			//	patch font description and add children (e.g. "secondary") content :
			using ( var stream = buildContext.OpenTargetStream( this ) ) {

				using ( var sw = new BinaryWriter( stream ) ) {

					var xml = SpriteFont.FontLoader.SaveToString( font );
					sw.Write( xml );

					//	write pages :
					foreach (var p in font.Pages) {

						var pageFile	=	Path.Combine( Path.GetDirectoryName( tempFileName ), p.File );

						if ( Path.GetExtension( pageFile ).ToLower() == ".dds" ) {

							buildContext.CopyTo( pageFile, sw );

						} else {

							ImageFileTextureAsset.RunNVCompress( buildContext, pageFile, pageFile + ".dds", true, false, false, true, true, false, ImageFileTextureAsset.TextureCompression.RGB );

							buildContext.CopyTo( pageFile + ".dds", sw );

						}
					}
				}
			}
		}
开发者ID:demiurghg,项目名称:FusionEngine,代码行数:54,代码来源:BMFontSpriteFontAsset.cs

示例2: Build

		/// <summary>
		/// Builds asset
		/// </summary>
		/// <param name="buildContext"></param>
		public override void Build ( BuildContext buildContext )
		{
			var resolvedPath	=	buildContext.Resolve( SourceFile );
			var destPath		=	buildContext.GetTempFileName( Hash, ".scene" );
			var cmdLine			=	string.Format("\"{0}\" /out:\"{1}\" /merge:{2} {4} {5}", 
				resolvedPath, destPath, 
				MergeTolerance, 
				null, 
				ImportAnimation ? "/anim":"", 
				ImportGeometry ? "/geom":"" 
			);

			buildContext.RunTool( "Native.Fbx.exe", cmdLine );

			using ( var target = buildContext.OpenTargetStream( this ) ) {
				buildContext.CopyTo( destPath, target );
			}
		}
开发者ID:demiurghg,项目名称:FusionEngine,代码行数:22,代码来源:FbxFileSceneAsset.cs

示例3: Build

 /// <summary>
 /// 
 /// </summary>
 /// <param name="buildContext"></param>
 public override void Build( BuildContext buildContext )
 {
     using ( var target = buildContext.TargetStream( this ) ) {
         buildContext.CopyTo( SourceFile, target );
     }
 }
开发者ID:temik911,项目名称:audio,代码行数:10,代码来源:RawFileAsset.cs

示例4: Build

        public override void Build( BuildContext buildContext )
        {
            var src	=	buildContext.Resolve( SourceFile );
            var dst	=	buildContext.GetTempFileName( Hash, ".dds", true );

            RunNVCompress( buildContext, src, dst, NoMips, Fast, ToNormal, Color, Alpha, Normal, Compression );

            using ( var target = buildContext.TargetStream( this ) ) {
                buildContext.CopyTo( dst, target );
            }
        }
开发者ID:temik911,项目名称:audio,代码行数:11,代码来源:ImageFileTextureAsset.cs


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