Files
riversong-code-showcase/Source/Riversong/Game/DebugCommands/DebugCommandsSystem.cs
2026-05-21 16:04:49 +02:00

44 lines
1.1 KiB
C#

using System;
using Cysharp.Threading.Tasks;
using QFSW.QC;
namespace DanieleMarotta.RiversongCodeShowcase
{
[GameSystemGroup(typeof(DebugSystemGroup))]
public class DebugCommandsSystem : GameSystem, IInitializable, IDisposable
{
[InjectService]
private IUnlocksService _unlocksService;
[InjectService]
private ISignalBus _signalBus;
public DebugCommandsSystem(IServiceLocator serviceLocator) : base(serviceLocator)
{
}
public UniTask InitializeAsync()
{
QuantumRegistry.RegisterObject(this);
return UniTask.CompletedTask;
}
public void Dispose()
{
QuantumRegistry.DeregisterObject(this);
}
[Command("unlock-all", MonoTargetType.Registry)]
private void UnlockAll()
{
_unlocksService.UnlockAll();
}
[Command("complete-demo", MonoTargetType.Registry)]
private void CompleteDemo(float gameTime = 15 * 60)
{
_signalBus.Raise(new DemoCompletedSignal(gameTime));
}
}
}