Unit.CancelPath C# (CSharp) Method

CancelPath() protected method

Tell the unit to cancel the movement path to the given position.
protected CancelPath ( ) : void
return void
    protected override void CancelPath()
    {
        moving = false;
        running=false;
        path = null;
    }

Usage Example

Example #1
0
        public override TaskStatus OnUpdate()
        {
            if (abortTrigger.Value)
            {
                abortTrigger.Value = false;
                unit.CancelPath();
                return(TaskStatus.Failure);
            }

            if (pathStatus == 1)
            {
                return(completedPath ? TaskStatus.Success : TaskStatus.Running);//following path
            }
            else
            {
                return(pathStatus == 0 ? TaskStatus.Running : TaskStatus.Failure);//finding path
            }
        }