示例#1
0
 private static void LoadLayers(XmlTextReader xmlReader, Scene scene, TextureManager textureManager)
 {
     xmlReader.MoveToContent();
     while (xmlReader.Read())
     {
         if ("layer" == xmlReader.Name)
         {
             string name = xmlReader.GetAttribute("name");
             string textureId = xmlReader.GetAttribute("textureid");
             Layer layer = new Layer(name);
             layer.SetImage(textureManager.Get(textureId));
             scene.AddLayer(layer);
         }
         else if ("layers" == xmlReader.Name)
         {
             return;
         }
     }
 }