把脚本加入Component菜单
using UnityEngine; [AddComponentMenu("NGUI/MyComponent")] public class MyComponent : MonoBehaviour { }
效果