This script has been tested on Unity 2019.4.30f1 or later (Probably works on older versions too)
- Create windows shortcut of UpdateUnityDefaultScript.bat and change it's properties to open with admin rights
- Or directly open UpdateUnityDefaultScript.bat with admin rights
- Go to C:\Program Files\Unity\Editor[Version]\Editor\Data\Resources\ScriptTemplates (This is a Unity default path) and copy the script you want to modify
- Go to .Scripts/ModifiedScripts/ and paste the script
- Open the file and modify it
81-C# Script-NewBehaviourScript.cs.txt
- Default:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
#ROOTNAMESPACEBEGIN#
public class #SCRIPTNAME# : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
#NOTRIM#
}
// Update is called once per frame
void Update()
{
#NOTRIM#
}
}
#ROOTNAMESPACEEND#- Custom:
using UnityEngine;
public class #SCRIPTNAME# : MonoBehaviour {
private void Start() {}
private void Update() {}
}The script check the registers to find unity location and copy paste the modified script to that location