I am looking of a way to disable the possibility of attaching my MonoBehaviour component in the Unity Editor. So I don't want my component to appear anywhere visible by the user.
The reason is that I attach this component manually from a script with AddComponent<T>(). So this is more a convenience question, I just don't want the user to think he has to add my component manually in order for my plugin to work. (if he does anyway, that doesn't cause any trouble. Again, this is just convenience)
Precisions
I am writing a library (dll plugin), so I cannot use the trick of naming the file differently from my component, but that is exactly the effect I'm looking for.
I also tried to simply put my class as internal because that's really what it is, the assembly should be the only one to have access to this component. However, I'm afraid inheriting from MonoBehaviour even with an internal class makes the component available in the editor...
The HideInInspector attribute doesn't seem to work on a class.
I am calling AddComponent from a static method with RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.AfterSceneLoad) so I won't have any other behaviour to rely on.
Quite a challenge, if we find an answer, that would be luxury. Any idea? Thank you very much

[RequireComponent( typeof(YourScript) )]instead of AddComponent? - Fredrik SchönRuntimeInitializeOnLoadMethodso I don't have any other MonoBehaviour to hold on - MadStark