public override void Read(XmlNode os) { foreach (XmlNode current in XmlObject.GetChilds(os)) { switch (current.Name) { case "Id": this.Id = ReadInt(current); break; case "RebornCD": this.RebornCD = ReadFloat(current); break; case "Position": this.Position = ReadVector3(current); break; case "EulerAngles": this.EulerAngles = ReadVector3(current); break; case "PatrolPathNodeSet": this.PatrolPathNodeSet = new MapPathNodeSet(); this.PatrolPathNodeSet.Read(current); break; } } }
public override XmlObject Export() { MapPathNodeSet data = new MapPathNodeSet(); data.Type = Type; for (int i = 0; i < Elements.Count; i++) { MapPathNode node = (MapPathNode)Elements[i].Export(); data.PathNodes.Add(node); } return(data); }
public override void Import(XmlObject pData, bool pBuild) { MapPathNodeSet data = pData as MapPathNodeSet; if (data != null) { Type = data.Type; for (int i = 0; i < data.PathNodes.Count; i++) { GameObject go = new GameObject(); go.name = i.ToString(); go.transform.parent = transform; LevelPathNode p = go.AddComponent <LevelPathNode>(); p.Import(data.PathNodes[i], pBuild); } } }
public override void Read(XmlNode os) { foreach (XmlNode current in XmlObject.GetChilds(os)) { switch (current.Name) { case "Id": this.Id = ReadInt(current); break; case "Position": this.Position = ReadVector3(current); break; case "Euler": this.Euler = ReadVector3(current); break; case "Scale": this.Scale = ReadVector3(current); break; case "Talks": XmlObject.GetChilds(current).ForEach(delegate(XmlNode pNode) { string s = ReadString(pNode); if (!string.IsNullOrEmpty(s)) { this.Talks.Add(s); } }); break; case "PatrolPathNodeSet": this.PatrolPathNodeSet = new MapPathNodeSet(); this.PatrolPathNodeSet.Read(current); break; } } }