disable script component through script code example
Example 1: enabling and disabling components unity
//Enable or disable a component in Unity example:
component.enabled = false;
Example 2: how to turn off scrips in unity
this.enabled = false;