Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion Assets/Plugins/WebGLMemoryStats/WebGLMemoryStats.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ namespace Kongregate {
public class WebGLMemoryStats : MonoBehaviour {
[Tooltip("Interval (in seconds) between log entries")]
public uint LogIntervalSeconds = 15;
public bool enableInProductionBuilds;

public static uint GetUsedMemorySize() {
return GetTotalStackSize() + GetStaticMemorySize() + GetDynamicMemorySize();
Expand All @@ -16,7 +17,10 @@ public static uint GetFreeMemorySize() {
}

void Start() {
InvokeRepeating("Log", 0, LogIntervalSeconds);
if (Debug.isDebugBuild || enableInProductionBuilds)
{
InvokeRepeating("Log", 0, LogIntervalSeconds);
}
}

private void Log() {
Expand Down