コード例 #1
0
ファイル: FloodPath.cs プロジェクト: xfs81150082/ET-RPG-DEMO
        public static FloodPath Construct(Vector3 start, OnPathDelegate callback = null)
        {
            var p = PathPool.GetPath <FloodPath>();

            p.Setup(start, callback);
            return(p);
        }
コード例 #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);
        }
コード例 #3
0
ファイル: RandomPath.cs プロジェクト: xfs81150082/ET-RPG-DEMO
        public static RandomPath Construct(Vector3 start, int length, OnPathDelegate callback = null)
        {
            var p = PathPool.GetPath <RandomPath>();

            p.Setup(start, length, callback);
            return(p);
        }
コード例 #4
0
        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);
        }
コード例 #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);
        }
コード例 #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);
        }
コード例 #7
0
ファイル: XPath.cs プロジェクト: yangtzehina/ET
        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);
        }
コード例 #8
0
ファイル: FloodPath.cs プロジェクト: xfs81150082/ET-RPG-DEMO
        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);
        }