private static void UpdateSoundReference(XmlSprite oldSprite, XmlSprite newSprite, int scriptCount, int brickCount)
{
var oldSoundReference = (oldSprite.Scripts.Scripts[scriptCount].Bricks.Bricks[brickCount] as XmlPlaySoundBrick).XmlSoundReference;
var newSoundReference = (newSprite.Scripts.Scripts[scriptCount].Bricks.Bricks[brickCount] as XmlPlaySoundBrick).XmlSoundReference;
var soundCount = 0;
foreach (var sound in oldSprite.Sounds.Sounds)
{
if (sound == oldSoundReference.Sound)
{
newSoundReference.Sound = newSprite.Sounds.Sounds[soundCount];
return;
}
soundCount++;
}
}