Moar Gamecraft commands!
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

42 rindas
978B

  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. using GamecraftModdingAPI.Commands;
  13. namespace ExtraCommands.Basics
  14. {
  15. [CustomCommand("Wait")]
  16. class WaitCommandEngine : ICustomCommandEngine
  17. {
  18. public string Description => "Delay execution (freeze the game) for a length of time (ms)";
  19. public string Name => "Wait";
  20. public IEntitiesDB entitiesDB { set; private get; }
  21. public void Ready()
  22. {
  23. CommandRegistrationHelper.Register<int>("Wait", WaitCommand, "Delay execution (freeze the game) for a length of time (ms)");
  24. }
  25. private void WaitCommand(int ms)
  26. {
  27. System.Threading.Thread.Sleep(ms);
  28. }
  29. public void Dispose()
  30. {
  31. CommandRegistrationHelper.Unregister("Wait");
  32. }
  33. }
  34. }