{"id":226,"date":"2015-07-06T18:15:36","date_gmt":"2015-07-06T18:15:36","guid":{"rendered":"http:\/\/blog.electrongoo.com\/?p=226"},"modified":"2017-11-15T18:22:51","modified_gmt":"2017-11-15T18:22:51","slug":"how-to-update-the-default-behavior-script-in-unity3d","status":"publish","type":"post","link":"https:\/\/blog.electrongoo.com\/index.php\/how-to-update-the-default-behavior-script-in-unity3d\/","title":{"rendered":"How to update the default behavior script in Unity3D"},"content":{"rendered":"<p>Creating new C# scripts in Unity3D is a simple process with a click of a mouse; although I find myself updating the default behavior script to match my coding preferences each time I create a new script.<\/p>\n<p>Here&#8217;s how I update the default script to simplify my development process.<\/p>\n<p>Browse to the Unity3D installation folder (typically\u00a0named &#8220;C:\\Program Files (x86)\\Unity\\&#8221;) and locate the sub-folder &#8220;Editor\/Data\/Resources\/ScriptTemplates&#8221;<\/p>\n<p><a href=\"http:\/\/blog.electrongoo.com\/wp-content\/uploads\/2015\/07\/unity3d-template.png\"><img loading=\"lazy\" class=\"aligncenter size-medium wp-image-230\" src=\"http:\/\/blog.electrongoo.com\/wp-content\/uploads\/2015\/07\/unity3d-template-300x133.png\" alt=\"unity3d-template\" width=\"300\" height=\"133\" srcset=\"https:\/\/blog.electrongoo.com\/wp-content\/uploads\/2015\/07\/unity3d-template-300x133.png 300w, https:\/\/blog.electrongoo.com\/wp-content\/uploads\/2015\/07\/unity3d-template-1024x453.png 1024w, https:\/\/blog.electrongoo.com\/wp-content\/uploads\/2015\/07\/unity3d-template.png 1074w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>Here you will see the template files used to create new scripts.\u00a0 On my system I have five templates: javascript, C#, Boo, shader, and computer shader.\u00a0 I am interested in the C# template.<\/p>\n<p>Open the file named &#8220;81-C# Script-NewBehaviourScript.cs.txt&#8221;<\/p>\n<p><a href=\"http:\/\/blog.electrongoo.com\/wp-content\/uploads\/2015\/07\/unity3d-template-1.png\"><img loading=\"lazy\" class=\"aligncenter size-medium wp-image-228\" src=\"http:\/\/blog.electrongoo.com\/wp-content\/uploads\/2015\/07\/unity3d-template-1-300x202.png\" alt=\"unity3d-template-1\" width=\"300\" height=\"202\" srcset=\"https:\/\/blog.electrongoo.com\/wp-content\/uploads\/2015\/07\/unity3d-template-1-300x202.png 300w, https:\/\/blog.electrongoo.com\/wp-content\/uploads\/2015\/07\/unity3d-template-1.png 421w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>Update the layout file<\/p>\n<p><a href=\"http:\/\/blog.electrongoo.com\/wp-content\/uploads\/2015\/07\/unity3d-template-2.png\"><img loading=\"lazy\" class=\"aligncenter size-medium wp-image-229\" src=\"http:\/\/blog.electrongoo.com\/wp-content\/uploads\/2015\/07\/unity3d-template-2-300x243.png\" alt=\"unity3d-template-2\" width=\"300\" height=\"243\" srcset=\"https:\/\/blog.electrongoo.com\/wp-content\/uploads\/2015\/07\/unity3d-template-2-300x243.png 300w, https:\/\/blog.electrongoo.com\/wp-content\/uploads\/2015\/07\/unity3d-template-2.png 423w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>Save the file<\/p>\n<p>Now, when I create a new C# script in Unity3D it uses my preferred coding style layout.<\/p>\n<p>Note: if you re-install Unity3D then you will need to update the layout file again.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Creating new C# scripts in Unity3D is a simple process with a click of a mouse; although I find myself updating the default behavior script to match my coding preferences each time I create a new script. Here&#8217;s how I update the default script to simplify my development process. Browse to the Unity3D installation folder &hellip; <a href=\"https:\/\/blog.electrongoo.com\/index.php\/how-to-update-the-default-behavior-script-in-unity3d\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">How to update the default behavior script in Unity3D<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[3],"tags":[],"_links":{"self":[{"href":"https:\/\/blog.electrongoo.com\/index.php\/wp-json\/wp\/v2\/posts\/226"}],"collection":[{"href":"https:\/\/blog.electrongoo.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.electrongoo.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.electrongoo.com\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.electrongoo.com\/index.php\/wp-json\/wp\/v2\/comments?post=226"}],"version-history":[{"count":3,"href":"https:\/\/blog.electrongoo.com\/index.php\/wp-json\/wp\/v2\/posts\/226\/revisions"}],"predecessor-version":[{"id":233,"href":"https:\/\/blog.electrongoo.com\/index.php\/wp-json\/wp\/v2\/posts\/226\/revisions\/233"}],"wp:attachment":[{"href":"https:\/\/blog.electrongoo.com\/index.php\/wp-json\/wp\/v2\/media?parent=226"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.electrongoo.com\/index.php\/wp-json\/wp\/v2\/categories?post=226"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.electrongoo.com\/index.php\/wp-json\/wp\/v2\/tags?post=226"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}