Esempio n. 1
0
 public PathRequest(Vector3 _start, Vector3 _end, bool ignoreUnwalkableStartAndEnd, NavAgent2D agent)
 {
     this.pathStart = _start;
     this.pathEnd   = _end;
     this.ignoreUnwalkableStartAndEnd = ignoreUnwalkableStartAndEnd;
     this.agent = agent;
 }
Esempio n. 2
0
 public MoveHelper(UnitBase unit)
 {
     this.unit  = unit;
     this.agent = this.unit.GetComponent <NavAgent2D>();
 }
    /// <summary>
    /// Request a new path.
    /// Once an attempt to plot a path has been made, successful or not,
    /// the callback Action is invoked.
    /// </summary>
    public static void RequestPath(Vector3 pathStart, Vector3 pathEnd, bool ignoreUnwalkableStartAndEnd, NavAgent2D agent)
    {
        PathRequest newRequest = new PathRequest(pathStart, pathEnd, ignoreUnwalkableStartAndEnd, agent);

        instance.pathRequestQueue.Enqueue(newRequest);
        instance.TryProcessNext();
    }