Creating a new code template

Hi, I have done a ton of searching and still can’t find an answer to this.
I have created a fairly complex framework that I want everyone to easily customize and use.
In order to write scripts using this framework, one needs to do all sorts of small stuff, including using different namespaces and overriding functions. I saw that it was possible to change the default code template, so When you hit ‘Project>Create>New Language Script’ it has all of your regions and such that you normally use. I was wondering if it were possible to create an entirely new code template that could be used like ‘Project>Create>New Language Automation’ for instance.

In case you are wondering why on earth I would want to do this, right now users can create their own cellular automations by inheriting from a class, but they also have to override all of the methods of that class. I also wanted to remove the ‘using UnityEngine’ part, since it’s multithreaded and I didn’t want users to accidentally use Unity stuff in there.

Is it possible to do something like this? Thanks in advance!

You can extend the Unity editor with a script that adds an option to almost any menu. That option could create the new file with the default code you want. I don’t have a lot of experience with editor scripts, but I’m sure you can do this, lots of plugins create new script files with custom code inside after choosing an option.

I did a bit of searching through the forums, and came across this article. It should help you do what you want:

Unity quick tip: Change the template for new classes.