本文整理汇总了C#中Source.AddAccessor方法的典型用法代码示例。如果您正苦于以下问题:C# Source.AddAccessor方法的具体用法?C# Source.AddAccessor怎么用?C# Source.AddAccessor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Source
的用法示例。
在下文中一共展示了Source.AddAccessor方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ReadTechnique
public void ReadTechnique( Controller controller,
Source source, XmlNode node, ColladaMeshInfo meshInfo )
{
foreach( XmlNode childNode in node.ChildNodes )
{
switch( childNode.Name )
{
case "accessor":
{
// default the accessor id to the source id
string accessorId = source.SourceId;
if( childNode.Attributes[ "id" ] != null )
accessorId = childNode.Attributes[ "id" ].Value;
string arrayId = childNode.Attributes[ "source" ].Value;
// Get the part after the '#'
if( arrayId.StartsWith( "#" ) )
arrayId = arrayId.Substring( 1 );
else
log.InfoFormat( "Array Id {0} does not start with '#'", arrayId );
Debug.Assert( DataSources.ContainsKey( arrayId ) );
DataSource dataSource = DataSources[ arrayId ];
// TODO: Check stride and offset
Accessor accessor = new Accessor( dataSource, accessorId );
int stride = -1;
if( childNode.Attributes[ "stride" ] != null )
stride = int.Parse( childNode.Attributes[ "stride" ].Value );
accessor.Stride = stride;
ReadAccessor( accessor, childNode );
// Link this accessor in both as the source, and the id, which
// allows us to reference it by either name
Accessors[ accessorId ] = accessor;
Accessors[ source.SourceId ] = accessor;
source.AddAccessor( accessor );
}
break;
case "combiner":
ReadCombiner( source.SourceId, childNode, meshInfo );
break;
case "joints":
{
SkinController skinController = controller as SkinController;
Debug.Assert( skinController != null );
ReadJoints( skinController, childNode, meshInfo );
}
break;
default:
DebugMessage( childNode );
break;
}
}
}