コード例 #1
0
        public void Connect(WayPoint NewWayPoint)
        {
            PathFinderNode currentNode = Path;

            while (currentNode != null)
            {
                currentNode.RemoveFromLayer();
                currentNode = currentNode.NextNode;
            }
            if (NextWayPoint != null && NextWayPoint.PreviousWayPoint == this)
            {
                NextWayPoint.PreviousWayPoint = null;
            }

            Path = Map.PathFinder.FindPath(Point, NewWayPoint.Point);
            if (Path != null)
            {
                Path.PathLayer = PathLayer;
                NextWayPoint   = NewWayPoint;
                NewWayPoint.PreviousWayPoint = this;
                currentNode = Path;
                while (currentNode != null)
                {
                    PathLayer.AddObject(currentNode);
                    currentNode = currentNode.NextNode;
                }
            }
        }
コード例 #2
0
        public void Disconnect()
        {
            PathFinderNode currentNode = Path;

            while (currentNode != null)
            {
                currentNode.RemoveFromLayer();
                currentNode = currentNode.NextNode;
            }
        }