I am trying to try some xna unleashed book code. I have all my classes, and no errors. The only error I get is at runtime, and it is
Error loading "Content\Skyboxes\skybox". File contains Microsoft.Xna.Framework.Graphics.Texture2D but trying to load as FinalWork.Skybox.
Is this a known error, and what is the way of fixing it? The classes it is sent to is
public class SkyboxReader : ContentTypeReader<Skybox>
{
protected override Skybox Read(ContentReader input, Skybox existingInstance)
{
return new Skybox(input); //read data from compiled XNB format
}
}
public class Skybox
{
private Model skyboxModel;
private Texture2D skyboxTexture;
// marked as internal since it is only called by our reader
internal Skybox(ContentReader input)
{
skyboxModel = input.ReadObject<Model>();
skyboxTexture = input.ReadObject<Texture2D>();
}
And the call is
skybox = content.Load<Skybox>(@"Content\Skyboxes\skybox");
The above call is just for a .tga file. I dont know what is expected as I dont know what this ContentReader is. Any advise appreciated.
cheers