首页后端开发ASP.NETUnity实现脚本插件[Script Create Dialog]图文详解

Unity实现脚本插件[Script Create Dialog]图文详解

时间2024-01-30 23:55:03发布访客分类ASP.NET浏览433
导读:收集整理的这篇文章主要介绍了Unity实现脚本插件[Script Create Dialog]图文详解,觉得挺不错的,现在分享给大家,也给大家做个参考。自动生成脚本的插件[Script Create DiaLOG],大概是名字起的和脚本生成...
收集整理的这篇文章主要介绍了Unity实现脚本插件[Script Create Dialog]图文详解,觉得挺不错的,现在分享给大家,也给大家做个参考。自动生成脚本的插件[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=MonoBehaviourusing 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 @R_777_1330@ 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 Physicsvoid 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 Mousevoid 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 playbackvoid 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 Renderingvoid 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 imageHEADER Gizmosvoid 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 Networkvoid 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.Instantiatevoid 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。

相关文章:

脚本动态生成VML_VML相关

相关视频:

BootStrap插件讲解视频教程

以上就是Unity实现脚本插件[Script Create Dialog]图文详解的详细内容,更多请关注其它相关文章!

声明:本文内容由网友自发贡献,本站不承担相应法律责任。对本内容有异议或投诉,请联系2913721942#qq.com核实处理,我们将尽快回复您,谢谢合作!

上一篇: 利用Unity脚本自定义分辨率实现相...下一篇:采用 C# 编写的学委助手详解及实...猜你在找的ASP.NET相关文章 C# 一些面试试题的实例教程2022-05-16.NET 6开发TodoList应用之请求日志组件HttpLogging介绍2022-04-16.NET 6中间件Http Logging使用介绍2022-04-16gojs一些实用的高级用法2022-04-16.NET6开发TodoList应用之实现查询排序2022-04-16.NET6开发TodoList应用之实现数据塑形2022-04-16.NET微服务架构CI/CD自动打包镜像2022-04-16Asp.Net Core 使用Monaco Editor 实现代码编辑器功能2022-04-16.NET微服务架构CI/CD自动构建Jenkins+Gitee2022-04-16.Net Core微服务网关Ocelot集成Consul2022-04-16 其他相关热搜词更多phpjavapython程序员loadpost-format-gallery

若转载请注明出处: Unity实现脚本插件[Script Create Dialog]图文详解
本文地址: https://pptw.com/jishu/593207.html
聊聊Node.js中的events事件模块 JavaScript怎样实现点击出现图片效果

游客 回复需填写必要信息