Monodevelop- changing autogenerated code

I’m not sure this is the correct place to post this. If not I am sorry.

When you create a new script Unity generates a basic template of a class

using UnityEngine;
using System.Collections;

public class MyClass: MonoBehaviour 
{

	// Use this for initialization
	void Start () {
	
	}
	
	// Update is called once per frame
	void Update () {
	
	}
}

Is there a way to change this template? I have a LOT of repeated tasks atm and it would be helpful, but I haven’t managed to find anything on the subject.

Cheers

Dave

1 Like

Solved my own problem:

On windows if you go to
C:\Program Files (x86)\Unity\Editor\Data\Resources\ScriptTemplates

You cna edit a text file to change the template.

Then it would probably be best to place them all in a static class to help keep your code clean, or make extensions out of them.

Hey! Thanks! This is actually pretty neat, I’m probably just going to make it generate a blank file instead of filling in all of the crap it usually does.

I would also like to add that for Mac users this is located at:

/Applications/Unity/Unity.app/Contents/Resources/ScriptTemplates/

On first glance I couldn’t figure out where it was for Mac until I did a little bit more digging.

1 Like

Yeah, I also suggest looking at the problem you have and seeing if other solutions may be more appropriate. Copying a whole bunch of redundant code around the place sounds like a bit of a nightmare to me…