コード例 #1
0
        public void ParseTileXml(XElement elem, TmxMap tmxMap, uint firstId)
        {
            Logger.WriteVerbose("Parse tile data (gid = {0}, id {1}) ...", GlobalId, LocalId);
            Properties = TmxProperties.FromXml(elem);
            XElement xElement = elem.Element("objectgroup");

            if (xElement != null)
            {
                ObjectGroup = TmxObjectGroup.FromXml(xElement, null, tmxMap);
                FixTileColliderObjects(tmxMap);
            }
            XElement xElement2 = elem.Element("animation");

            if (xElement2 != null)
            {
                Animation = TmxAnimation.FromXml(xElement2, firstId);
            }
        }
コード例 #2
0
        public void ParseTileXml(XElement elem, TmxMap tmxMap, uint firstId)
        {
            Logger.WriteVerbose("Parse tile data (gid = {0}, id {1}) ...", this.GlobalId, this.LocalId);

            this.Properties = TmxProperties.FromXml(elem);

            // Do we have an object group for this tile?
            XElement elemObjectGroup = elem.Element("objectgroup");
            if (elemObjectGroup != null)
            {
                this.ObjectGroup = TmxObjectGroup.FromXml(elemObjectGroup, null, tmxMap);
                FixTileColliderObjects(tmxMap);
            }

            // Is this an animated tile?
            XElement elemAnimation = elem.Element("animation");
            if (elemAnimation != null)
            {
                this.Animation = TmxAnimation.FromXml(elemAnimation, firstId);
            }
        }