public static ItemXML Load(TextAsset _xmlFile) { XmlSerializer serializer = new XmlSerializer(typeof(ItemXML)); StringReader reader = new StringReader(_xmlFile.text); ItemXML createItem = serializer.Deserialize(reader) as ItemXML; return(createItem); }
//아이템 추가 하는 함수 public void AddItem(ItemXML item) { itemContainer.items.Add(item); Save(); Load(); }
private void Awake() { instance = this; asset = Resources.Load <TextAsset>("XML/ItemDatabase"); itemXML = ItemXML.Load(asset); }