文档

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.
阅读时间3 分钟最后更新于 1 个月前

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