真实的国产乱ⅩXXX66竹夫人,五月香六月婷婷激情综合,亚洲日本VA一区二区三区,亚洲精品一区二区三区麻豆

成都創(chuàng)新互聯(lián)網(wǎng)站制作重慶分公司

Unity如何實(shí)現(xiàn)腳本插件[ScriptCreateDialog]

這篇文章主要介紹了Unity如何實(shí)現(xiàn)腳本插件[Script Create Dialog],具有一定借鑒價(jià)值,需要的朋友可以參考下。希望大家閱讀完這篇文章后大有收獲。下面讓小編帶著大家一起了解一下。

我們提供的服務(wù)有:成都網(wǎng)站建設(shè)、成都網(wǎng)站制作、微信公眾號(hào)開發(fā)、網(wǎng)站優(yōu)化、網(wǎng)站認(rèn)證、鄉(xiāng)寧ssl等。為1000多家企事業(yè)單位解決了網(wǎng)站和推廣的問題。提供周到的售前咨詢和貼心的售后服務(wù),是有科學(xué)管理、有技術(shù)的鄉(xiāng)寧網(wǎng)站制作公司

 自動(dòng)生成腳本的插件[Script Create Dialog],大概是名字起的和腳本生成器相差太多,現(xiàn)在的開發(fā)工具又太強(qiáng)大,所以被埋沒了。所支持的Unity版本 3.4.2及以上,遠(yuǎn)古時(shí)期遺留的資源。試用了一下,感覺要是剛學(xué)Unity腳本的時(shí)候有這個(gè)插件,能省下很多讀API的時(shí)間。

最近寫代碼又犯懶了...
感覺每次新建腳本都要寫一堆簡(jiǎn)單重復(fù)的東西好無聊,所以搜索了一下有沒有自動(dòng)生成腳本的插件。

插件效果

Unity如何實(shí)現(xiàn)腳本插件[Script Create Dialog]

使用方式

1.下載我修改后的插件
鏈接:https://pan.baidu.com/s/1oa8r... 密碼:6zln

2.下載官方插件并修復(fù)腳本錯(cuò)誤
官方下載地址:https://assetstore.unity.com/...

如果導(dǎo)入插件后出現(xiàn)以下錯(cuò)誤:
Unity如何實(shí)現(xiàn)腳本插件[Script Create Dialog]Assets/CreateScriptDialog/Editor/NewScriptWindow.cs(454,47): error CS0117: UnityEditorInternal.InternalEditorUtility' does not contain a definition for AddScriptComponentUnchecked'

把錯(cuò)誤部分代碼改為:

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...打開窗口使用。
Unity如何實(shí)現(xiàn)腳本插件[Script Create Dialog]

Unity如何實(shí)現(xiàn)腳本插件[Script Create Dialog]

4.可以自定義新的腳本模板
使用說明在ReadMe.html中可以看到。
方法模板在MonoBehaviour.functions.txt中可以看到。可以根據(jù)規(guī)則添加自定義模板。

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.修復(fù)了"UnityEditorInternal.InternalEditorUtility"的錯(cuò)誤。
2.新增模板MyMono(拷貝C#的MonoBehaviour模板)。
3.默認(rèn)選擇自定義模板MyMono。
4.增加了當(dāng)前創(chuàng)建日期。
5.可以刪除注釋(以前刪除注釋還會(huì)有//)。
6.增加了對(duì)訪問修飾符的支持。
7.重新排序API。
8.打包版本Unity5.3.4。

Unity如何實(shí)現(xiàn)腳本插件[Script Create Dialog]

感謝你能夠認(rèn)真閱讀完這篇文章,希望小編分享Unity如何實(shí)現(xiàn)腳本插件[Script Create Dialog]內(nèi)容對(duì)大家有幫助,同時(shí)也希望大家多多支持創(chuàng)新互聯(lián),關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道,遇到問題就找創(chuàng)新互聯(lián),詳細(xì)的解決方法等著你來學(xué)習(xí)!


分享名稱:Unity如何實(shí)現(xiàn)腳本插件[ScriptCreateDialog]
URL地址:http://weahome.cn/article/iehoih.html

其他資訊

在線咨詢

微信咨詢

電話咨詢

028-86922220(工作日)

18980820575(7×24)

提交需求

返回頂部