void Update () {
if(Input .GetKeyDown (KeyCode .W ))
{
StartCoroutine ("Test");
}
}
IEnumerator Test()
{
while (Cube1 .position .x<)
{
Cube1 .Translate (transform .right **Time .deltaTime );
yield return null;
}
yield return new WaitForSeconds();
while (Cube2 .position .x<)
{
Cube2 .Translate (transform .right **Time .deltaTime );
yield return null;
}
}