Exemplo n.º 1
0
        /// <summary>\copydoc Pathfinding::IAstarAI::GetRemainingPath</summary>
        public void GetRemainingPath(List <Vector3> buffer, out bool stale)
        {
            buffer.Clear();
            buffer.Add(position);
            if (!interpolator.valid)
            {
                stale = true;
                return;
            }

            stale = false;
            interpolator.GetRemainingPath(buffer);
        }
Exemplo n.º 2
0
        /// <summary>\copydoc Pathfinding::IAstarAI::GetRemainingPath</summary>
        public void GetRemainingPath(List <Vector3> buffer, out bool stale)
        {
            buffer.Clear();
            if (!interpolator.valid)
            {
                buffer.Add(position);
                stale = true;
                return;
            }

            stale = false;
            interpolator.GetRemainingPath(buffer);
            // The agent is almost always at interpolation.position (which is buffer[0])
            // but sometimes - in particular when interpolating between two paths - the agent might at a slightly different position.
            // So we replace the first point with the actual position of the agent.
            buffer[0] = position;
        }