Help play animations medium-difficulty

Hi I am from Argentina, I want to ask here because I do not get many answers in Spanish-speaking forums, sorry my bad English is the google translator lol
My problem is that I have some animations and with very basic script, which only serve to make walking animations, well I want to know how to make when recharge not cut the animation when I press w (animation walk and walk with the character controller ) is to say that when I press “r” run the reload animation and if I press “w” to walk but keep the animation of “r” to the end,

If you are using Mecanim, check out Blend Trees. If you are using Legacy, check out CrossFade and animation layers

Put the code below inside Update function havent tested the code but it should work

public GameObject mygameobject;


if(Input.GetKey("w")) {

 
 if(!mygameobject.animation.IsPlaying("urWalkAnimationName"))
 		{
 mygameobject.animation.Play("urWalkAnimationName");
 animation["urWalkAnimationName"].speed= 0.4f;
 } }

 if(Input.GetKey("r")) {
{
 if(!mygameobject.animation.IsPlaying("urRunAnimationName"))
 		{
 mygameobject.animation.Play("urRunAnimationName");
 animation["urRunAnimationName"].speed= 0.4f;
 } }