Sun Guangdong 2015.7.30
is to put the program template (no matter who can change and sync git) in the Unity Project Editor directory, when the program created a C # script is the template.
"81-c# script-newbehaviourscript.cs.txt" file
Using unityengine;using system.collections.generic;namespace dajiagame.px{ //<summary>//Description: ///Author://</summary>[addcomponentmenu ("dajiagame/px/#SCRIPTNAME #")] public class # scriptname#: Monobehaviour { //initialization function private void Start () { } //per frame update private void Update () { } }}/* =============== hint: feature related ================= * [Serializefield] * [ Hideininspector] * [Requirecomponent (typeof (Rigidbody))] * [Serializefield, Range (0,5)] int[] Counts * [ Serializefield,tooltipattribute ("description")] * [ serializefield,headerattribute ("Title")] * [ Serializefield,textareaattribute (2, 5)] string message2; * [disallowmultiplecomponent] //Cannot add script repeatedly * [Addcomponentmenu ("dajiagame/px")] * [Executeineditmode] */
-----------------------------------------------------------------------//<copyright file= "ComAnimation.cs" company= "Game Development Laboratory" >//Copyright (c) Sprocket enterprises. All rights reserved.//</copyright>//<author> sunguangdong </author>////<summary>// The Widget class.//</summary>//----------------------------------------------------------------------- Using unityengine;using system.collections;using unityeditor;using system.io;namespace DajiaGame.Px{//<summary& Gt Copy of the custom C # script template. Installation path from Project Editor to Unity///Sunguangdong//</summary> public class Copycsharpscripttemplates:monobehavio ur {[initializeonload] public class Startup {//D:/program files/unity5/editor/unity . exe//D:\Program files\unity5\editor\data\resources\scripttemplates static Startup () { String stroripath = Path.Combine (applicatiOn.datapath, "editor/81-c# script-newbehaviourscript.cs.txt"); String strdespath = Path.Combine (Path.getdirectoryname (Editorapplication.applicationpath), "Data/Resour ces/scripttemplates/81-c# script-newbehaviourscript.cs.txt "); File.Copy (Stroripath, Strdespath, true); } } }}
Depending on the use of Git or svn above two files will be synchronized. Then each time the member restarts the Unity editor will trigger a copy of the template file.
??
Synchronize custom C # file templates for Unity team programs