rabidus-test/Assets/Graphy - Ultimate Stats Mon.../Runtime/Ram/G_RamMonitor.cs

43 lines
1.2 KiB
C#
Raw Permalink Normal View History

2023-09-11 15:44:17 +03:00
/* ---------------------------------------
* Author: Martin Pane (martintayx@gmail.com) (@tayx94)
* Contributors: https://github.com/Tayx94/graphy/graphs/contributors
* Project: Graphy - Ultimate Stats Monitor
* Date: 15-Dec-17
* Studio: Tayx
*
* Git repo: https://github.com/Tayx94/graphy
*
* This project is released under the MIT license.
* Attribution is not required, but it is always welcomed!
* -------------------------------------*/
using UnityEngine;
#if UNITY_5_5_OR_NEWER
using UnityEngine.Profiling;
#endif
namespace Tayx.Graphy.Ram
{
public class G_RamMonitor : MonoBehaviour
{
#region Properties -> Public
public float AllocatedRam { get; private set; }
public float ReservedRam { get; private set; }
public float MonoRam { get; private set; }
#endregion
#region Methods -> Unity Callbacks
private void Update()
{
AllocatedRam = Profiler.GetTotalAllocatedMemoryLong()/ 1048576f;
ReservedRam = Profiler.GetTotalReservedMemoryLong() / 1048576f;
MonoRam = Profiler.GetMonoUsedSizeLong() / 1048576f;
}
#endregion
}
}