The Editor-friendly path is a "custom inspector". In Unity API terms, this means extending the Editor class.
Here is a working example, but the doc link above will walk you through a lot of the details and additional options:
public class TestEditor : Editor
private Test targetObject;
targetObject = (Test) this.target;
// Implement this function to make a custom inspector.
public override void OnInspectorGUI()
// Using Begin/End ChangeCheck is a good practice to avoid changing assets on disk that weren't edited.
// Use the editor auto-layout system to make your life easy
targetObject.testBool = EditorGUILayout.Toggle("Bool", targetObject.testBool);
// GUI.enabled enables or disables all controls until it is called again
GUI.enabled = targetObject.testBool;
targetObject.testString = EditorGUILayout.TextField("String", targetObject.testString);
// Re-enable further controls
GUI.enabled = true;
targetObject.testInt = EditorGUILayout.IntField("Int", targetObject.testInt);
// If anything has changed, mark the object dirty so it's saved to disk
Keep in mind that this script uses Editor-only APIs, so it must be placed in a folder named Editor. The above code will turn your inspector into the following:
That should get you rolling until you are more comfortable with Editor scripting.