Files
trail-into-darkness/Packages/com.jovian.ingame-logging/Runtime/InGameLogger.cs
Sebastian Bularca 31951cfbf8 feat: add channel enable/disable, prefab docs, and UI updates
Add per-channel enable/disable toggle to the in-game logging system
with Enable()/Disable() on InGameLogger and EnableChannel/DisableChannel
on IGameLogStore. Update README with prefab setup guide and enable/disable
documentation. Update character creation and log container prefabs.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 14:37:51 +02:00

36 lines
1.0 KiB
C#

using System.Runtime.CompilerServices;
namespace Jovian.InGameLogging {
public readonly struct InGameLogger {
readonly IGameLogStore store;
readonly LogChannel channel;
public InGameLogger(IGameLogStore store, LogChannel channel) {
this.store = store;
this.channel = channel;
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void Log(string message) {
store.Add(channel, message);
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void Log(string message, string hexColor) {
store.Add(channel, $"<color={hexColor}>{message}</color>");
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void Enable() {
store.EnableChannel(channel);
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void Disable() {
store.DisableChannel(channel);
}
public bool IsEnabled => store.IsChannelEnabled(channel);
}
}