本文整理汇总了C#中Microsoft.Xna.Framework.Graphics.BasicEffect.Clone方法的典型用法代码示例。如果您正苦于以下问题:C# BasicEffect.Clone方法的具体用法?C# BasicEffect.Clone怎么用?C# BasicEffect.Clone使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.Xna.Framework.Graphics.BasicEffect
的用法示例。
在下文中一共展示了BasicEffect.Clone方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DrawWrapper
public DrawWrapper(SpriteBatch batch, GraphicsDevice device, AssetManager assetsManager)
{
GlobalScale = 1f;
spriteBatch = batch;
graphicsDevice = device;
deviceWidth = graphicsDevice.Viewport.Width;
Assets = assetsManager;
basicEffect = new BasicEffect(device)
{
VertexColorEnabled = true,
World = Matrix.Identity,
View = Matrix.Identity,
};
guiEffect = (BasicEffect) basicEffect.Clone();
SetProjectionMatrix(standardWidth, standardHeight);
ScreenSize = new Vector2(graphicsDevice.Viewport.Width, graphicsDevice.Viewport.Height);
displayWidth = standardWidth;
displayHeight = standardHeight;
}
示例2: LoadModel
public void LoadModel(ContentManager content, BasicEffect effect)
{
Model model = content.Load<Model>(MODEL_PATH);
int i = 0;
foreach (ModelMesh mesh in model.Meshes)
{
foreach (BasicEffect currentEffect in mesh.Effects)
this.textures[i++] = currentEffect.Texture;
foreach (ModelMeshPart meshPart in mesh.MeshParts)
meshPart.Effect = effect.Clone();
}
this.model = model;
}
示例3: LoadModel
public void LoadModel(ContentManager content, BasicEffect effect)
{
float radius = 0f;
if (this.Type == PowerupType.Shield)
{
this.Model = content.Load<Model>(SHIELD_MODEL_PATH);
this.Texture = content.Load<Texture2D>(SHIELD_TEXTURE_PATH);
}
else
{
this.Model = content.Load<Model>(SHRINK_MODEL_PATH);
this.Texture = content.Load<Texture2D>(SHRINK_TEXTURE_PATH);
}
foreach (ModelMesh mesh in this.Model.Meshes)
{
radius = Math.Max(radius, mesh.BoundingSphere.Radius);
foreach (BasicEffect currentEffect in mesh.Effects)
this.Texture = currentEffect.Texture;
foreach (ModelMeshPart meshPart in mesh.MeshParts)
meshPart.Effect = effect.Clone();
}
this.BoundingSphere = new BoundingSphere(this.Position, radius * 300f);
}
示例4: LoadModelAndTexture
public void LoadModelAndTexture(ContentManager content, BasicEffect effect)
{
float radius = 0f;
this.Model = content.Load<Model>(MODEL_PATH);
foreach (ModelMesh mesh in this.Model.Meshes)
{
radius = Math.Max(radius, mesh.BoundingSphere.Radius);
foreach (BasicEffect currentEffect in mesh.Effects)
this.Texture = currentEffect.Texture;
foreach (ModelMeshPart meshPart in mesh.MeshParts)
meshPart.Effect = effect.Clone();
}
this.BoundingSphere = new BoundingSphere(this.Position, radius);
this.Texture = content.Load<Texture2D>(TEXTURE_PATH);
}
示例5: LoadModel
private Model LoadModel(ContentManager Content, String skyboxName, out Texture2D[] textures)
{
Effect effect = new BasicEffect(game.GraphicsDevice);
Model newModel = Content.Load<Model>("Skyboxes/" + skyboxName+"/skybox");
textures = new Texture2D[newModel.Meshes.Count];
int i = 0;
foreach (ModelMesh mesh in newModel.Meshes)
foreach (BasicEffect currentEffect in mesh.Effects)
textures[i++] = currentEffect.Texture;
foreach (ModelMesh mesh in newModel.Meshes)
foreach (ModelMeshPart meshPart in mesh.MeshParts)
meshPart.Effect = effect.Clone();
return newModel;
}