The plug-in that automatically generates scripts [Script Create Dialog] is probably named because it is too different from the script generator, and the current development tools are too powerful, so it was buried. Supported Unity version 3.4.2 and above, resources left over from ancient times. After trying it out, I feel that if I had this plug-in when I first learned Unity scripting, it would have saved a lot of time in reading the API.
I’ve been too lazy to write code recently...
I feel like it’s boring to write a bunch of simple and repetitive things every time I create a new script, so I searched for a plug-in that automatically generates scripts.
1. Download my modified plug-in
Link: https://pan.baidu.com/s/1oa8r... Password: 6zln
2. Download the official plug-in and fix the script error
Official download address: https:/ /assetstore.unity.com/...
If the following error occurs after importing the plug-in:
Assets/CreateScriptDialog/Editor/NewScriptWindow.cs(454,47): error CS0117: UnityEditorInternal.InternalEditorUtility' does not contain a definition for
AddScriptComponentUnchecked'
Change the error code to:
if (CanAddComponent()) { // Need to use reflection to access this now (it is internal) MethodInfo addScriptMethod = typeof(InternalEditorUtility).GetMethod( "AddScriptComponentUncheckedUndoable", BindingFlags.Static | BindingFlags.NonPublic); addScriptMethod.Invoke(null, new Object[] {m_GameObjectToAddTo, AssetDatabase.LoadAssetAtPath(TargetPath(), typeof (MonoScript)) as MonoScript}); }
3. Right-click and use
Assets Right-click on the window>Create>Script... to open the window for use.
4. You can customize the new script template
Instructions for use can be seen in ReadMe.html.
The method template can be seen in MonoBehaviour.functions.txt. Custom templates can be added based on rules.
BASECLASS=MonoBehaviour using UnityEngine; using System.Collections; using System.Collections.Generic; public class $ClassName : MonoBehaviour { $Functions }
Modified plug-in: Link: https://pan.baidu.com/s/1oa8r... Password: 6zln
The following functions have been modified or added:
1. Fixed the error of "UnityEditorInternal.InternalEditorUtility".
2. Add a new template MyMono (copy the C# MonoBehaviour template).
3. The custom template MyMono is selected by default.
4. Added current creation date.
5. You can delete comments (before deleting comments, there will still be //).
6. Added support for access modifiers.
7. Reorder API.
8. Packaged version Unity5.3.4.
Related articles:
Script dynamically generates VML_VML related
Related videos:
BootStrap plug-in explanation video tutorial
The above is the detailed content of Unity implements script plug-in [Script Create Dialog] with detailed graphic and text explanation. For more information, please follow other related articles on the PHP Chinese website!