connect multiple rooms with doors
This commit is contained in:
37
Assets/Escape Room Engine/Engine/Scripts/Utilities/Logger.cs
Normal file
37
Assets/Escape Room Engine/Engine/Scripts/Utilities/Logger.cs
Normal file
@@ -0,0 +1,37 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Escape_Room_Engine.Engine.Scripts.Utilities
|
||||
{
|
||||
public enum LogType
|
||||
{
|
||||
Important, ModulePlacement, PassageConnection, RoomGeneration
|
||||
}
|
||||
|
||||
public class Logger : MonoBehaviour
|
||||
{
|
||||
public static Logger DefaultLogger
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_foundLogger == null)
|
||||
{
|
||||
_foundLogger = FindObjectOfType<Logger>();
|
||||
}
|
||||
return _foundLogger;
|
||||
}
|
||||
}
|
||||
private static Logger _foundLogger;
|
||||
|
||||
public bool loggingEnabled;
|
||||
public List<LogType> typeFilter;
|
||||
|
||||
public static void Log(string message, LogType type = LogType.Important)
|
||||
{
|
||||
if (DefaultLogger.loggingEnabled && DefaultLogger.typeFilter.Contains(type))
|
||||
{
|
||||
Debug.Log($"<b>[{type}]</b> {message}");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user