示例#1
0
        public static UnityApi ImportFrom(FileSystemPath apiXml)
        {
            var doc     = XDocument.Load(apiXml.FullPath);
            var apiNode = doc.FirstNode as XElement;

            if (apiNode?.Name != "api")
            {
                throw new InvalidDataException("Cannot find root api node");
            }
            var api = new UnityApi();

            api.ImportVersionRange(apiNode, null);
            foreach (var typeElement in apiNode.Descendants("type"))
            {
                api.myTypes.Add(UnityApiType.ImportFrom(typeElement, api));
            }
            return(api);
        }