本文整理汇总了C#中GraphicFactory.GetAsset方法的典型用法代码示例。如果您正苦于以下问题:C# GraphicFactory.GetAsset方法的具体用法?C# GraphicFactory.GetAsset怎么用?C# GraphicFactory.GetAsset使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GraphicFactory
的用法示例。
在下文中一共展示了GraphicFactory.GetAsset方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LoadBatchInfo
protected override void LoadBatchInfo(GraphicFactory factory, out BatchInformation[][] BatchInformations)
{
TreeProfile t = factory.GetAsset<TreeProfile>(profileName);
if (!String.IsNullOrEmpty(LeaftextureName))
{
t.LeafTexture = factory.GetAsset<Texture2D>(LeaftextureName);
}
if (!String.IsNullOrEmpty(trunktextureName))
{
t.TrunkTexture = factory.GetAsset<Texture2D>(trunktextureName);
}
tree = t.GenerateSimpleTree(StaticRandom.RandomInstance);
BatchInformations = new BatchInformation[2][];
vertexBufferS = new VertexBuffer[2];
indexBufferS = new IndexBuffer[2];
indexBufferS[0] = tree.TrunkMesh.IndexBuffer;
vertexBufferS[0] = tree.TrunkMesh.VertexBuffer;
BatchInformation bi0 = new BatchInformation(0, tree.TrunkMesh.NumberOfVertices, tree.TrunkMesh.NumberOfTriangles, 0, 0, tree.TrunkMesh.Vdeclaration, TreeVertex.SizeInBytes);
BatchInformations[0] = new BatchInformation[1];
BatchInformations[0][0] = bi0;
indexBufferS[1] = tree.LeafCloud.Ibuffer;
vertexBufferS[1] = tree.LeafCloud.Vbuffer;
BatchInformation bi1 = new BatchInformation(0, tree.LeafCloud.Numleaves * 4, tree.LeafCloud.Numleaves * 2, 0, 0, tree.LeafCloud.Vdeclaration, LeafVertex.SizeInBytes);
BatchInformations[1] = new BatchInformation[1];
BatchInformations[1][0] = bi1;
}
示例2: ISoundEmitter3D
/// <summary>
/// Initializes a new instance of the <see cref="ISoundEmitter3D"/> class.
/// </summary>
/// <param name="factory">The factory.</param>
/// <param name="SoundName">Name of the sound.</param>
public ISoundEmitter3D(GraphicFactory factory,String SoundName)
{
System.Diagnostics.Debug.Assert(factory != null);
System.Diagnostics.Debug.Assert(!String.IsNullOrEmpty(SoundName));
this.internalName = SoundName;
SoundEffect se = factory.GetAsset<SoundEffect>(SoundName);
soundEngineInstance = se.CreateInstance();
Name = se.Name;
Duration = se.Duration;
listener = new AudioListener();
emiter = new AudioEmitter();
}
示例3: SimpleSoundEffect
/// <summary>
/// Initializes a new instance of the <see cref="SimpleSoundEffect"/> class.
/// </summary>
/// <param name="factory">The factory.</param>
/// <param name="name">The name.</param>
/// <param name="volume">The volume.</param>
/// <param name="pitch">The pitch(-1 to 1).</param>
/// <param name="pan">The pan (-1 to 1).</param>
/// <param name="isLooped">if set to <c>true</c> [is looped].</param>
public SimpleSoundEffect(GraphicFactory factory, string name, float volume = 1, float pitch = 0, float pan = 0, bool isLooped = false)
{
System.Diagnostics.Debug.Assert(factory != null);
System.Diagnostics.Debug.Assert(!String.IsNullOrEmpty(name));
System.Diagnostics.Debug.Assert(volume >= -1 && volume <= 1);
System.Diagnostics.Debug.Assert(pitch >= -1 && pitch <= 1);
System.Diagnostics.Debug.Assert(pan >= -1 && pan <= 1);
internalName = name;
this.mySoundEffect = factory.GetAsset<SoundEffect>(name);
this.Duration = mySoundEffect.Duration;
this.Name = mySoundEffect.Name;
this.mySoundEffectInstance = mySoundEffect.CreateInstance();
mySoundEffectInstance.Pan = pan;
mySoundEffectInstance.Pitch = pitch;
mySoundEffectInstance.Volume = volume;
mySoundEffectInstance.IsLooped = isLooped;
}
示例4: TerrainMaterial
public TerrainMaterial(GraphicFactory factory, string terrainModelAssetName)
{
_terrainModel = factory.GetAsset<TerrainModel>(terrainModelAssetName);
IsVisible = true;
}