how to enable and disable scripts in unity code example
Example 1: disable script in unity
GameObject.Find("Cube").GetComponent<MoveObject>().enabled = false;
Example 2: how to turn off scrips in unity
this.enabled = false;
GameObject.Find("Cube").GetComponent<MoveObject>().enabled = false;
this.enabled = false;