public BatchedAnimatedModelContainer(BatchRenderedAnimatedModel batchedModel, Texture2D texture) { ActiveInstances = new List<AnimatedModelInstance>(); BatchedModel = batchedModel; Texture = texture; }
public void LoadContent(ContentManager contentManager, GraphicsDevice graphicsDevice) { // This isn't so good, I want to reuse the same batchrenderedanimatedmodel class, with different textures Dictionary<string, BatchRenderedAnimatedModel> modelMap = new Dictionary<string, BatchRenderedAnimatedModel>(); foreach (DancerTypeData dancerData in DancerTypes.Dancers) { BatchRenderedAnimatedModel animatedModel; if (!modelMap.TryGetValue(dancerData.ModelAssetPath, out animatedModel)) { animatedModel = new BatchRenderedAnimatedModel( graphicsDevice, contentManager.Load<Model>(dancerData.ModelAssetPath)); modelMap[dancerData.ModelAssetPath] = animatedModel; } BatchedAnimatedModelContainer animatedContainer = new BatchedAnimatedModelContainer( animatedModel, contentManager.Load<Texture2D>(dancerData.TextureAssetPath)); _batchedAnimatedModelContainers.Add(animatedContainer); } }