{"id":4388,"date":"2016-10-07T22:37:00","date_gmt":"2016-10-07T14:37:00","guid":{"rendered":"http:\/\/unitycoder.com\/blog\/?p=4388"},"modified":"2016-10-07T22:37:00","modified_gmt":"2016-10-07T14:37:00","slug":"adding-custom-script-templates","status":"publish","type":"post","link":"https:\/\/unitycoder.com\/blog\/2016\/10\/07\/adding-custom-script-templates\/","title":{"rendered":"Adding Custom Script Templates"},"content":{"rendered":"<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"4389\" data-permalink=\"https:\/\/unitycoder.com\/blog\/2016\/10\/07\/adding-custom-script-templates\/custom-editor-script-template\/\" data-orig-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2016\/10\/custom-editor-script-template.jpg?fit=547%2C280&amp;ssl=1\" data-orig-size=\"547,280\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"custom-editor-script-template\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2016\/10\/custom-editor-script-template.jpg?fit=547%2C280&amp;ssl=1\" class=\"alignnone size-full wp-image-4389\" src=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2016\/10\/custom-editor-script-template.jpg?resize=547%2C280\" alt=\"custom-editor-script-template\" width=\"547\" height=\"280\" srcset=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2016\/10\/custom-editor-script-template.jpg?w=547&amp;ssl=1 547w, https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2016\/10\/custom-editor-script-template.jpg?resize=300%2C154&amp;ssl=1 300w\" sizes=\"auto, (max-width: 547px) 100vw, 547px\" \/><\/p>\n<p>Adding custom script templates is quite simple:<br \/>\n&#8211; Create your custom script<br \/>\n&#8211; Replace all class name strings with #SCRIPTNAME# (this will get replaced by the new created script name)<br \/>\n&#8211; Move the script file under your unity installation folder: \\Unity\\Editor\\Data\\Resources\\ScriptTemplates\\<br \/>\n&#8211; Rename &#8220;YourScript.cs&#8221; into &#8220;81a-C# Your Script-YourNewScript.cs.txt&#8221; (&#8217;81a&#8217; is the menu location, so this would appear below the default c# script)<\/p>\n<p><strong>Note:<\/strong><br \/>\n&#8211; This folder gets replaced if you install new Unity version!<br \/>\n&#8211; You need to restart unity after you have placed the file on that folder (otherwise its not visible in the menu)<br \/>\n&#8211; You can remove the &#8220;82-Javascript-NewBehaviourScript.js.txt&#8221; if you don&#8217;t need javascript files, saves some space on the menu..<\/p>\n<p><strong>Example editor script template:<\/strong><br \/>\n<a href=\"https:\/\/github.com\/UnityCommunity\/UnityLibrary\/blob\/master\/ScriptTemplates\/81a-C%23%20Editor%20Script-NewEditorScript.cs.txt\" target=\"_blank\">https:\/\/github.com\/UnityCommunity\/UnityLibrary\/blob\/master\/ScriptTemplates\/81a-C%23%20Editor%20Script-NewEditorScript.cs.txt<\/a><\/p>\n<p>&nbsp;<\/p>\n<p><strong>References:<\/strong><br \/>\n<a href=\"https:\/\/support.unity3d.com\/hc\/en-us\/articles\/210223733-How-to-customize-Unity-script-templates\" target=\"_blank\">https:\/\/support.unity3d.com\/hc\/en-us\/articles\/210223733-How-to-customize-Unity-script-templates<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Adding custom script templates is quite simple: &#8211; Create your custom script &#8211; Replace all class name strings with #SCRIPTNAME# (this will get replaced by the new created script name) &#8211; Move the script file under your unity installation folder: \\Unity\\Editor\\Data\\Resources\\ScriptTemplates\\ &#8211; Rename &#8220;YourScript.cs&#8221; into [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":4389,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"Adding Custom Script Templates #unitytips","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[420,3],"tags":[428,568,358,918,923,189,802],"class_list":["post-4388","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials","category-unity3d","tag-create","tag-custom","tag-editor","tag-item","tag-menu","tag-script","tag-template"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2016\/10\/custom-editor-script-template.jpg?fit=547%2C280&ssl=1","jetpack_shortlink":"https:\/\/wp.me\/p1KTaT-18M","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/posts\/4388","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/comments?post=4388"}],"version-history":[{"count":1,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/posts\/4388\/revisions"}],"predecessor-version":[{"id":4390,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/posts\/4388\/revisions\/4390"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/media\/4389"}],"wp:attachment":[{"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/media?parent=4388"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/categories?post=4388"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/tags?post=4388"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}