using System.Collections.Generic; using UnityEngine; namespace EscapeRoomEngine.Engine.Runtime.Utilities { public enum LogType { Important, ModulePlacement, ModuleInstantiation, PassageConnection, RoomGeneration, RequirementResolution, PuzzleFlow, PuzzleDetail, Portals, Measuring } public class Logger : MonoBehaviour { public static Logger DefaultLogger { get { if (_foundLogger == null) { _foundLogger = FindObjectOfType(); } return _foundLogger; } } private static Logger _foundLogger; public bool loggingEnabled; public List typeFilter; public static void Log(string message, LogType type) { if (DefaultLogger.loggingEnabled && DefaultLogger.typeFilter.Contains(type)) { Debug.Log($"[{type}] {message}"); } } } }