public override void OnInspectorGUI() { DrawDefaultInspector(); EditorUtils myScript = (EditorUtils)this.target; if (GUILayout.Button("Add component")) { myScript.AddComponentInChildren(); } }