public void Initialize(ContentManager Content)
{
this.Content = Content;
foreach (Frame f in frames)
{
try
{
path = System.Configuration.ConfigurationManager.AppSettings[config_type].ToString();
//loading texture
if (f.value != null)
{
Texture2D t = (Texture2D)Maze.dContentRes[System.Configuration.ConfigurationManager.AppSettings[config_type].ToString().ToUpper() + f.value.ToUpper()];
if (t == null)
{
f.SetTexture(Content.Load<Texture2D>(@"Content/" + path + f.value));
}
else
{
f.SetTexture(t);
}
}
//loading sound
if (f.sound != null)
{
SoundEffect s = (SoundEffect)Maze.dContentRes[PrinceOfPersiaGame.CONFIG_SOUNDS + f.sound.ToUpper()];
f.SetSound(s);
}
}
catch (Exception ex)
{
System.Console.WriteLine("ERROR:Content.Load<dContentRes>" + ex.ToString() + config_type.ToUpper() + f.value);
}
}
}