private static void OnStartMoving(ContextActor actor, MovementBehavior movement)
        {
            if (!AllowComparer)
                return;

            var bot = BotManager.Instance.GetCurrentBot();

            Task.Factory.StartNew(
                () =>
                {
                    var element = movement.TimedPath.GetCurrentElement();

                    bot.Character.HighlightCell(element.CurrentCell, Color.Green);

                    while(!movement.IsEnded())
                    {
                        var newElement = movement.TimedPath.GetCurrentElement();

                        if (element != newElement)
                        {
                            element = newElement;

                            bot.Character.ResetCellsHighlight();
                            bot.Character.HighlightCell(element.CurrentCell, Color.Green);
                        }

                        Thread.Sleep(30);
                    }
                });
        }
Beispiel #2
0
 private void StandUp(ContextActor sender, MovementBehavior path)
 {
     m_sit = false;
     m_bot.Character.StartMoving -= StandUp;
 }