void Load(string _strFilePath)
    {
        XElement root = XDocument.Load(_strFilePath).Root;

        foreach (XElement element in root.Elements())
        {
            EquipmentInfo tmp = new EquipmentInfo();
            tmp.m_EquipmentInfo            = new EquipmentInfomationData();
            tmp.m_EquipmentInfo.m_strTitle = element.Attribute("name").Value;
            Debug.LogError(tmp.m_EquipmentInfo.m_strTitle);


            List <EquipmentInfomation> listEquipmentInfomation = new List <EquipmentInfomation>();

            foreach (XElement i in element.Elements())
            {
                EquipmentInfomation equipmentInfomation = new EquipmentInfomation(
                    i.Attribute("patht").Value,
                    int.Parse(i.Attribute("w").Value),
                    int.Parse(i.Attribute("h").Value),
                    i.Attribute("texture").Value,
                    (i.Attribute("h_information") != null ? int.Parse(i.Attribute("h_information").Value) : 498));
                listEquipmentInfomation.Add(equipmentInfomation);
            }
            tmp.m_EquipmentInfo.m_listEquipmentInfo = listEquipmentInfomation;
            tmp.SaveEquipment();
        }

        Debug.Log("Load xml suc");
    }
 public EquipmentInfomation(EquipmentInfomation _EquipmentInfomation)
 {
     m_strType            = _EquipmentInfomation.m_strType;
     m_nW                 = _EquipmentInfomation.m_nW;
     m_nH                 = _EquipmentInfomation.m_nH;
     m_strBase64          = _EquipmentInfomation.m_strBase64;
     m_strInformation     = _EquipmentInfomation.m_strInformation;
     m_nHeightInformation = _EquipmentInfomation.m_nHeightInformation;
     m_texture            = _EquipmentInfomation.m_texture;
 }
    /// <summary>
    /// 解析xml使用的
    /// </summary>
    /// <param name="_strEquipmentName">设备的名称,或者路径</param>
    /// <param name="_dic">equipment infomation 列表</param>
    /// <param name="_strXmlContent">主要用于android下出现的无法读取的问题</param>
    /// <param name="_bIsPath">第一个变量是否为路径</param>
    /// <returns>返回为一个设备信息</returns>
    public EquipmentInfo LoadXml(string _strEquipmentName, ref Dictionary <string, EquipmentInfo> _dic, string _strXmlContent = "", bool _bIsPath = false)
    {
#if UNITY_ANDROID
        if (true)
        {
#else
        string v_strFilePath = _bIsPath ? _strEquipmentName : Application.streamingAssetsPath + "/equipment/" + _strEquipmentName + ".xinfo";

        if (_bIsPath)
        {
            string[] sArray = _strEquipmentName.Split('\\');
            _strEquipmentName = sArray[sArray.Length - 1];
            _strEquipmentName = _strEquipmentName.Substring(0, _strEquipmentName.LastIndexOf('.'));
        }

        if (System.IO.File.Exists(v_strFilePath))
        {
#endif

#if UNITY_ANDROID
            Debug.Log(_strXmlContent);
            XElement root = XDocument.Parse(_strXmlContent).Root;                                             //加载对应路径的设备信息
#else
            XElement root = XDocument.Load(v_strFilePath).Root;                                               //加载对应路径的设备信息
#endif
            GameObject    v_tmpPerfabEquipmentInfo = AddElement();                                            //添加一个页面
            EquipmentInfo equipmentInfo            = v_tmpPerfabEquipmentInfo.GetComponent <EquipmentInfo>(); //得到对应物体的脚本
            equipmentInfo.onShow.AddListener((string _arg0) => { ShowPnlEquipmentInfo(_arg0); });             //绑定打开事件
            equipmentInfo.onClose.AddListener((string _arg0) => { });                                         //绑定关闭事件

            string equipmentName = root.Attribute("name").Value;

            List <EquipmentInfomation> listEquipmentInfomation = new List <EquipmentInfomation>();

            foreach (XElement i in root.Elements())
            {
                EquipmentInfomation equipmentInfomation = new EquipmentInfomation(
                    i.Attribute("patht").Value,
                    int.Parse(i.Attribute("w").Value),
                    int.Parse(i.Attribute("h").Value),
                    i.Attribute("texture").Value,
                    (i.Attribute("h_information") != null ? int.Parse(i.Attribute("h_information").Value) : 498));
                Debug.Log(i.Attribute("h_information"));
                listEquipmentInfomation.Add(equipmentInfomation);
            }

            equipmentInfo.Init(_strEquipmentName, equipmentName, listEquipmentInfomation, m_bIsEditor);
            equipmentInfo.Show();

            if (!_dic.ContainsKey(_strEquipmentName))
            {
                _dic.Add(_strEquipmentName, equipmentInfo);
            }

            UpdateOutline();
            return(equipmentInfo);
        }

        return(null);
    }

    /// <summary>
    /// 添加一个元素
    /// </summary>
    /// <returns>将创建的元素返回</returns>
    GameObject AddElement()
    {
        GameObject v_tmpPerfabEquipmentInfo = (GameObject)Instantiate(Resources.Load(m_strEquipmentInformationElement) as GameObject, this.transform);

        v_tmpPerfabEquipmentInfo.transform.localPosition = Vector3.zero;
        v_tmpPerfabEquipmentInfo.transform.localScale    = Vector3.one;

        return(v_tmpPerfabEquipmentInfo);
    }

    /// <summary>
    /// 点击新建的时候
    /// </summary>
    void OnAddElement()
    {
        if (m_bIsEditor)
        {
            GameObject tmp = AddElement();
            List <EquipmentInfomation> tmp2 = new List <EquipmentInfomation>();
            tmp2.Add(new EquipmentInfomation());
            tmp.GetComponent <EquipmentInfo>().Init("设备名称", "设备名称", tmp2, m_bIsEditor);

            tmp.GetComponent <EquipmentInfo>().onSave.AddListener((string _arg0) =>
            {
                if (!m_dicEquipmentInfo.ContainsKey(_arg0))
                {
                    m_dicEquipmentInfo.Add(_arg0, tmp.GetComponent <EquipmentInfo>());
                }

                UpdateOutline();
            });
            tmp.GetComponent <EquipmentInfo>().Show();
        }
    }