Files
Main/Assets/Plugins/References/FuncellBase/Hardware/Memory/DefaultMemoryInfo.cs
2025-01-25 04:38:09 +08:00

35 lines
775 B
C#

using System;
using System.Collections.Generic;
using System.Text;
namespace Thousandto.Core.Base
{
/// <summary>
/// 默认的内存信息
/// </summary>
public class DefaultMemoryInfo:IMemoryInfo
{
//可用内存 -- 默认是无限的
public long GetFreeMemory()
{
return long.MaxValue;
}
//总的内存数
public double GetSumMemory()
{
return UnityEngine.SystemInfo.systemMemorySize;
}
//当前进程使用的内存
public double GetAppUsedMemory()
{
#if !UNITY_WEBPLAYER
return (System.Diagnostics.Process.GetCurrentProcess().PrivateMemorySize64 >> 20);
#else
return 0;
#endif
}
}
}