public static SerialVector2[] ToVector2Array(UnityEngine.Vector2[] vects)
    {
        if (null == vects)
        {
            return(null);
        }

        SerialVector2[] temp =
            new SerialVector2[vects.Length];

        for (int index = vects.Length - 1; index >= 0; --index)
        {
            temp[index] = vects[index];
        }

        return(temp);
    }
Exemple #2
0
    public override DataRecord Parse(DataRecord record, string Contents)
    {
        var n = System.Xml.Linq.XDocument.Parse(Contents);

        System.Xml.Linq.XNamespace gml = "http://www.opengis.net/gml";
        System.Xml.Linq.XNamespace ms  = "http://mapserver.gis.umn.edu/mapserver";
        var query = n.Root.Descendants(gml + "featureMember");


        record.Lines = new List <List <SerialVector2> >();
        foreach (var c in query)
        {
            //var d = c.Elements();

            foreach (var e in c.Descendants(ms + "msGeometry").Elements())
            {
                record.Lines.Add(SerialVector2.ToVector2Array(getPoints(e.Value).ToArray()).ToList());
            }
        }
        return(record);
    }