In Unity, as long as the script that inherits MonoBehavior can be hung on the gameobject, but some scripts we do not want to be bound in Editor mode, or only want some pending gameobjects to be able to bind the script.
There are two ways to add scripts in edit mode:
1: Use the mouse to drag and drop directly to the gameobject
2: Make a MenuItem yourself and then gameobject.AddCompoment<T>
#if UNITY_EDITOR UnityEditor.EditorUtility.DisplayDialog("cuowu", "bunengshiyong", "quedign"); #endif