Skip to content

Instantly share code, notes, and snippets.

View Fastzargon's full-sized avatar
🏠
Working from home

Fastzargon

🏠
Working from home
View GitHub Profile
@Fastzargon
Fastzargon / DebugExample
Created August 25, 2022 09:34
Unity DebugOff
private string logKey = "appsLaba";
private string message = "\n App is launched!";
private void Start() {
Debug.Log(logKey + message);
}
@Fastzargon
Fastzargon / DebuggerSetupOne
Created August 25, 2022 09:38
DebuggerOff example one
private void DebuggerSetup() {
#if UNITY_EDITOR
Debug.unityLogger.logEnabled = debugOn;
#else
Debug.unityLogger.logEnabled != debugOn;
#endif
}
@Fastzargon
Fastzargon / Call method
Created August 25, 2022 09:42
DebuggerSet
private void Awake() {
DebuggerSetup();
}
@Fastzargon
Fastzargon / Full Script
Created August 25, 2022 09:43
MethodOneMain
using UnityEngine;
public class Example : MonoBehaviour {
private bool debugOn = true;
private void Awake() {
DebuggerSetup();
}
private void DebuggerSetup() {
@Fastzargon
Fastzargon / MethodTwo
Created August 25, 2022 09:53
MethodTwo
private void DebuggerSetup() {
Debug.unityLogger.logEnabled = Debug.isDebugBuild;
}
@Fastzargon
Fastzargon / FullScriptTwo
Created August 25, 2022 09:57
FullMethodTwo
using UnityEngine;
public class Example : MonoBehaviour {
private void Awake() {
DebuggerSetup();
}
private void DebuggerSetup() {
Debug.unityLogger.logEnabled = Debug.isDebugBuild;