Beispiel #1
0
        public static NavigationNodeMoveEvent alloc(Entity p_sourceEntity, NavigationNode p_navigationNode)
        {
            NavigationNodeMoveEvent l_instance = new NavigationNodeMoveEvent();

            l_instance.Completed            = false;
            l_instance.MovementAllowed      = false;
            l_instance.SourceEntity         = p_sourceEntity;
            l_instance.TargetNavigationNode = p_navigationNode;
            return(l_instance);
        }
Beispiel #2
0
        public static void moveToNavigationNode(Entity p_entity, EventQueue p_eventQueue, List <NavigationNode> p_path)
        {
            AnimationVisualFeedback l_animationVisualFeedback = EntityComponent.get_component <AnimationVisualFeedback>(p_entity);

            if (l_animationVisualFeedback != null)
            {
                EventQueue.enqueueEvent(p_eventQueue, AnimationVisualFeedbackPlayAsyncEvent.alloc(l_animationVisualFeedback,
                                                                                                  AnimationLayers.LOCOMOTION, l_animationVisualFeedback.AnimationVisualFeedbackData.GetAnimation(AnimationLookupTag.LOCOMOTION).GetAnimationInput()));
            }

            var l_pathEnumerator = p_path.GetEnumerator();

            while (l_pathEnumerator.MoveNext())
            {
                EventQueue.enqueueEvent(p_eventQueue, NavigationNodeMoveEvent.alloc(p_entity, l_pathEnumerator.Current));
            }

            if (l_animationVisualFeedback != null)
            {
                EventQueue.enqueueEvent(p_eventQueue, AnimationVisualFeedbackDestroyLayerEvent.alloc(l_animationVisualFeedback, AnimationLayers.LOCOMOTION));
            }
        }