예제 #1
0
    public void MoveAlongPoints(Vector3[] pointData, bool run)
    {
        Paths path = GetComponent <Paths>();

        if (path)
        {
            path.BuildNavPath(pointData);

            if (run)
            {
                SetPath(path, PathSpeed.Run);
            }
            else
            {
                SetPath(path, PathSpeed.Walk);
            }
        }
        else
        {
            Debug.LogWarning(this.name + " cannot pathfind without a Paths component");
        }
    }