2019-10-23 00:40:04 +00:00
|
|
|
using System;
|
|
|
|
using RobocraftX.GUI.CommandLine;
|
|
|
|
using RobocraftX.Multiplayer;
|
|
|
|
using RobocraftX.StateSync;
|
|
|
|
using RobocraftX.Character;
|
|
|
|
using Svelto.ECS;
|
|
|
|
using Unity.Entities;
|
|
|
|
using UnityEngine;
|
|
|
|
using uREPL;
|
|
|
|
using Svelto.Context;
|
|
|
|
using RobocraftX;
|
|
|
|
|
|
|
|
namespace ExtraCommands.Basics
|
|
|
|
{
|
2019-10-24 15:09:37 +00:00
|
|
|
[CustomCommand("Wait")]
|
2019-10-23 00:40:04 +00:00
|
|
|
class WaitCommandEngine : CustomCommandEngine
|
|
|
|
{
|
|
|
|
public WaitCommandEngine(UnityContext<FullGameCompositionRoot> ctxHolder, EnginesRoot enginesRoot, World physW, Action reloadGame, MultiplayerInitParameters mpParams) : base(ctxHolder, enginesRoot, physW, reloadGame, mpParams)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
public override void Ready()
|
|
|
|
{
|
2019-11-05 21:43:49 +00:00
|
|
|
CustomCommandUtility.Register<int>("Wait", WaitCommand, "Delay execution (freeze the game) for a length of time (ms)");
|
2019-10-23 00:40:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
private void WaitCommand(int ms)
|
|
|
|
{
|
|
|
|
System.Threading.Thread.Sleep(ms);
|
|
|
|
}
|
|
|
|
|
|
|
|
public override void Dispose()
|
|
|
|
{
|
2019-10-24 15:09:37 +00:00
|
|
|
CustomCommandUtility.Unregister("Wait");
|
2019-10-23 00:40:04 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|