public void LoadContent(ContentTracker content, bool loadAsync) { if (loadAsync) { // Store AssetTracker for status checking Tracker = content.LoadAsync<Model>(ModelName, AssetLoaded); } else { // Normal non-threaded loading Model = content.Load<Model>(ModelName); // Call loaded method to assign effect parameters AssetLoaded(Model); // Get the tracker. We want to use the AssetChanged event Tracker = content.GetTracker(ModelName); } // Respond to the AssetChanged callback. // This allows us to ensure the asset reference is up-to-date. if (Tracker != null) { Tracker.AssetChanged += AssetLoaded; } }
public IContentManager(Game game) #endif { #if XBOX360 cmanagerInternal = new ResourceContentManager(game.Services, ResourcesXbox.ResourceManager); #elif REACH cmanagerInternal = new ResourceContentManager(game.Services, PloobsEngineReach.Resource2.ResourceManager); #elif WINDOWS_PHONE && !SILVER cmanagerInternal = new ResourceContentManager(game.Services, Resource3.ResourceManager); #elif SILVER cmanagerInternal = new ResourceContentManager(ContentManager.ServiceProvider, Resource3.ResourceManager); #else cmanagerInternal = new ResourceContentManager(game.Services, ResourcesPC.ResourceManager); #endif #if SILVER ContentTracker ContentTracker = new ContentTracker(ContentManager.ServiceProvider, "Content"); #else ContentTracker ContentTracker = game.Content as ContentTracker; #endif System.Diagnostics.Debug.Assert(ContentTracker != null); this.externalContentManager = ContentTracker; }
/// <summary> /// Call LoadContent on the child ModelInfo objects /// and set Active flag to true /// </summary> /// <param name="contentTracker"></param> /// <param name="loadAsync"></param> public void LoadContent(ContentTracker contentTracker, bool loadAsync) { content = contentTracker; foreach (ModelInfo mi in Models) { mi.LoadContent(contentTracker, loadAsync); } Active = true; }
public TestGame() { graphics = new GraphicsDeviceManager(this); contentTracker = new ContentTracker(this.Services); this.Content = contentTracker; }