2012-04-18 69 views
0
ExplosionSound = Content.Load<SoundEffect>("explosion"); 
      ExplosionSoundInstance = ExplosionSound.CreateInstance(); 

上面代码的最后一行加下划线,我也得到一个错误,说明后: “无法隐式转换类型“Microsoft.Xna.Framework.Audio.SoundEffectInstance '到Microsoft.Xna.Framework.Audio.SoundEffect'。收到错误加载声音效果和声音效果实例

帮助,将不胜感激,谢谢。

回答

1

这看起来好像你被宣布为ExplosionSoundInstance ... SoundEffect中

声明为SoundEffectInstance ....

SoundEffectInstance ExplosionSoundInstance;