comment pass

This commit is contained in:
2022-12-29 16:16:49 +01:00
parent 643e03192a
commit ff01a700bd
75 changed files with 634 additions and 65 deletions

View File

@@ -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}");
}