using UnityEngine; using System.Collections; using System.Collections.Generic; using System.Xml; public class ShopManager { public Dictionary dataDict; public Dictionary codeDict; private ShopData vipData; private List coinList; private List cubeList; private List list; public ShopManager() { dataDict = new Dictionary(); codeDict = new Dictionary (); coinList = new List(); cubeList = new List (); list = new List (); InitByXML("XML/Config/All/shop_config"); } public void InitByXML(string path) { TextAsset textAsset = (TextAsset)Resources.Load(path); XmlDocument xml = new XmlDocument(); xml.LoadXml(textAsset.text); XmlNode mapNode = xml.SelectSingleNode("data"); XmlNodeList nodeList = mapNode.SelectNodes("item"); for(int i=0; i GetCoinDataList() { return coinList; } public List GetCubeDataList() { return cubeList; } public List GetDataList() { return list; } public ShopData GetDataByCode(string code) { ShopData data = null; codeDict.TryGetValue (code, out data); return data; } }