Пример #1
0
            void IHandleMessage <UnitNavigationEventMessage> .Handle(UnitNavigationEventMessage message)
            {
                if (message.isHandled)
                {
                    return;
                }

                switch (message.eventCode)
                {
                case UnitNavigationEventMessage.Event.WaypointReached:
                {
                    message.isHandled = WanderMaster.MoveNext(message.entity, true);
                    break;
                }

                case UnitNavigationEventMessage.Event.DestinationReached:
                {
                    message.isHandled = WanderMaster.DelayedMove(message.entity);
                    break;
                }

                case UnitNavigationEventMessage.Event.StoppedNoRouteExists:
                case UnitNavigationEventMessage.Event.StoppedDestinationBlocked:
                case UnitNavigationEventMessage.Event.Stuck:
                {
                    message.isHandled = WanderMaster.Start(message.entity);
                    break;
                }
                }
            }
Пример #2
0
 internal void MoveNext()
 {
     WanderMaster.MoveNext(this, false);
 }