Anyway to keep the animation state after calling rebind()?

I am trying to detach a child object while changing to another animation state, here is my code

myAnimator.SetBool("ToRunAnim", true);
childObject.transform.parent = null;
myAnimator.Rebind();

Of course, by doing that, what happen is the animator will reset back to the default animation state, and all animator parameter also get reset too. However, it is very undesirable since I loss my whole animation state in order to just detach a child from the animation. Is there any way to save the whole animator state or better way to detach a child from the animation without loss the whole animation state? The only way I can think of so far is actually hide the child object and spawn another object with the same transform which simulate the child, but in some situation, this approach is not possible, is there any better way to tackle this problem?

You can store the anim info before hand and then use the Play method at that time to set it back.

	float time = anim.GetCurrentAnimatorStateInfo(0).normalizedTime;
	int nameHash = anim.GetCurrentAnimatorStateInfo(0).nameHash;

	anim.avatar = newCharacter.GetComponent<Animator> ().avatar;
	Destroy (newCharacter.gameObject);

	yield return new WaitForEndOfFrame();
	controller.GetComponent<Animator>().Rebind ();

	anim.Play (nameHash, 0, time);

@zrrz your code lost transition. ex: Rebind after CrossFade immediately