为什么此错误显示为“成员名称不能与封闭类型相同”。为什么 SpriteAnimationManager 在此代码中显示为错误?//ComplexSpriteSheetAnimationGame.cs
public ComplexSpriteSheetAnimationGame()
{
float timer;
float interval = 200;
AnimationSet animationSet;
}
protected override void Initialize()
{
animationSet = SpriteAnimationManager.Read(@”Content\SpriteDescription.xml”);
base.Initialize();
}
//SpriteAnimationManager.cs
public static int AnimationCount;
// Read the Sprite Sheet Description information from the
// description xml file
public static AnimationSet Read(string Filename)
{
AnimationSet animationSet = new AnimationSet();
// Create an XML reader for the sprite sheet animation
// description file
using (System.Xml.XmlReader reader =
System.Xml.XmlReader.Create(Filename))
{
// Create an XMLSerializer for the AnimationSet
XmlSerializer serializer = new
XmlSerializer(typeof(AnimationSet));
// Deserialize the Animation Set from the
// XmlReader to the animation set object
animationSet =
(AnimationSet)serializer.Deserialize(reader);
}
// Count the animations to Animation Count
AnimationCount = animationSet.Animations.Length;
return animationSet;
}