自动生成脚本的插件[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]图文详解的详细内容。更多信息请关注PHP中文网其他相关文章!

C#和.NET通过不断的更新和优化,适应了新兴技术的需求。1)C#9.0和.NET5引入了记录类型和性能优化。2).NETCore增强了云原生和容器化支持。3)ASP.NETCore与现代Web技术集成。4)ML.NET支持机器学习和人工智能。5)异步编程和最佳实践提升了性能。

c#.netissutableforenterprise-levelapplications withemofrosoftecosystemdueToItsStrongTyping,richlibraries,androbustperraries,androbustperformance.however,itmaynotbeidealfoross-platement forment forment forment forvepentment offependment dovelopment toveloperment toveloperment whenrawspeedsportor whenrawspeedseedpolitical politionalitable,

C#在.NET中的编程过程包括以下步骤:1)编写C#代码,2)编译为中间语言(IL),3)由.NET运行时(CLR)执行。C#在.NET中的优势在于其现代化语法、强大的类型系统和与.NET框架的紧密集成,适用于从桌面应用到Web服务的各种开发场景。

C#是一种现代、面向对象的编程语言,由微软开发并作为.NET框架的一部分。1.C#支持面向对象编程(OOP),包括封装、继承和多态。2.C#中的异步编程通过async和await关键字实现,提高应用的响应性。3.使用LINQ可以简洁地处理数据集合。4.常见错误包括空引用异常和索引超出范围异常,调试技巧包括使用调试器和异常处理。5.性能优化包括使用StringBuilder和避免不必要的装箱和拆箱。

C#.NET应用的测试策略包括单元测试、集成测试和端到端测试。1.单元测试确保代码的最小单元独立工作,使用MSTest、NUnit或xUnit框架。2.集成测试验证多个单元组合的功能,常用模拟数据和外部服务。3.端到端测试模拟用户完整操作流程,通常使用Selenium进行自动化测试。

C#高级开发者面试需要掌握异步编程、LINQ、.NET框架内部工作原理等核心知识。1.异步编程通过async和await简化操作,提升应用响应性。2.LINQ以SQL风格操作数据,需注意性能。3..NET框架的CLR管理内存,垃圾回收需谨慎使用。

C#.NET面试问题和答案包括基础知识、核心概念和高级用法。1)基础知识:C#是微软开发的面向对象语言,主要用于.NET框架。2)核心概念:委托和事件允许动态绑定方法,LINQ提供强大查询功能。3)高级用法:异步编程提高响应性,表达式树用于动态代码构建。

C#.NET是构建微服务的热门选择,因为其生态系统强大且支持丰富。1)使用ASP.NETCore创建RESTfulAPI,处理订单创建和查询。2)利用gRPC实现微服务间的高效通信,定义和实现订单服务。3)通过Docker容器化微服务,简化部署和管理。


热AI工具

Undresser.AI Undress
人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover
用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool
免费脱衣服图片

Clothoff.io
AI脱衣机

AI Hentai Generator
免费生成ai无尽的。

热门文章

热工具

SecLists
SecLists是最终安全测试人员的伙伴。它是一个包含各种类型列表的集合,这些列表在安全评估过程中经常使用,都在一个地方。SecLists通过方便地提供安全测试人员可能需要的所有列表,帮助提高安全测试的效率和生产力。列表类型包括用户名、密码、URL、模糊测试有效载荷、敏感数据模式、Web shell等等。测试人员只需将此存储库拉到新的测试机上,他就可以访问到所需的每种类型的列表。

ZendStudio 13.5.1 Mac
功能强大的PHP集成开发环境

Atom编辑器mac版下载
最流行的的开源编辑器

PhpStorm Mac 版本
最新(2018.2.1 )专业的PHP集成开发工具

SublimeText3 Mac版
神级代码编辑软件(SublimeText3)