ExplosionSound = Content.Load<SoundEffect>("explosion");
ExplosionSoundInstance = ExplosionSound.CreateInstance();
上面代码的最后一行加下划线,我得到一个错误说明: “无法将类型'Microsoft.Xna.Framework.Audio.SoundEffectInstance'隐式转换为Microsoft.Xna.Framework.Audio.SoundEffect'。
帮助将不胜感激,谢谢。
答案 0 :(得分:1)
看起来好像你将ExplosionSoundInstance声明为SoundEffect ......
将其声明为SoundEffectInstance ....
SoundEffectInstance ExplosionSoundInstance;