banner1.jpg tips_and_tricks.jpg unity_hot_keys.jpg interes_jocuri_istoric_tendinte.jpg acme_planetary_defense.jpg spot_light_main.jpg Blender.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:


using UnityEngine; using System.Collections; 
public class #SCRIPTNAME# : MonoBehaviour 
    #region Public Members 
    #region Private Members 

    #region Properties 

    void Start () { } 

    void Update () { } 



Location: Planet Earth
Wednesday, February 21, 2018 - 18:52
Propecia Proscar Finasteride Viagra Authentique [url=]buy cialis[/url] Cialis Generico Sito Affidabile Acheter Cytotec Pour Avorter
Add comment:

Match the word in captcha image