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.