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


C# BasicEffect.Clone方法代码示例

本文整理汇总了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;
        }
开发者ID:rubna,项目名称:MetroidClone,代码行数:25,代码来源:DrawWrapper.cs

示例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;
        }
开发者ID:ajbowler,项目名称:Asteroids,代码行数:14,代码来源:Skybox.cs

示例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);
        }
开发者ID:ajbowler,项目名称:Asteroids,代码行数:26,代码来源:Powerup.cs

示例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);
        }
开发者ID:ajbowler,项目名称:Asteroids,代码行数:18,代码来源:Spaceship.cs

示例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;
        }
开发者ID:ewencluley,项目名称:Space1939,代码行数:16,代码来源:Skybox.cs


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