コード例 #1
0
ファイル: Oil.cs プロジェクト: Lixue9jiu/SCIE
    public override void Initialize()
    {
        Colors = new[] { new Color(30, 30, 30), default(Color), new Color(184, 134, 11), new Color(160, 82, 45), new Color(255, 231, 186) };
        var model     = ContentManager.Get <Model>("Models/FullBucket");
        var meshParts = model.FindMesh("Contents").MeshParts;

        StandaloneBlockMesh.AppendModelMeshPart(meshParts[0], BlockMesh.GetBoneAbsoluteTransform(model.FindMesh("Contents").ParentBone) * Matrix.CreateRotationY(MathUtils.DegToRad(180f)) * Matrix.CreateTranslation(0f, -0.3f, 0f), false, false, false, false, new Color(30, 30, 30));
        StandaloneBlockMesh.TransformTextureCoordinates(Matrix.CreateTranslation(0.8125f, 0.6875f, 0f));
        meshParts = model.FindMesh("Bucket").MeshParts;
        StandaloneBlockMesh.AppendModelMeshPart(meshParts[0], BlockMesh.GetBoneAbsoluteTransform(model.FindMesh("Bucket").ParentBone) * Matrix.CreateRotationY(MathUtils.DegToRad(180f)) * Matrix.CreateTranslation(0f, -0.3f, 0f), false, false, false, false, Color.White);
        var rottenMeatBlock = new Game.RottenMeatBlock()
        {
            DefaultShadowStrength = -1
        };

        rottenMeatBlock.Initialize();
        m_standaloneBlockMesh = rottenMeatBlock.m_standaloneBlockMesh;
        base.Initialize();
    }