{"id":1607,"date":"2019-12-11T21:30:44","date_gmt":"2019-12-11T21:30:44","guid":{"rendered":"https:\/\/docs.sisus.co\/power-inspector\/?p=1607"},"modified":"2021-03-24T17:53:39","modified_gmt":"2021-03-24T17:53:39","slug":"usedrawer","status":"publish","type":"post","link":"https:\/\/docs.sisus.co\/power-inspector\/attributes\/usedrawer\/","title":{"rendered":"UseDrawer"},"content":{"rendered":"<p>Attribute that can be used to specify which drawer should be responsible for drawing the target class or class member in the inspector.<\/p>\n<p>When you add this attribute to a class member, that class member will be drawn using the specified drawer, but only inside the class that holds the class member.<\/p>\n<p>When you add this attribute to a class, that class will always be drawn using the specified drawer by default. This has the same outcome as when the DrawerForField attribute is used to make a drawer target a specific class type. This can be useful if you want to avoid modifying the drawer class.<\/p>\n<h2>Attribute Target<\/h2>\n<p>Class, field, property, method or indexer.<\/p>\n<h2>Example<\/h2>\n<pre>using UnityEngine;\r\nusing Sisus;\r\nusing Sisus.Attributes;\r\n\r\npublic class StickyNote : MonoBehaviour\r\n{\r\n\t[UseDrawer(typeof(StyledTextDrawer), \"VCS_StickyNote\"), TextArea]\r\n\tpublic string note = \"(Add note here)\";\r\n}<\/pre>\n<h2>Example Result<\/h2>\n<p><img loading=\"lazy\" class=\"alignnone size-full wp-image-1609\" src=\"https:\/\/docs.sisus.co\/power-inspector\/wp-content\/uploads\/2019\/12\/unity-sticky-note.png\" alt=\"\" width=\"282\" height=\"98\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Attribute that can be used to specify which drawer should be responsible for drawing the target class or class member in the inspector. When you add this attribute to a class member, that class member will be drawn using the specified drawer, but only inside the class that holds the class member. When you add ..<\/p>\n<div class=\"clear-fix\"><\/div>\n<p><a href=\"https:\/\/docs.sisus.co\/power-inspector\/attributes\/usedrawer\/\" 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":[26],"tags":[],"_links":{"self":[{"href":"https:\/\/docs.sisus.co\/power-inspector\/wp-json\/wp\/v2\/posts\/1607"}],"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=1607"}],"version-history":[{"count":7,"href":"https:\/\/docs.sisus.co\/power-inspector\/wp-json\/wp\/v2\/posts\/1607\/revisions"}],"predecessor-version":[{"id":1845,"href":"https:\/\/docs.sisus.co\/power-inspector\/wp-json\/wp\/v2\/posts\/1607\/revisions\/1845"}],"wp:attachment":[{"href":"https:\/\/docs.sisus.co\/power-inspector\/wp-json\/wp\/v2\/media?parent=1607"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.sisus.co\/power-inspector\/wp-json\/wp\/v2\/categories?post=1607"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.sisus.co\/power-inspector\/wp-json\/wp\/v2\/tags?post=1607"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}