hello,
I created an animation with flashing button (color change).

gameObject.animation.Play("Button");

However, when I press play, I can see the color changes in the image, but not in a scene.
What do I do wrong?

I see you have an “Animation” component on the button. That is the Legacy component, use the new Animator component and mecanim system and you shouldn’t have any problems.