Exemple #1
0
        private void HandleForwardMovement(ref ForwardMoverNode mover)
        {
            var entity = mover.Entity;

            if (!entity.Tags.Contain(EntityTags.Moving) || mover.Tr == null)
            {
                return;
            }
            var ms = mover.MoveSpeed?.Speed ?? 1;

            mover.Entity.Post(new MoveTransform(mover.Tr, mover.Tr.forward * ms * TimeManager.DeltaTime));
        }
Exemple #2
0
        public MoverSystem()
        {
            NodeFilter <ForwardMoverNode> .Setup(ForwardMoverNode.GetTypes());

            _forwardMovers = EntityController.GetNodeList <ForwardMoverNode>();
            NodeFilter <RotateToNode> .Setup(RotateToNode.GetTypes());

            _rotators = EntityController.GetNodeList <RotateToNode>();
            NodeFilter <SimpleMoverNode> .Setup(SimpleMoverNode.GetTypes());

            _simpleMovers = EntityController.GetNodeList <SimpleMoverNode>();
            NodeFilter <ArcMoverNode> .Setup(ArcMoverNode.GetTypes());

            _arcMovers = EntityController.GetNodeList <ArcMoverNode>();
        }