Unit.SetNewPath C# (CSharp) Method

SetNewPath() protected method

Tells the unit to move to the given position, by generating and following a route to the desired position.
protected SetNewPath ( Vector3 target, bool isRunning ) : void
target Vector3 The position we want the unit to move to.
isRunning bool
return void
    protected override void SetNewPath(Vector3 target, bool isRunning)
    {
        // We're starting movement, so start the walking animation
        if (isRunning){
            running = true;
        } else {
            moving = true;
        }

        targetPosition = target;
        seeker.StartPath (transform.position, targetPosition, OnPathComplete);
    }