DebugDisable Cover

S: DebugDisable, Turn off all Debug Logs in Runtime

You might missed to edit out some Debug Logs or forgot about them when exporting your Game. To make sure they wont impact your Game in Runtime you can Disable the unityLogger on Startup

Disable Debug Log to save Performance in Runtime

DebugDisable.cs

				
					using UnityEngine;

public class DebugDisable : MonoBehaviour
{
    void Awake()
    {
<a href="https://stusse-games.com/tag/if/">if</a> UNITY_EDITOR
        Debug.unityLogger.logEnabled = true;
<a href="https://stusse-games.com/tag/else/">else</a>
    Debug.unityLogger.logEnabled = false;
<a href="https://stusse-games.com/tag/endif/">endif</a>
    }
}
				
			

Drag the Script on a GameObject inside the Scene that gets loaded on Startup. This will Disable the Debug unityLogger whenever the Build is different then the Unity Editor. So in Runtime the unityLogger should be disabled and no longer impact your Game Performance.

Happy Development <3

Leave a Reply

Your email address will not be published.