# Unity / How to Hide "Editor Script" in the Inspector?

I want to hide the "editor Script" in the Unity Inspector, so it doesnt show up with all the other components (transform/other scripts etc.) It works with every other "normal" component like this:

component.hideFlags = HideFlags.HideInInspector;

but when it comes to the Editor Script- it just doesnt hide.

EDIT: My Custom Editor Script:

using UnityEngine;
using System.Collections;
using UnityEditor;

[ExecuteInEditMode]
[CustomEditor(typeof(DetailCamContScript))]

public class CamEditor : Editor
{

public override void OnInspectorGUI()
{
DrawDefaultInspector();

DetailCamContScript myScript = (DetailCamContScript)target;
if (GUILayout.Button("Set Camera Active"))
{

myScript.setCamActive();

}

}

}


EDIT: Problem solved.

the problem was: The editor-script was attached to a Gameobject. It doesnt needs to be attached.

• Pretty sure you cannot hide components in the inspector. Jul 26 '16 at 10:41
• well... you can. With: component.hideFlags = HideFlags.HideInInspector; Jul 26 '16 at 10:49
• OK Sorry I misread at first -- so basically editor scripts are not hiding -- i will try. Jul 26 '16 at 10:51
• I think I'm missing something here. The whole function of a custom editor script with an OnInspectorGUI method is to draw inspector controls. If you don't want to see inspector controls (including this "Set Camera Active" button, then what is this editor script accomplishing for you? I can't see any actions in the script you've shown that don't depend on seeing a visible control. Jul 26 '16 at 11:56