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 { /// /// The active instance of the logger. /// 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 typeFilter; private void Awake() { Instance = this; } public static void Log(string message, LogType type) { if (Instance.loggingEnabled && Instance.typeFilter.Contains(type)) { Debug.Log($"[{type}] {message}"); } } } }