Beispiel #1
0
        public static FloodPath Construct(Vector3 start, OnPathDelegate callback = null)
        {
            var p = PathPool.GetPath <FloodPath>();

            p.Setup(start, callback);
            return(p);
        }
Beispiel #2
0
        /** Construct a path with a start and end point.
         * The delegate will be called when the path has been calculated.
         * Do not confuse it with the Seeker callback as they are sent at different times.
         * If you are using a Seeker to start the path you can set \a callback to null.
         *
         * \returns The constructed path object
         */
        public static ABPath Construct(Vector3 start, Vector3 end, OnPathDelegate callback = null)
        {
            var p = PathPool.GetPath <ABPath>();

            p.Setup(start, end, callback);
            return(p);
        }
Beispiel #3
0
        public static RandomPath Construct(Vector3 start, int length, OnPathDelegate callback = null)
        {
            var p = PathPool.GetPath <RandomPath>();

            p.Setup(start, length, callback);
            return(p);
        }
        public static MultiTargetPath Construct(Vector3 start, Vector3[] targets, OnPathDelegate[] callbackDelegates, OnPathDelegate callback = null)
        {
            var p = PathPool.GetPath <MultiTargetPath>();

            p.Setup(start, targets, callbackDelegates, callback);
            return(p);
        }
Beispiel #5
0
        /** Constructs a ConstantPath starting from the specified point.
         * \param start             From where the path will be started from (the closest node to that point will be used)
         * \param maxGScore			Searching will be stopped when a node has a G score greater than this
         * \param callback			Will be called when the path has completed, leave this to null if you use a Seeker to handle calls
         *
         * Searching will be stopped when a node has a G score (cost to reach it) greater or equal to \a maxGScore
         * in order words it will search all nodes with a cost to get there less than \a maxGScore.
         */
        public static ConstantPath Construct(Vector3 start, int maxGScore, OnPathDelegate callback = null)
        {
            var p = PathPool.GetPath <ConstantPath>();

            p.Setup(start, maxGScore, callback);
            return(p);
        }
Beispiel #6
0
        /** Constructs a new FleePath.
         * The FleePath will be taken from a pool.
         */
        public static FleePath Construct(Vector3 start, Vector3 avoid, int searchLength, OnPathDelegate callback = null)
        {
            var p = PathPool.GetPath <FleePath>();

            p.Setup(start, avoid, searchLength, callback);
            return(p);
        }
Beispiel #7
0
        public new static XPath Construct(Vector3 start, Vector3 end, OnPathDelegate callback = null)
        {
            var p = PathPool.GetPath <XPath>();

            p.Setup(start, end, callback);
            p.endingCondition = new ABPathEndingCondition(p);
            return(p);
        }
Beispiel #8
0
        public static FloodPath Construct(GraphNode start, OnPathDelegate callback = null)
        {
            if (start == null)
            {
                throw new ArgumentNullException("start");
            }

            var p = PathPool.GetPath <FloodPath>();

            p.Setup(start, callback);
            return(p);
        }