[Unity2d]Change Animator Controller by Script

Change Animator Controller by Script:

Such this ->

using UnityEngine;
using System.Collections;
public class ChangeController : MonoBehaviour {

Animator animator;

// Use this for initialization
void Start () {
    animator = gameObject.GetComponent<Animator>();
    animator.runtimeAnimatorController = Resources.Load("main/colors/controllercolors/ControllerRED") as RuntimeAnimatorController;
}

// Update is called once per frame
void Update () {

} }