UnitMovement.stopUnit C# (CSharp) Method

stopUnit() public method

public stopUnit ( ) : void
return void
    public void stopUnit()
    {
        timerDeath timer = target.GetComponent<timerDeath>();
        if (timer != null)
        {
            timer.UnitLostTarget(gameObject);
        }
        hasTarget = false;
        var animator = GetComponent<Animator>();
        if (animator != null)
        {
            animator.SetBool("walk", false);
        }
        status = Status.idle;
        // If there is any callback, call it
        if (callback != null)
            callback();
    }