Moar Gamecraft commands!
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
1012B

  1. using System;
  2. using RobocraftX.GUI.CommandLine;
  3. using RobocraftX.Multiplayer;
  4. using RobocraftX.StateSync;
  5. using RobocraftX.Character;
  6. using Svelto.ECS;
  7. using Unity.Entities;
  8. using UnityEngine;
  9. using uREPL;
  10. using Svelto.Context;
  11. using RobocraftX;
  12. namespace ExtraCommands.Basics
  13. {
  14. [CustomCommand("Exit", "Forcefully close Gamecraft")]
  15. class ExitCommandEngine : CustomCommandEngine
  16. {
  17. public ExitCommandEngine(UnityContext<FullGameCompositionRoot> ctxHolder, EnginesRoot enginesRoot, World physW, Action reloadGame, MultiplayerInitParameters mpParams) : base(ctxHolder, enginesRoot, physW, reloadGame, mpParams)
  18. {
  19. }
  20. public override void Ready()
  21. {
  22. uREPL.RuntimeCommands.Register("Exit", ExitCommand, "Forcefully close Gamecraft");
  23. }
  24. private void ExitCommand()
  25. {
  26. Application.Quit();
  27. }
  28. public override void Dispose()
  29. {
  30. uREPL.RuntimeCommands.Unregister("Exit");
  31. }
  32. }
  33. }