Manual     Reference     Scripting  
  
Scripting > Attributes > AddComponentMenu   
  • Menu
  • Overview
  • Runtime Classes
  • Attributes
  • Enumerations
  • Editor Classes
  • Enumerations
  • History
  • Index
  • Attributes
  • AddComponentMenu
  • ContextMenu
  • ExecuteInEditMode
  • HideInInspector
  • NonSerialized
  • RPC
  • RenderBeforeQueues
  • RequireComponent
  • Serializable
  • SerializeField

AddComponentMenu Class, inherits from Attribute  

The AddComponentMenu attribute allows you to place a script anywhere in the "Component" menu, instead of just the "Component->Scripts" menu.

You use this to organize the Component menu better, this way improving workflow when adding scripts. Important notice: You need to restart

// Javascript example
@script AddComponentMenu ("Transform/Follow Transform")
class FollowTransform : MonoBehaviour
{
}
// C# example:
[AddComponentMenu("Transform/Follow Transform")]
class FollowTransform : MonoBehaviour
{
}

Constructors
AddComponentMenu

The script will be placed in the component menu according to menuName. menuName is the path to the component