Documentation

Unity Engine

Unity Engine

AddComponentMenu

The AddComponentMenu attribute allows you to place a script anywhere in the "Component" menu, instead of just the "Component-\>Scripts" menu.
Read time 3 minutesLast updated a month ago

Definition

public sealed class AddComponentMenu : Attribute

Remarks

You can use this to organize the Component menu better and improve the workflow of adding scripts.

Examples

using UnityEngine;[AddComponentMenu("Transform/Follow Transform")]public class FollowTransform : MonoBehaviour{}

Constructors

Constructor

Description

AddComponentMenu(System.String)Add an item in the Component menu.
AddComponentMenu(System.String,System.Int32)Add an item in the Component menu.

Properties

Property

Description

componentOrderThe order of the component in the component menu (lower values appear higher in the menu).

Inheritance

Inherited Members