comment pass
This commit is contained in:
@@ -19,25 +19,24 @@ namespace EscapeRoomEngine.Engine.Runtime.Utilities
|
||||
|
||||
public class Logger : MonoBehaviour
|
||||
{
|
||||
public static Logger DefaultLogger
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_foundLogger == null)
|
||||
{
|
||||
_foundLogger = FindObjectOfType<Logger>();
|
||||
}
|
||||
return _foundLogger;
|
||||
}
|
||||
}
|
||||
private static Logger _foundLogger;
|
||||
/// <summary>
|
||||
/// The active instance of the logger.
|
||||
/// </summary>
|
||||
private static Logger Instance { get; set; }
|
||||
|
||||
[Tooltip("Toggle logging on or off globally.")]
|
||||
public bool loggingEnabled;
|
||||
[Tooltip("This list determines what types of log messages should be displayed.")]
|
||||
public List<LogType> typeFilter;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
Instance = this;
|
||||
}
|
||||
|
||||
public static void Log(string message, LogType type)
|
||||
{
|
||||
if (DefaultLogger.loggingEnabled && DefaultLogger.typeFilter.Contains(type))
|
||||
if (Instance.loggingEnabled && Instance.typeFilter.Contains(type))
|
||||
{
|
||||
Debug.Log($"<b>[{type}]</b> {message}");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user