예제 #1
0
        //加载assetInfo信息
        public void LoadAssetInfo()
        {
            StreamReader sr  = ResourcesManager.OpenText("AssetInfo");
            XmlDocument  doc = new XmlDocument();

            doc.LoadXml(sr.ReadToEnd());
            XmlElement  root = doc.DocumentElement;
            IEnumerator iter = root.GetEnumerator();

            while (iter.MoveNext())
            {
                XmlElement child_root = iter.Current as XmlElement;

                //解析AssetInfo信息
                AssetInfo assetInfo = new AssetInfo();
                assetInfo.import(child_root);

                //保存到asset信息列表o
                mNameAssetInfos.Add(assetInfo.mName, assetInfo);
                mIndexAssetInfos.Add(assetInfo.mIndex, assetInfo);
            }
            sr.Close();
        }