// Lazily instantiate the GameContentManager class when the instance is called the first time.
        public static GameContentManager GetInstance()
        {
            if (_instance == null)
            {
                _instance = new GameContentManager();
            }

            return(_instance);
        }
示例#2
0
        protected override void Initialize()
        {
            // TODO: Add your initialization logic here

            content = new ContentManager(this.Services, "Content");
            LevelManager.GetInstance().Game = this;

            ScreenManager.Initialize(this);
            GameContentManager.GetInstance().Initialize(this.Content);

            Components.Add(ScreenManager.GetInstance());

            ScreenManager.GetInstance().AddScreen(new MainMenuScreen(), null);
            Components.Add(new Mario(this));

            base.Initialize();
        }