private void ParseTransformInfo(XmlNode node, IM.Transform iMtrans) { XmlNode pointNode = node.SelectSingleNode("Point"); iMtrans.SetPosition(IM.Vector3.Parse(pointNode.InnerText)); XmlNode rotationNode = node.SelectSingleNode("Rotation"); iMtrans.SetRotaion(IM.Quaternion.Parse(rotationNode.InnerText)); }
private void ReadTipOffPosConfig() { string text = ResourceLoadManager.Instance.GetConfigText(name11); if (text == null) { Debug.LogError("LoadConfig Failed:" + name11); return; } if (TipOffPos.defenses_transform == null) { TipOffPos.defenses_transform = new List <IM.Transform>(); } if (TipOffPos.offenses_transform == null) { TipOffPos.offenses_transform = new List <IM.Transform>(); } XmlDocument xmlDoc = CommonFunction.LoadXmlConfig(name11, text); XmlNode root = xmlDoc.LastChild; XmlNode defenseNode = root.SelectSingleNode("DefenseNode"); XmlNodeList defenseList = defenseNode.ChildNodes; int deCount = defenseList.Count; for (int i = 0; i < deCount; ++i) { XmlNode node = defenseList.Item(i); IM.Transform tempTrans = new IM.Transform(); XmlNode pointNode = node.SelectSingleNode("Point"); XmlNode rotationNode = node.SelectSingleNode("Rotation"); tempTrans.SetPosition(IM.Vector3.Parse(pointNode.InnerText)); tempTrans.SetRotaion(IM.Quaternion.Parse(rotationNode.InnerText)); TipOffPos.defenses_transform.Add(tempTrans); } XmlNode offenseNode = root.SelectSingleNode("OffenseNode"); XmlNodeList offenseList = offenseNode.ChildNodes; int offCount = offenseList.Count; for (int i = 0; i < offCount; ++i) { XmlNode node = offenseList.Item(i); IM.Transform tempTrans = new IM.Transform(); XmlNode pointNode = node.SelectSingleNode("Point"); XmlNode rotationNode = node.SelectSingleNode("Rotation"); tempTrans.SetPosition(IM.Vector3.Parse(pointNode.InnerText)); tempTrans.SetRotaion(IM.Quaternion.Parse(rotationNode.InnerText)); TipOffPos.offenses_transform.Add(tempTrans); } }