riversong code showcase
This commit is contained in:
44
Source/Riversong/Game/DebugCommands/DebugCommandsSystem.cs
Normal file
44
Source/Riversong/Game/DebugCommands/DebugCommandsSystem.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
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));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user