最近写代码又犯懒了...
感觉每次新建脚本都要写一堆简单重复的东西好无聊,所以搜索了一下有没有自动生成脚本的插件。结果还真被我发现了,官方在N久之前就制作了自动生成脚本的插件[Script Create Dialog],大概是名字起的和脚本生成器相差太多,现在的开发工具又太强大,所以被埋没了。所支持的Unity版本 3.4.2及以上,远古时期遗留的资源。试用了一下,感觉要是刚学Unity脚本的时候有这个插件,能省下很多读API的时间。

插件效果

使用方式

1.下载我修改后的插件
链接:https://pan.baidu.com/s/1oa8r... 密码:6zln

2.下载官方插件并修复脚本错误
官方下载地址:https://assetstore.unity.com/...

如果导入插件后出现以下错误:

Assets/CreateScriptDialog/Editor/NewScriptWindow.cs(454,47): error CS0117: UnityEditorInternal.InternalEditorUtility' does not contain a definition for AddScriptComponentUnchecked'

把错误部分代码改为:

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.右键使用
Assets窗口下右键>Create>Script...打开窗口使用。

4.可以自定义新的脚本模板
使用说明在ReadMe.html中可以看到。
方法模板在MonoBehaviour.functions.txt中可以看到。可以根据规则添加自定义模板。

BASECLASS=MonoBehaviour
using UnityEngine;
using System.Collections;
using System.Collections.Generic;public class $ClassName : MonoBehaviour {$Functions
}
void Awake() Awake is called when the script instance is being loaded.
DEFAULT void Start() Start is called just before any of the Update methods is called the first time.
DEFAULT void Update() Update is called every frame, if the MonoBehaviour is enabled.
void LateUpdate() LateUpdate is called every frame, if the Behaviour is enabled.
void FixedUpdate() This function is called every fixed framerate frame, if the MonoBehaviour is enabled.
void OnGUI() OnGUI is called for rendering and handling GUI events.
void OnEnable() This function is called when the object becomes enabled and active.
void OnDisable() This function is called when the behaviour becomes disabled () or inactive.
void OnDestroy() This function is called when the MonoBehaviour will be destroyed.
void Reset() Reset to default values.
HEADER Physics
void OnTriggerEnter(Collider other) OnTriggerEnter is called when the Collider other enters the trigger.
void OnTriggerExit(Collider other) OnTriggerExit is called when the Collider other has stopped touching the trigger.
void OnTriggerStay(Collider other) OnTriggerStay is called once per frame for every Collider other that is touching the trigger.
void OnCollisionEnter(Collision collision) OnCollisionEnter is called when this collider/rigidbody has begun touching another rigidbody/collider.
void OnCollisionExit(Collision collisionInfo) OnCollisionExit is called when this collider/rigidbody has stopped touching another rigidbody/collider.
void OnCollisionStay(Collision collisionInfo) OnCollisionStay is called once per frame for every collider/rigidbody that is touching rigidbody/collider.
void OnControllerColliderHit(ControllerColliderHit hit) OnControllerColliderHit is called when the controller hits a collider while performing a Move.
void OnJointBreak(float breakForce) Called when a joint attached to the same game object broke.
void OnParticleCollision(GameObject other) OnParticleCollision is called when a particle hits a collider.
HEADER Mouse
void OnMouseEnter() OnMouseEnter is called when the mouse entered the GUIElement or Collider.
void OnMouseOver() OnMouseOver is called every frame while the mouse is over the GUIElement or Collider.
void OnMouseExit() OnMouseExit is called when the mouse is not any longer over the GUIElement or Collider.
void OnMouseDown() OnMouseDown is called when the user has pressed the mouse button while over the GUIElement or Collider.
void OnMouseUp() OnMouseUp is called when the user has released the mouse button.
void OnMouseUpAsButton() OnMouseUpAsButton is only called when the mouse is released over the same GUIElement or Collider as it was pressed.
void OnMouseDrag() OnMouseDrag is called when the user has clicked on a GUIElement or Collider and is still holding down the mouse.
HEADER Playback
void OnLevelWasLoaded(int level) This function is called after a new level was loaded.
void OnApplicationFocus(bool focus) Sent to all game objects when the player gets or looses focus.
void OnApplicationPause(bool pause) Sent to all game objects when the player pauses.
void OnApplicationQuit() Sent to all game objects before the application is quit.
HEADER Rendering
void OnBecameVisible() OnBecameVisible is called when the renderer became visible by any camera.
void OnBecameInvisible() OnBecameInvisible is called when the renderer is no longer visible by any camera.
void OnPreCull() OnPreCull is called before a camera culls the scene.
void OnPreRender() OnPreRender is called before a camera starts rendering the scene.
void OnPostRender() OnPostRender is called after a camera finished rendering the scene.
void OnRenderObject() OnRenderObject is called after camera has rendered the scene.
void OnWillRenderObject() OnWillRenderObject is called once for each camera if the object is visible.
void OnRenderImage(RenderTexture source, RenderTexture destination) OnRenderImage is called after all rendering is complete to render image
HEADER Gizmos
void OnDrawGizmosSelected() Implement this OnDrawGizmosSelected if you want to draw gizmos only if the object is selected.
void OnDrawGizmos() Implement this OnDrawGizmos if you want to draw gizmos that are also pickable and always drawn.
HEADER Network
void OnPlayerConnected(NetworkPlayer player) Called on the server whenever a new player has successfully connected.
void OnServerInitialized() Called on the server whenever a Network.InitializeServer was invoked and has completed.
void OnConnectedToServer() Called on the client when you have successfully connected to a server.
void OnPlayerDisconnected(NetworkPlayer player) Called on the server whenever a player disconnected from the server.
void OnDisconnectedFromServer(NetworkDisconnection info) Called on the client when the connection was lost or you disconnected from the server.
void OnFailedToConnect(NetworkConnectionError error) Called on the client when a connection attempt fails for some reason.
void OnFailedToConnectToMasterServer(NetworkConnectionError info) Called on clients or servers when there is a problem connecting to the MasterServer.
void OnMasterServerEvent(MasterServerEvent msEvent) Called on clients or servers when reporting events from the MasterServer.
void OnNetworkInstantiate(NetworkMessageInfo info) Called on objects which have been network instantiated with Network.Instantiate
void OnSerializeNetworkView(BitStream stream, NetworkMessageInfo info) Used to customize synchronization of variables in a script watched by a network view.

