コード例 #1
0
ファイル: XmlDBManager.cs プロジェクト: Xentrics/Praecapatus
        public bool LoadShop(Shop shop, int shopid)
        {
            try
            {
                XmlSerializer serializer = new XmlSerializer(typeof(ShopSaveData));
                FileStream stream = new FileStream(Application.dataPath + shopXMLPrefix + shopid + ".xml", FileMode.Open);
                ShopSaveData sh = serializer.Deserialize(stream) as ShopSaveData;
                stream.Close();

                shop.Set(sh);
                return true;
            }
            catch (FileNotFoundException e)
            {
                Debug.LogError(e.Message);
                return false;
            }
        }