Cant find anything in the documents on this Unless I didnt see it… lol
MonoBehaviour.enabled
should do the trick:
Usage Example:
public class YourScript : MonoBehaviour {
private void SomeOtherScript otherScript;
private void Update() {
// Enable some other script!
if (otherScript != null)
otherScript.enabled = true;
// Disable myself!
enabled = false;
}
}