Logger.logEnabled

Unity · Версия 2020.3 LTS · Scripting · Logger

Logger.logEnabled

public bool logEnabled;

Описание

Для включения/выключения ведения журнала отладки во время выполнения

using UnityEngine;
using System.Collections;

public class MyGameClass : MonoBehaviour
{
    private static ILogger logger = Debug.unityLogger;
    private static string kTAG = "MyGameTag";

    void Start()
    {
        logger.logEnabled = Debug.isDebugBuild;

        logger.Log(kTAG, "This log will be displayed only in debug build");
    }
}

Обновлено 17 ноября 2026 г.