{"id":1529,"date":"2019-11-20T14:06:51","date_gmt":"2019-11-20T14:06:51","guid":{"rendered":"https:\/\/docs.sisus.co\/power-inspector\/?p=1529"},"modified":"2021-05-14T17:22:32","modified_gmt":"2021-05-14T17:22:32","slug":"improved-add-component-button","status":"publish","type":"post","link":"https:\/\/docs.sisus.co\/power-inspector\/features\/improved-add-component-button\/","title":{"rendered":"26. Improved Add Component Button"},"content":{"rendered":"<h1>Smarter Require Component<\/h1>\n<p>With the help of two new attributes RequireComponents and <strong><a href=\"https:\/\/docs.sisus.co\/power-inspector\/attributes\/requireanycomponent\/\">RequireAnyComponent<\/a><\/strong>, you can specify complex requirement relationships between your components.<br \/>\nBoth attributes also support using specify requirements in the form of interfaces and abstract classes, helping you write better, more decoupled and reliable code.<\/p>\n<p>When the user tries to add a component to a GameObject that requires one of several possible components, and none of them are already found on the GameObject, then user will be prompted to select which component to add.<\/p>\n<p>You no longer have to worry about cyclic component requirements preventing you from removing components either.<br \/>\nPower Inspector is smart enough to gather up all required components and to ask you if you want to remove them all, when you try to delete a component with requirements.<\/p>\n<h1>Hideable<\/h1>\n<p>It is possible to <strong>hide<\/strong> the Add Component button in Power Inspector.<\/p>\n<p>This can be achieved by adding the <strong><a href=\"https:\/\/docs.sisus.co\/power-inspector\/attributes\/onlycomponent\/\">OnlyComponent attribute<\/a><\/strong> to a component on the GameObject on which you want to hide the button.<\/p>\n<h1>Quick Add Menu<\/h1>\n<p>You can <strong>right-click<\/strong> the <strong>Add Component button<\/strong> to open a new context menu called the <strong>Quick Add Menu<\/strong>.<br \/>\nThis menu will display a list of the last 10 components that you&#8217;ve added to your GameObjects using the Add Component button.<br \/>\nClick one of the items to add it to the target GameObject.<\/p>\n<p><img loading=\"lazy\" class=\"alignnone size-full wp-image-1530\" src=\"https:\/\/docs.sisus.co\/power-inspector\/wp-content\/uploads\/2019\/11\/quick-add-component-unity.png\" alt=\"\" width=\"282\" height=\"252\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<blockquote><p><strong>See also<\/strong>: <a href=\"https:\/\/docs.sisus.co\/power-inspector\/features\/create-script-wizard\/\"><strong>Create Script Wizard<\/strong><\/a><\/p><\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>Smarter Require Component With the help of two new attributes RequireComponents and RequireAnyComponent, you can specify complex requirement relationships between your components. Both attributes also support using specify requirements in the form of interfaces and abstract classes, helping you write better, more decoupled and reliable code. When the user tries to add a component to ..<\/p>\n<div class=\"clear-fix\"><\/div>\n<p><a href=\"https:\/\/docs.sisus.co\/power-inspector\/features\/improved-add-component-button\/\" 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\/1529"}],"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=1529"}],"version-history":[{"count":3,"href":"https:\/\/docs.sisus.co\/power-inspector\/wp-json\/wp\/v2\/posts\/1529\/revisions"}],"predecessor-version":[{"id":1890,"href":"https:\/\/docs.sisus.co\/power-inspector\/wp-json\/wp\/v2\/posts\/1529\/revisions\/1890"}],"wp:attachment":[{"href":"https:\/\/docs.sisus.co\/power-inspector\/wp-json\/wp\/v2\/media?parent=1529"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.sisus.co\/power-inspector\/wp-json\/wp\/v2\/categories?post=1529"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.sisus.co\/power-inspector\/wp-json\/wp\/v2\/tags?post=1529"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}