44 lines
1.1 KiB
C#
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));
|
|
}
|
|
}
|
|
} |