Skip to main content
edited title
Link
user1430
user1430

Managing Game and Engine Content How can I reference multiple XNA content projects from my game project?

Source Link
Mike Cluck
  • 1.3k
  • 1
  • 11
  • 24

Managing Game and Engine Content

I'm developing an engine in XNA and would like to have two different ContentManagers: one for the game (sprites, sounds, etc.) and one for the engine (shaders, dlls, etc.)

Right now, I have this:

using Microsoft.Xna.Framework;
....
public class Engine
{
    public ContentManager GameContent;
    public ContentManager EngineContent;
    public IServiceContainer Services = null;

    public Engine(GraphicsDeviceManager Graphics, ContentManager Content)
    {
        Services = new ServiceContainer();
        Services.AddService(typeof(IGraphicsDeviceService), Graphics);
        Services.AddService(typeof(IGraphicsDeviceManager), Graphics);
        GameContent = Content;
        EngineContent = new ContentManager(Services, "EngineContent");
        ...
    }
}

The GameContent and EngineContent projects root directories are set to GameContent and EngineContent, respectively. I have a content reference to EngineContent in the Engine project and references to both GameContent and EngineContent in the Game project.

Why can I access my GameContent but not my EngineContent?