About HideFlags.HideInInspector

I am currently working on a character controller using the Strategy pattern i.e. every behaviour of the said controller are abstracted into sub-Mono classes.

Example :
public class MyController : MonoBehaviour {

    public AbstractMover mover;
    public AbstractOrienter orienter;
    public AbstractJumper jumper;

    private void Update () {
        mover.Move ();
        orienter.LookAt ();
        jumper.Jump ();

Everything works fine, but the inspector window get cluttered really quick with all those MonoBehaviours attached and it can get real messy real quick for a designer to setup the controller accordingly.

Hopefully, I already made my custom editor for the parent class, which handles every possible scenario in a single, clean, custom editor.

Even though the custom editor works fine, I want to make sure the designer use the parent’s custom editor instead of tweaking values directly in the AbstractMover or AbstractOrienter component.

I am aware of the hideFlags property of a gameObject, but I want to set it to HideFlags.HideInInspector even at editor time.

Is there a way to do so? Because all I got right now is I set it inside the OnEnable function, whcich hides them during play mode, but show them in Editor mode…

Is there a way to set the default hideflags on a MonoBehaviour?

Yes for instance you could just markup your behavior with [ExecuteInEditMode] then OnEnable/Disable/Awake, etc will get called at edit-time.

public class MyController : MonoBehaviour
   void OnEnable()
      hideFlags = HideFlags.HideInInspector;

I suggest that you provide a way to un-hide everything just to see everything’s OK (cause you don’t want to leak something)