public void startMoving( GameObject target, VoidMethod callback = null )
{
CollectResources collecting = GetComponent<CollectResources>();
if( collecting != null )
collecting.CancelInvoke();
this.callback = callback;
this.target = target.transform;
if ( seeker != null ) seeker.StartPath(transform.position, target.transform.position, OnPathComplete);
targetPos = target.transform.position;
targetPosAux = targetPos;
hasTarget = true;
// Cancel all animations and play walk
if (animator != null)
{
foreach(AnimatorControllerParameter param in animator.parameters)
{
animator.SetBool(param.name, false);
}
animator.SetBool("walk", true);
}
status = Status.running;
}