自定义功能

修改后的插件:链接:https://pan.baidu.com/s/1oa8r... 密码:6zln
修改或增加了以下功能:
1.修复了"UnityEditorInternal.InternalEditorUtility"的错误。
2.新增模板MyMono(拷贝C#的MonoBehaviour模板)。
3.默认选择自定义模板MyMono。
4.增加了当前创建日期。
5.可以删除注释(以前删除注释还会有//)。
6.增加了对访问修饰符的支持。
7.重新排序API。
8.打包版本Unity5.3.4。

Unity脚本生成插件:Script Create Dialog相关推荐

  1. unity 字体 素材_unity游戏3D艺术字形TTF字体编辑生成插件Glyph 3D v1.3.0.1

    unity游戏3D艺术字形TTF字体编辑生成插件Glyph 3D v1.3.0.1,生成的字母将在unity中作为网格提供,您可以自由旋转.缩放和应用材质. 特征: 导入几乎任何真字体,并使用它来生成 ...

  2. ps原始数据清理脚本_创建地形模型一步到位!PS最新2019全球首款3D地形生成插件送给你...

    建过地形的设计同仁们都清楚,要建出一个精确的地形模型基本要靠CAD,SU,GIS,Rhino这些软件协同操作. 一般来说,有现成的CAD原始数据后,整理导入GIS中制作各种分析图,也要花半天时间.如果 ...

  3. AutoCAD利用SCRIPT脚本生成齿轮

    问题描述 根据给出的模数m 齿数z 厚度b 使用C语言生成AutoCAD Script脚本绘制出齿轮图形 注意事项 本脚本中除参数需要用实际数值代替掉以外格式不允许发生任何改动(空格也不行),否则大概 ...

  4. Unity的NGUI插件篇——入场效果

    Unity的NGUI插件篇--入场效果 入场效果 入场效果需要借助于NGUI提供的TweenPosition类来完成,为了说明此类的使用方法,本节将使会讲解两个示例.本文选自  大学霸 <NGU ...

  5. python利器怎么编程-python等自动化脚本编程利器 Script.NET

    手册更新日期:2009-08-04 介绍: Script.NET是蓝蚂蚁工作室经过数年时间不断完善,开发出的一套用于Tcl.Python.Perl.Ruby.Lua等脚本语言的集成开发环境. Tcl( ...

  6. ssms脚本生成缓慢_使用SSMS和Azure Data Studio生成数据脚本

    ssms脚本生成缓慢 This article explores different ways to generate data scripts using Azure Data Studio and ...

  7. 【Unity3D】Unity 脚本 ① ( 创建 C# 脚本 | Visual Studio 2019 中打开 C# 脚本 | 编译 C# 脚本 | 挂载 C# 脚本到游戏物体 | 运行脚本 )

    文章目录 一.创建 Unity 脚本 二.Visual Studio 2019 中打开 C# 脚本 三.编译 C# 脚本 四.挂载 C# 脚本到游戏物体 GameObject 1.添加组件方式 2.直 ...

  8. Unity之生成扫描二维码

    Unity之生成扫描二维码 Unity之生成扫描二维码 前言 开篇 Unity版本及使用插件 正题 前期准备 首先生成二维码 然后需要扫描二维码 该使用了 挂载脚本绑定按钮和输入框 运行内容 生成二维 ...

  9. mac unity一键化打ipa_2 编写sh脚本和unity脚本

    参考博客:https://www.xuanyusong.com/archives/2734 主要就是查API,编写 jenkins调用sh脚本->mac的sh脚本调用unity的C#脚本 关于插 ...

最新文章

  1. RGB Color Codes Chart
  2. C语言判断数组中是否存在该数
  3. map赋值给另一个map_Java学习(十六): Lambda操作Map
  4. java xsl生成word文件_导出生成xsl文件
  5. flink sql是否支持emit策略
  6. 探讨.NET Core的未来
  7. [Leedcode][JAVA][第124题][二叉树中的最大路径和][递归][二叉树]
  8. imx6 android快速启动,android启动不起来(已解决)
  9. mysql s授权所有用户_批量获取mysql用户权限的方法
  10. linux java jdk配置_Linux环境下安装JDK并配置环境变量
  11. java locale中文_locale错误导致Java中文乱码错误的总结
  12. python 写入excel 日期_详解:Python实现大数据收集至excel的思路大牛分享(建议收藏)...
  13. Windows-QT安装后,又要安装mingw32/64怎么办?
  14. LARGE SCALE IMAGE COMPLETION VIA CO-MODULATED
  15. 计算机进入vga模式,VGA模式是什么,怎么进入VGA模式
  16. 微软dowhy 项目 原理_Microsoft的DoWhy是因果推理的出色框架
  17. JavaWeb - 小米商城网 - 项目启动
  18. 《红楼梦》之金陵十二钗vs韩国明星
  19. Java程序获取和修改.wav音频文件的内部结构
  20. /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found问题解决方法

热门文章

  1. mapreduce作业reduce被大量kill掉
  2. 高考估分查分选志愿一键搞定_支付宝又操办了件人生大事
  3. 《深入浅出iPhone/iPad开发(第2版)》——在Xcode中建立你的界面
  4. “互联网+”的时代,易佳互联也随着时代步伐前进着
  5. CPU值满resmgr:cpu quantum造成的Oracle等待事件解决办法
  6. 腾讯布局移动应用商店 总下载量累计达40亿次
  7. Use MVS Dsbame convensions. windows下ftp.exe客户端上传错误
  8. Netty 粘包 拆包 编码 解码 序列化 介绍
  9. 03-Java的基础语法
  10. [转]语音识别中区分性训练(Discriminative Training)和最大似然估计(ML)的区别...