storytelling.jpg flowplay.jpg horde3d.jpg banner1.jpg gimp.jpg unity_robotlab.jpg acme_planetary_defense.jpg
Tips&Tricks: Change script template for C#, UnityScript and Boo
Tips&Tricks: Change script template for C#, UnityScript and Boo
By: Scarpelius on Jul, 28 2013
Bookmark this

When creating a new script in Unity, the editor will open a template file, a skeleton class for you to build on it.

If you are like me and don't like the code notation where the function accolade is placed on the same line with the function name, then you are forced at the beginning of each new file to move the accolades to the right places and also to delete the comments for Start and Update functions. This is a bit of annoyance, which can be solved in Visual Studio by pressing CTRL+K+D to format the code. Not much energy wasted here, just the annoyance of this operation.

But then again, why not get rid of this format and even more, improve the format of the file, based on your habbits? Well guess what it is possible by changing the template file for C# scripts. Under Windows with the default install location of Unity, this file is located in C:Program Files (x86)Unity4EditorDataResourcesScriptTemplates81-C# Script-NewBehaviourScript.cs.txt.

Bellow is the customization of the template file for C# I use:

123456789101112131415161718192021222324
using UnityEngine;
using System.Collections;

public class #SCRIPTNAME# : MonoBehaviour 
{
	#region Public Members
	#endregion

	#region Private Members
	#endregion

	#region Properties
	#endregion

	void Start () 
	{
	
	}
	
	void Update () 
	{
	
	}
}

 

Discussions:
KelUrifyPar
Location: Planet Earth
Posts:
Sunday, June 18, 2017 - 13:45
Keflex For Staff Infection [url=http://where-to-order-viagra.via100mg.com]Where To Order Viagra[/url] Farmaco Equivalente Priligy Cialis Dosificacion [url=http://buy-cheap-generic-kamagra.kamagpills.com]Buy Cheap Generic Kamagra[/url] Viagra Dove Si Acquista Comprar Cialis Espana Online [url=http://inderal.ccrpdc.com/inderal-order.php]Inderal Order[/url] Keflex Staphylococcus Furuncle Levitra Tradizionale [url=http://dapoxetine-priligy-price.priliorder.com]Dapoxetine Priligy Price[/url] Priligy Eyaculacion Precoz Order Levothyroxine 125mcg Online [url=http://viacheap.com]viagra[/url] Suhagra India Live Time Buying Generic On Line Zentel Ups Overnight Shipping [url=http://generic-levitra.buylevi.com]Generic Levitra[/url] Seismic Loop Keflex Il Cialis E Mutuabile [url=http://cial40mg.com/order-cialis.php]Order Cialis[/url] Indications Amoxicillin
Add comment:


Match the word in captcha image