Question by
ShroomWasTaken · Jun 19, 2016 at 05:50 PM ·
unity5unityeditordebug
"In the editor isDebugBuild always returns true." is false?
So, I were gonna add some debugging features in my game, however I couldn't remember how to check if the game was running in a debug build or not.
I came across this documentation page to help me out : click me
And I saw this; "In the editor isDebugBuild always returns true."
And I tried it in my editor, however isDebugBuild returned false anyway?
Is this just me or is there something wrong in the docs of Unity?
Here's what I tried doing :
if (Debug.isDebugBuild == true)
{
if (GUI.Button(new Rect(Screen.width - 70, 10, 60, 30), "Dev info"))
{
if (DeveloperInformation == false)
{
DeveloperInformation = true;
}
else
{
DeveloperInformation = false;
}
}
if (DeveloperInformation == true)
{
GUI.Box(new Rect(Screen.width - 310, 60, 300, 600), "DEVELOPER INFORMATION MENU");
// Stamina Information
GUI.Label(new Rect(Screen.width - 290, 100, 1000, 1000), "Stamina : " + stamina);
GUI.Label(new Rect(Screen.width - 290, 120, 1000, 1000), "Stamina Regen Timer : " + StaminaRegenStartTimer);
GUI.Label(new Rect(Screen.width - 290, 140, 1000, 1000), "Stamina Regen (Per Second) : " + staminaRegen);
GUI.Label(new Rect(Screen.width - 290, 160, 1000, 1000), "Stamina Drain (Per Second) : " + staminaDrain);
// Running Information
GUI.Label(new Rect(Screen.width - 290, 210, 1000, 1000), "Is Player Running : " + isRunning);
}
}
However I had to change the first if statement to this instead since it didn't work in editor :
if (Debug.isDebugBuild == true || Application.isEditor == true)
Comment