/// <summary>
        /// 将内存窗口下的数据进行过滤,存储在 MemoryElement 实例中
        /// </summary>
        /// <param name="filterDepth">过滤深度</param>
        /// <param name="filterSize">过滤内存大小</param>
        public static MemoryElement GetMemoryDetail(int filterDepth, float filterSize)
        {
            if (!ConfirmWindow(ProfilerArea.Memory))
            {
                return(null);
            }

            if (IsWindowEmpty())
            {
                return(null);
            }

            // 得到内存窗口下的内存数据记录类
            CustomType memoryList = new CustomType(window.PrivateInstanceField("m_MemoryListView"));

            if (memoryList == null || memoryList.InnerObject == null)
            {
                UnityEngine.Debug.LogError("m_MemoryListView获取失败,请检查Unity版本");
                return(null);
            }

            var root = memoryList.PrivateInstanceField("m_Root");

            return(root != null?MemoryElement.Create(new CustomType(root), 0, filterDepth, filterSize) : null);
        }
        /// <summary>
        /// 写入内存数据
        /// </summary>
        public static void WriteMemoryDetail(StreamWriter writer, MemoryElement root)
        {
            if (root == null)
            {
                return;
            }

            writer.WriteLine(root.ToString());
            foreach (var child in root.children)
            {
                WriteMemoryDetail(writer, child);
            }
        }