{"id":14961013,"url":"https://github.com/mygamedevtools/script-template","last_synced_at":"2025-10-19T04:23:55.917Z","repository":{"id":179591023,"uuid":"536352233","full_name":"mygamedevtools/script-template","owner":"mygamedevtools","description":"A simple tool to create and manage your script templates.","archived":false,"fork":false,"pushed_at":"2024-01-04T19:04:34.000Z","size":424,"stargazers_count":11,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-31T03:54:45.290Z","etag":null,"topics":["editor","editor-plugin","package","script","scripts","template","templates","tool","unity","unity-editor","unity-package","unity3d","unity3d-plugin","unityeditor","upm","upm-package"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mygamedevtools.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2022-09-14T00:14:59.000Z","updated_at":"2024-04-25T03:40:28.000Z","dependencies_parsed_at":"2024-01-04T20:24:23.034Z","dependency_job_id":"f6d0f2e0-54bf-4e16-aa5e-1c871086ef42","html_url":"https://github.com/mygamedevtools/script-template","commit_stats":null,"previous_names":["mygamedevtools/script-template"],"tags_count":23,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mygamedevtools%2Fscript-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mygamedevtools%2Fscript-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mygamedevtools%2Fscript-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mygamedevtools%2Fscript-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mygamedevtools","download_url":"https://codeload.github.com/mygamedevtools/script-template/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238030288,"owners_count":19404859,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["editor","editor-plugin","package","script","scripts","template","templates","tool","unity","unity-editor","unity-package","unity3d","unity3d-plugin","unityeditor","upm","upm-package"],"created_at":"2024-09-24T13:23:38.236Z","updated_at":"2025-10-19T04:23:50.860Z","avatar_url":"https://github.com/mygamedevtools.png","language":"C#","readme":"\u003ch1 align=center\u003e\nScript Template\n\u003c/h1\u003e\n\n\u003cp align=center\u003e\n  \u003ca href=\"LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/github/license/mygamedevtools/script-template?color=5189bd\" /\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/mygamedevtools/script-template/releases/latest\"\u003e\u003cimg src=\"https://img.shields.io/github/v/release/mygamedevtools/script-template?color=5189bd\u0026sort=semver\" /\u003e\u003c/a\u003e\n  \u003ca href=\"https://openupm.com/packages/com.mygamedevtools.script-template/\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/com.mygamedevtools.script-template?color=5189bd\u0026label=openupm\u0026registry_uri=https://package.openupm.com\" /\u003e\u003c/a\u003e\n  \u003ca href=\"https://openupm.com/packages/com.mygamedevtools.script-template/\"\u003e\u003cimg src=\"https://img.shields.io/badge/dynamic/json?color=5189bd\u0026label=downloads\u0026query=%24.downloads\u0026suffix=%2Fmonth\u0026url=https%3A%2F%2Fpackage.openupm.com%2Fdownloads%2Fpoint%2Flast-month%2Fcom.mygamedevtools.script-template\" /\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=center\u003e  \n  \u003ca href=\"https://github.com/mygamedevtools/script-template/actions/workflows/release.yml\"\u003e\u003cimg src=\"https://github.com/mygamedevtools/script-template/actions/workflows/release.yml/badge.svg\" /\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/semantic-release/semantic-release\"\u003e\u003cimg src=\"https://img.shields.io/badge/semantic--release-angular-e10079?logo=semantic-release\" /\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=center\u003e\u003ci\u003e\nA simple tool to add and manage more script templates.\n\u003c/i\u003e\u003c/p\u003e\n\nWhat's this about?\n---\n\nThis tool adds custom Script Templates to Unity that will serve as alternatives for the default \\\"C#Script\\\" that I personally always modify before writing my scripts. In essence, it allows customization of the script templates with dynamic data such as signature and namespace settings. Additionally, it adds templates for other types of scripts rather than just Mono Behaviours. You can customize the templates after they have been copied as well.\n\nInstallation\n---\n\n### OpenUPM\n\nThis package is available on the [OpenUPM](https://openupm.com/packages/com.mygamedevtools.script-template) registry. Add the package via the [openupm-cli](https://github.com/openupm/openupm-cli):\n\n```\nopenupm add com.mygamedevtools.script-template\n```\n\n### [Installing from Git](https://docs.unity3d.com/Manual/upm-ui-giturl.html) _(requires [Git](https://git-scm.com/) installed and added to the PATH)_\n\n1. Open `Edit/Project Settings/Package Manager`.\n2. Click \u003ckbd\u003e+\u003c/kbd\u003e.\n3. Select `Add package from git URL...`.\n4. Paste `com.mygamedevtools.script-template` into the name.\n5. Click `Add`.\n\nUsage\n---\n\n![First Image](https://user-images.githubusercontent.com/9505905/111533338-6dd37580-8745-11eb-968d-37102b4b5e5c.png)\n\nFrom `Assets/Script Templates Editor` you can open the **Script Templates Editor** Window.\n\n![Custom Script Template Editor](https://github.com/mygamedevtools/script-template/assets/9505905/04d70654-95b9-4ab2-83f2-33e23a925631)\n\nHere you can preview in realtime what your script will look like, customize the values, and copy the templates. \n\n### Settings\n\nYou can decide to enable both the Signature and the Namespace modules, each with its own set of custom settings.\n\n#### Signature\n\nThe Signature module adds a simple signature header on your script following the template:\n\n```cs\n/**\n * #SCRIPTNAME#.cs\n * Created by: #AUTHOR#\n * Created on: #CREATIONDATE#\n */\n```\n\nThe `#SCRIPTNAME#` is no stranger to custom script templates, as it is replaced by the default Unity asset processor.\nHowever, both the `#AUTHOR#` and `#CREATIONDATE#` will be replaced by the values you set on the `Author`, `Email(optional)`, and `Use Local Date` fields under the Namespace module group.\n\n#### Namespace\n\nThe Namespace module adds a namespace to your file, indenting the template content under it.\nFor that to work, you need to have a template such as:\n\n```\n#NAMESPACE#public class #SCRIPTNAME# : MonoBehaviour\n{\n# #public void Start()\n# #{\n# ## #\n# #}\n}\n```\n\nThen, if enabled, the namespace will be replaced according to the values you set.\nIf you enable `Use Assembly Definition`, make sure the script is in the correct location to be linked to an assembly definition, or the `Default Namespace` will be applied.\nOtherwise, if you decide to just use the `Default Namespace`, then it will be applied to all scripts.\n\n#### Indentation\n\nThe indentation whitespaces must be marked with the `# #` keyword, one for each indent level, so they can be converted to tabs or spaces and by how much. So, using the previous example:\n\n```\n#NAMESPACE#public class #SCRIPTNAME# : MonoBehaviour\n{\n# #public void Start()\n# #{\n# ## #\n# #}\n}\n```\n\nBy selecting **4 spaces** as the indentation settings, the final created script would be:\n\n```cs\nnamespace MyNamespace\n{\n    public class MyClass : MonoBehaviour\n    {\n        public void Start()\n        {\n\n        }\n    }\n}\n```\n\nFinally, you should `Save` your changes once you're satisfied with your settings, to make sure they will be used whenever creating a new script.\nYou also have the option to `Clear` those settings at any time, if you wish.\nThis data is saved to the [Editor Prefs](https://docs.unity3d.com/ScriptReference/EditorPrefs.html) cache.\n\n\n### Templates\n\nThis section shows a list of all included Script Templates and you can select them to locate the file.\nYou also have two buttons: `Copy to Project` and `Copy to Editor`.\nThe first one will copy all script templates to the current project `Assets/ScriptTemplates` path, limiting the script template usage to that project.\nThe other will copy all script templates to your Editor folder, and you will be able to use the templates\nin all projects.\nHowever, if you don't have this package in a project, it will not replace the custom keywords on the file and might lead to compilation issues.\nAlso, if you update the Unity Editor version, you will lose the script templates and be required to copy them again. This is not necessary if you copy them to your project.\nBoth actions of copying to the project and to the editor will require an editor restart to take effect.\n\n#### Included Templates:\n\n* Game Objects\n  * [Mono Behaviour](https://docs.unity3d.com/ScriptReference/MonoBehaviour.html)\n  * [Scriptable Object](https://docs.unity3d.com/ScriptReference/ScriptableObject.html)\n  * [State Machine Behaviour](https://docs.unity3d.com/ScriptReference/StateMachineBehaviour.html)\n  * [Property Attribute](https://docs.unity3d.com/ScriptReference/PropertyAttribute.html)\n* Editor\n  * [Editor Window](https://docs.unity3d.com/ScriptReference/EditorWindow.html)\n  * [Custom Editor Inspector](https://docs.unity3d.com/ScriptReference/Editor.html)\n  * [Property Drawer](https://docs.unity3d.com/ScriptReference/PropertyDrawer.html)\n* UI Toolkit\n  * [Custom Element](https://docs.unity3d.com/Manual/UIE-expose-custom-control-to-uxml.html)\n* Entities\n  * [System](https://docs.unity3d.com/Packages/com.unity.entities@1.0/manual/systems-isystem.html)\n  * [Component](https://docs.unity3d.com/Packages/com.unity.entities@1.0/manual/components-unmanaged.html)\n  * [Authoring](https://docs.unity3d.com/Packages/com.unity.entities@1.0/manual/baking-baker-overview.html) (Baker Workflow)\n  * [Managed Component](https://docs.unity3d.com/Packages/com.unity.entities@1.0/manual/components-managed.html)\n  * [Managed System](https://docs.unity3d.com/Packages/com.unity.entities@1.0/manual/systems-systembase.html)\n* Plain C#\n  * Class\n  * Struct\n  * Enum\n  * Interface\n\nHow it works\n---\n\nThe custom Script Templates have custom keywords that will be replaced by the data you entered on the Editor Window and the present date.\nThe keyword recognition and replacing is done by the [ScriptKeywordReplacer](Assets/CustomScriptTemplate/Editor/ScriptKeywordReplacer.cs) class.\n\nCustomization\n---\n\nYou can customize your Script Templates to suit your needs, for example, adding default methods or even new keywords to process.\nJust make sure you add them to the correct folder and add the custom keywords following the same rules as the built-in templates.\nKeep in mind that if you ever want a feature that it does not have, I may want to include it in this package.\n\nBut, why?\n---\n\nFor me, it's more practical to create scripts from premade templates for different usage contexts than starting with the default \"CSharp Script\" Unity provides. With this package, you can have multiple templates to easily bootstrap your coding.\n\n---\n\nDon't hesitate to create [issues](https://github.com/mygamedevtools/script-template/issues) for suggestions and bugs. Have fun!\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmygamedevtools%2Fscript-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmygamedevtools%2Fscript-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmygamedevtools%2Fscript-template/lists"}