Is there a way to hide a dll MonoBehaviour, or disallow adding it?

Let’s say we have a dll with a couple of MonoBehaviours which are “internal”, i.e they are not supposed to be added to game objects by level designers, they are only meant to be added by other code.

Is there a way to hide such MonoBehaviours so they don’t appear in the project view under the respective dll and in the add script menu? (Or another way of achieving this)

I don't think there is a way to hide scripts from the Project View. But maybe you can use [HideFlags][1] [1]: http://docs.unity3d.com/Documentation/ScriptReference/EditorUtility.CreateGameObjectWithHideFlags.html

1 Answer

1

I know of no way to hide it from the project view, but as for the components menu, its easy. This was answered in another thread by Numberkruncher so I thought I’d repost the solution here. Hide from the components menu

[AddComponentMenu("")]
public class MySecretBehaviour : MonoBehaviour {
  // blah...
}