예제 #1
0
    public void FromXml(string xml)
    {
        try
        {
            XmlDocument doc = new XmlDocument();

            doc.LoadXml(xml);

            XmlElement root = doc.DocumentElement;

            manifest = root.GetAttribute("manifest");
            version  = root.GetAttribute("version").ToInt32Ex();

            assets.Clear();

            for (int i = 0; i < root.ChildNodes.Count; ++i)
            {
                XmlElement child = root.ChildNodes[i] as XmlElement;
                AssetFile  asset = new AssetFile();
                asset.FromXml(child);
                Add(asset);
            }
        }
        catch (Exception e)
        {
            Debug.LogError(e.Message);
            throw e;
        }
    }