本文整理汇总了C#中IUnrealStream.WriteString方法的典型用法代码示例。如果您正苦于以下问题:C# IUnrealStream.WriteString方法的具体用法?C# IUnrealStream.WriteString怎么用?C# IUnrealStream.WriteString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IUnrealStream
的用法示例。
在下文中一共展示了IUnrealStream.WriteString方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Serialize
public void Serialize( IUnrealStream stream )
{
stream.WriteString( Name );
if( stream.Version < QWORDVersion )
{
// Writing UINT
stream.UW.Write( (uint)Flags );
}
else
{
// Writing ULONG
stream.UW.Write( Flags );
}
}
示例2: Serialize
public void Serialize( IUnrealStream stream )
{
// Serialize tables
var namesBuffer = new UObjectStream( stream );
foreach( var name in Names )
{
name.Serialize( namesBuffer );
}
var importsBuffer = new UObjectStream( stream );
foreach( var import in Imports )
{
import.Serialize( importsBuffer );
}
var exportsBuffer = new UObjectStream( stream );
foreach( var export in Exports )
{
//export.Serialize( exportsBuffer );
}
stream.Seek( 0, SeekOrigin.Begin );
stream.Write( Signature );
// Serialize header
var version = (int)(Version & 0x0000FFFFU) | (LicenseeVersion << 16);
stream.Write( version );
var headerSizePosition = stream.Position;
if( Version >= VHeaderSize )
{
stream.Write( (int)HeaderSize );
if( Version >= VGroup )
{
stream.WriteString( Group );
}
}
stream.Write( PackageFlags );
_TablesData.NamesCount = (uint)Names.Count;
_TablesData.ExportsCount = (uint)Exports.Count;
_TablesData.ImportsCount = (uint)Imports.Count;
var tablesDataPosition = stream.Position;
_TablesData.Serialize( stream );
// TODO: Serialize Heritages
stream.Write( Guid.NewGuid().ToByteArray(), 0, 16 );
Generations.Serialize( stream );
if( Version >= VEngineVersion )
{
stream.Write( EngineVersion );
if( Version >= VCOOKEDPACKAGES )
{
stream.Write( CookerVersion );
if( Version >= VCompression )
{
if( IsCooked() )
{
stream.Write( CompressionFlags );
CompressedChunks.Serialize( stream );
}
}
}
}
// TODO: Unknown data
stream.Write( (uint)0 );
// Serialize objects
// Write tables
// names
Console.WriteLine( "Writing names at position " + stream.Position );
_TablesData.NamesOffset = (uint)stream.Position;
var namesBytes = namesBuffer.GetBuffer();
stream.Write( namesBytes, 0, (int)namesBuffer.Length );
// imports
Console.WriteLine( "Writing imports at position " + stream.Position );
_TablesData.ImportsOffset = (uint)stream.Position;
var importsBytes = importsBuffer.GetBuffer();
stream.Write( importsBytes, 0, (int)importsBuffer.Length );
// exports
Console.WriteLine( "Writing exports at position " + stream.Position );
// Serialize tables data again now that offsets are known.
var currentPosition = stream.Position;
stream.Seek( tablesDataPosition, SeekOrigin.Begin );
_TablesData.Serialize( stream );
stream.Seek( currentPosition, SeekOrigin.Begin );
}