play animation through script unity

C#
animator.Play("StateName");
Source

Also in C#: