{"id":738,"date":"2019-08-29T13:12:25","date_gmt":"2019-08-29T13:12:25","guid":{"rendered":"https:\/\/docs.sisus.co\/power-inspector\/?p=738"},"modified":"2022-07-11T15:43:21","modified_gmt":"2022-07-11T15:43:21","slug":"create-script-wizard","status":"publish","type":"post","link":"https:\/\/docs.sisus.co\/power-inspector\/features\/create-script-wizard\/","title":{"rendered":"20. Create Script Wizard"},"content":{"rendered":"<p>Power Inspector comes with a Create Script Wizard, which makes it easy to <strong>create new script assets<\/strong>.<\/p>\n<p>It is based on the excellent <a href=\"https:\/\/blogs.unity3d.com\/2011\/03\/23\/ninjacamp-iii-new-script-dialog\/\">Create Script Dialog<\/a> by Unity &#8211; which no longer seems to be available anywhere.<\/p>\n<h1>Opening The Create Script Wizard<\/h1>\n<p>To <strong>open<\/strong> the Create Script Window, first open the <strong>Add Component dialog<\/strong>, and then <strong>click<\/strong> the <strong>plus sign, <\/strong>or use the add component keyboard shortcut <strong>Ctrl + T<\/strong>.<\/p>\n<p><img loading=\"lazy\" class=\"alignnone size-full wp-image-740\" src=\"https:\/\/docs.sisus.co\/power-inspector\/wp-content\/uploads\/2019\/08\/create-new-script-button.png\" alt=\"\" width=\"283\" height=\"561\" srcset=\"https:\/\/docs.sisus.co\/power-inspector\/wp-content\/uploads\/sites\/2\/2019\/08\/create-new-script-button.png 283w, https:\/\/docs.sisus.co\/power-inspector\/wp-content\/uploads\/sites\/2\/2019\/08\/create-new-script-button-151x300.png 151w\" sizes=\"(max-width: 283px) 100vw, 283px\" \/><\/p>\n<p>Alternatively you can open it from the <strong>Project view&#8217;s<\/strong> <strong>Create<\/strong> <strong>menu<\/strong> using the menu item <strong>C# Script Wizard<\/strong>.<\/p>\n<p><img loading=\"lazy\" class=\"alignnone size-full wp-image-981\" src=\"https:\/\/docs.sisus.co\/power-inspector\/wp-content\/uploads\/2019\/08\/CreateScriptWizardFromCreateMenu.png\" alt=\"\" width=\"321\" height=\"272\" srcset=\"https:\/\/docs.sisus.co\/power-inspector\/wp-content\/uploads\/sites\/2\/2019\/08\/CreateScriptWizardFromCreateMenu.png 321w, https:\/\/docs.sisus.co\/power-inspector\/wp-content\/uploads\/sites\/2\/2019\/08\/CreateScriptWizardFromCreateMenu-300x254.png 300w\" sizes=\"(max-width: 321px) 100vw, 321px\" \/><\/p>\n<h1>Using the Create Script Wizard<\/h1>\n<p><img loading=\"lazy\" class=\"alignnone size-full wp-image-739\" src=\"https:\/\/docs.sisus.co\/power-inspector\/wp-content\/uploads\/2019\/08\/create-new-script-wizard.png\" alt=\"\" width=\"771\" height=\"566\" srcset=\"https:\/\/docs.sisus.co\/power-inspector\/wp-content\/uploads\/sites\/2\/2019\/08\/create-new-script-wizard.png 771w, https:\/\/docs.sisus.co\/power-inspector\/wp-content\/uploads\/sites\/2\/2019\/08\/create-new-script-wizard-300x220.png 300w, https:\/\/docs.sisus.co\/power-inspector\/wp-content\/uploads\/sites\/2\/2019\/08\/create-new-script-wizard-768x564.png 768w\" sizes=\"(max-width: 771px) 100vw, 771px\" \/><\/p>\n<p>Using the Create Script Wizard, you can <strong>configure<\/strong> the following aspects of the created script:<\/p>\n<ol>\n<li>Specify the <strong>namespace<\/strong> to use for your script. The default namespace can be configured in the <a href=\"https:\/\/docs.sisus.co\/power-inspector\/getting-started\/editing-preferences\/\">Preferences<\/a>.<\/li>\n<li>Specify the <strong>name<\/strong> for your new script. If the Create Script Wizard was opened through a Add Component dialog which contained a filter text, then that filter text will automatically be used as the default value for this field.<\/li>\n<li>Specify the <strong>Template<\/strong> to use when generating the code. For example MonoBehaviour, ScriptableObject or Plain Class.<\/li>\n<li>Specify the <strong>GameObject<\/strong> onto which an instance of the created script should be attached. This option is only available when using the MonoBehaviour template. If the Create Script Wizard was opened through the Add Component button, this is mapped the <a href=\"https:\/\/docs.sisus.co\/power-inspector\/terminology\/target-object\/\">target<\/a> GameObject.<\/li>\n<li>Specify the <strong>path<\/strong> where the script asset should be saved. The default path can be configured in the Preferences. Currently you can change the path where you want to save the script asset by selecting a directory in the Project view (NOTE: when using Two Column Layout, this only works when selecting directories on the right-side column).<\/li>\n<li>Specify which <strong>using directives<\/strong> you would like to include in the generated code.<\/li>\n<li>Specify which <strong>functions<\/strong> you would like to include in the generated code.<\/li>\n<\/ol>\n<p>Once you&#8217;ve configured everything to your liking, press the &#8220;<strong>Create and Attach<\/strong>&#8221; button, at which point the following things will happen:<\/p>\n<ol>\n<li>The <strong>script asset<\/strong> will <strong>created<\/strong>, containing <strong>code generated<\/strong> based on your chosen settings.<\/li>\n<li>The created script asset will be <strong>opened<\/strong> in your <strong>External Script Editor<\/strong>.<\/li>\n<li>If &#8220;attach to&#8221; field has a value, the an instance of the created script will be <strong>attached<\/strong> to the <strong>GameObject<\/strong> in question as a new Component.<\/li>\n<\/ol>\n<p><img loading=\"lazy\" class=\"alignnone size-full wp-image-742\" src=\"https:\/\/docs.sisus.co\/power-inspector\/wp-content\/uploads\/2019\/08\/create-new-script-script-opens.png\" alt=\"\" width=\"569\" height=\"619\" srcset=\"https:\/\/docs.sisus.co\/power-inspector\/wp-content\/uploads\/sites\/2\/2019\/08\/create-new-script-script-opens.png 569w, https:\/\/docs.sisus.co\/power-inspector\/wp-content\/uploads\/sites\/2\/2019\/08\/create-new-script-script-opens-276x300.png 276w, https:\/\/docs.sisus.co\/power-inspector\/wp-content\/uploads\/sites\/2\/2019\/08\/create-new-script-script-opens-300x326.png 300w\" sizes=\"(max-width: 569px) 100vw, 569px\" \/> <img loading=\"lazy\" class=\"alignnone size-full wp-image-741\" src=\"https:\/\/docs.sisus.co\/power-inspector\/wp-content\/uploads\/2019\/08\/create-new-script-Component-added.png\" alt=\"\" width=\"319\" height=\"268\" srcset=\"https:\/\/docs.sisus.co\/power-inspector\/wp-content\/uploads\/sites\/2\/2019\/08\/create-new-script-Component-added.png 319w, https:\/\/docs.sisus.co\/power-inspector\/wp-content\/uploads\/sites\/2\/2019\/08\/create-new-script-Component-added-300x252.png 300w\" sizes=\"(max-width: 319px) 100vw, 319px\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Power Inspector comes with a Create Script Wizard, which makes it easy to create new script assets. It is based on the excellent Create Script Dialog by Unity &#8211; which no longer seems to be available anywhere. Opening The Create Script Wizard To open the Create Script Window, first open the Add Component dialog, and ..<\/p>\n<div class=\"clear-fix\"><\/div>\n<p><a href=\"https:\/\/docs.sisus.co\/power-inspector\/features\/create-script-wizard\/\" title=\"read more\">Read more<\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[5],"tags":[],"_links":{"self":[{"href":"https:\/\/docs.sisus.co\/power-inspector\/wp-json\/wp\/v2\/posts\/738"}],"collection":[{"href":"https:\/\/docs.sisus.co\/power-inspector\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/docs.sisus.co\/power-inspector\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/docs.sisus.co\/power-inspector\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/docs.sisus.co\/power-inspector\/wp-json\/wp\/v2\/comments?post=738"}],"version-history":[{"count":12,"href":"https:\/\/docs.sisus.co\/power-inspector\/wp-json\/wp\/v2\/posts\/738\/revisions"}],"predecessor-version":[{"id":1894,"href":"https:\/\/docs.sisus.co\/power-inspector\/wp-json\/wp\/v2\/posts\/738\/revisions\/1894"}],"wp:attachment":[{"href":"https:\/\/docs.sisus.co\/power-inspector\/wp-json\/wp\/v2\/media?parent=738"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.sisus.co\/power-inspector\/wp-json\/wp\/v2\/categories?post=738"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.sisus.co\/power-inspector\/wp-json\/wp\/v2\/tags?post=738"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}