{"id":288786,"date":"2018-08-31T13:00:02","date_gmt":"2018-08-31T09:00:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=288786"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=288786","title":{"rendered":"Unity: \u0437\u043d\u0430\u043a\u043e\u043c\u0441\u0442\u0432\u043e \u0441\u043e Scriptable Objects"},"content":{"rendered":"\n<div data-io-article-url=\"https:\/\/habr.com\/post\/421523\/\" class=\"post__text post__text-html js-mediator-article\">\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/ddb\/365\/357\/ddb365357b74dc1e5d86d337d90c8398.gif\" alt=\"image\"><\/div>\n<p>  \u0412 \u044d\u0442\u043e\u043c \u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b\u0435 \u0432\u044b \u0443\u0437\u043d\u0430\u0435\u0442\u0435, \u043a\u0430\u043a \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Scriptable Objects \u0432 Unity. Scriptable Objects \u043f\u043e\u043c\u043e\u0433\u0443\u0442 \u0443\u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0432\u0430\u0448 \u0440\u0430\u0431\u043e\u0447\u0438\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441, \u0441\u043d\u0438\u0437\u0438\u0442\u044c \u043e\u0431\u044a\u0451\u043c \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u043c\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438 \u0438 \u0434\u0430\u0436\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0442 \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u044c \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443 \u043a\u043e\u0434\u0430.<\/p>\n<p>  \u0421\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 <a href=\"https:\/\/docs.unity3d.com\/Manual\/class-ScriptableObject.html\">Unity<\/a>, ScriptableObject \u2014 \u044d\u0442\u043e \u043a\u043e\u0434 \u043a\u043b\u0430\u0441\u0441\u0430, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0439 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0432 \u0438\u0433\u0440\u0435 Scriptable Objects \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u043e\u0431\u044a\u0451\u043c\u043e\u0432 \u043e\u0431\u0449\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445, \u043d\u0435 \u0437\u0430\u0432\u0438\u0441\u044f\u0449\u0438\u0445 \u043e\u0442 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u043e\u0432 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432.<\/p>\n<p>  \u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043f\u0440\u0438\u0447\u0438\u043d \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f Scriptable Objects \u0432 Unity. \u041e\u043d\u0438 \u043c\u043e\u0433\u0443\u0442 \u0441\u043d\u0438\u0437\u0438\u0442\u044c \u043e\u0431\u044a\u0451\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u043e\u0439 \u043f\u043e\u0434 \u043a\u0430\u0436\u0434\u044b\u0439 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0440\u0435\u0444\u0430\u0431 \u043f\u0430\u043c\u044f\u0442\u0438, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043f\u043e \u0441\u0432\u043e\u0435\u0439 \u0441\u0443\u0442\u0438 Scriptable Object \u0441\u043b\u0435\u0434\u0443\u044e\u0442 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u0443 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 <a href=\"http:\/\/www.gameprogrammingpatterns.com\/flyweight.html\">Flyweight<\/a>.<\/p>\n<p>  \u0415\u0449\u0451 \u043e\u0434\u043d\u043e \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u043e Scriptable Objects, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0431\u0443\u0434\u0435\u0442 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0442\u0435\u043c\u043e\u0439 \u044d\u0442\u043e\u0433\u043e \u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b\u0430, \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0438\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0434\u043b\u044f \u0443\u0434\u043e\u0431\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u0441\u044b\u043b\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445. \u041c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u044d\u0442\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043b\u0430\u0432\u043a\u0438 \u0442\u043e\u0440\u0433\u043e\u0432\u0446\u0430 \u043c\u0435\u0447\u0430\u043c\u0438, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0431\u0443\u0434\u0443\u0442 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c\u0441\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b, \u0446\u0435\u043d\u044b \u0438 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u043c\u0435\u0447\u0435\u0439.<br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<blockquote><p><em>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435:<\/em> \u0432 \u044d\u0442\u043e\u043c \u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b\u0435 \u043f\u043e\u0434\u0440\u0430\u0437\u0443\u043c\u0435\u0432\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0432\u044b \u0437\u043d\u0430\u043a\u043e\u043c\u044b \u0441 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u043e\u043c Unity. \u0412\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c\u0441\u044f \u0432 \u0442\u043e\u043c, \u043a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043a\u043e\u0434 \u0432 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0435 \u043a\u043e\u0434\u0430 \u0438 \u0438\u043c\u0435\u0442\u044c \u0431\u0430\u0437\u043e\u0432\u044b\u0435 \u0437\u043d\u0430\u043d\u0438\u044f C#. \u0415\u0441\u043b\u0438 \u0432\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u0432\u044b\u0441\u0438\u0442\u044c \u0441\u0432\u043e\u0438 \u043d\u0430\u0432\u044b\u043a\u0438 Unity, \u0438\u0437\u0443\u0447\u0438\u0442\u0435 \u0434\u0440\u0443\u0433\u0438\u0435 <a title=\"Unity tutorials\" href=\"https:\/\/www.raywenderlich.com\/category\/unity\">\u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b\u044b \u043f\u043e Unity<\/a>. <\/p><\/blockquote>\n<p>  <\/p>\n<h2>\u041f\u0440\u0438\u0441\u0442\u0443\u043f\u0430\u0435\u043c \u043a \u0440\u0430\u0431\u043e\u0442\u0435<\/h2>\n<p>  \u041d\u0430\u0447\u043d\u0451\u043c \u0441 <a href=\"https:\/\/koenig-media.raywenderlich.com\/uploads\/2018\/03\/ScriptableObjects.zip\">\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u043e\u0432<\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u044e\u0442\u0441\u044f.<\/p>\n<p>  \u0420\u0430\u0441\u043f\u0430\u043a\u0443\u0439\u0442\u0435 \u0441\u043a\u0430\u0447\u0430\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \u0432 \u0443\u0434\u043e\u0431\u043d\u043e\u0435 \u0434\u043b\u044f \u0432\u0430\u0441 \u043c\u0435\u0441\u0442\u043e \u0438 \u043e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 \u0432 Unity \u043f\u0440\u043e\u0435\u043a\u0442 <em>Scriptable Object Tutorial-Starter<\/em>.<\/p>\n<p>  \u0412\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u043f\u0430\u043f\u043a\u0443, \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u0443\u044e \u043a\u0430\u043a \u0447\u0430\u0441\u0442\u044c \u0437\u0430\u0433\u043e\u0442\u043e\u0432\u043a\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430:<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/046\/8c3\/b63\/0468c3b63c16cb562f7d826a51ff8597.png\"><\/div>\n<p>  <\/p>\n<ul>\n<li><em>_Setup<\/em>: \u0434\u043b\u044f \u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b\u0430 \u044d\u0442\u0430 \u043f\u0430\u043f\u043a\u0430 \u043d\u0435 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f.<\/li>\n<li><em>Scenes<\/em>: \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0441\u0446\u0435\u043d\u0443 <em>Sword Merchant<\/em>, \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0437\u0430\u043d\u0438\u043c\u0430\u0442\u044c\u0441\u044f \u0432 \u0442\u0435\u0447\u0435\u043d\u0438\u0435 \u0432\u0441\u0435\u0433\u043e \u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b\u0430. \u041e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 \u044d\u0442\u0443 \u0441\u0446\u0435\u043d\u0443.<\/li>\n<li><em>Scripts<\/em>: \u043f\u043e\u043a\u0430 \u0437\u0434\u0435\u0441\u044c \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u0441\u043a\u0440\u0438\u043f\u0442, \u043d\u043e \u0432 \u0442\u0435\u0447\u0435\u043d\u0438\u0435 \u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b\u0430 \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043d\u043e\u0432\u044b\u0435.<\/li>\n<li><em>Sword Icons<\/em>: \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043d\u0435\u043f\u043e\u0434\u0432\u0438\u0436\u043d\u044b\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0445 \u043c\u0435\u0447\u0435\u0439.<\/li>\n<li><em>Sword Prefabs<\/em>: \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043f\u0440\u0435\u0444\u0430\u0431\u044b \u0432\u0441\u0435\u0445 \u043c\u0435\u0447\u0435\u0439 \u0432 \u0441\u0446\u0435\u043d\u0435 Sword Merchant.<\/li>\n<\/ul>\n<p>  <\/p>\n<h2>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 Scriptable Object<\/h2>\n<p>  \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u0435\u0440\u0435\u0439\u0434\u0438\u0442\u0435 \u0432 \u0441\u0446\u0435\u043d\u0443 <em>Sword Merchant<\/em>. \u041e\u043d\u0430 \u0434\u043e\u043b\u0436\u043d\u0430 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/372\/6ea\/e89\/3726eae89b9ddb9f57a698ed5cd7626d.png\"><\/div>\n<p>  <\/p>\n<h3>\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430 Scriptable Object<\/h3>\n<p>  \u041d\u0430\u0441\u0442\u0430\u043b\u043e \u0432\u0440\u0435\u043c\u044f \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043f\u0435\u0440\u0432\u043e\u0433\u043e Scriptable Object!<\/p>\n<p>  \u0412 \u043f\u0430\u043f\u043a\u0435 <em>Scripts<\/em> \u0441\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u043d\u043e\u0432\u044b\u0439 \u0441\u043a\u0440\u0438\u043f\u0442 \u043f\u043e\u0434 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c <em>SwordData<\/em>. \u042d\u0442\u043e\u0442 \u043a\u043b\u0430\u0441\u0441 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043a\u0430\u043a \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u043c\u0435\u0447\u0435\u0439, \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u043c\u044b\u0445 \u0432 \u043b\u0430\u0432\u043a\u0435 \u0442\u043e\u0440\u0433\u043e\u0432\u0446\u0430 \u043c\u0435\u0447\u0430\u043c\u0438.<\/p>\n<p>  \u0412\u043d\u0443\u0442\u0440\u0438 \u044d\u0442\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 \u043d\u0430\u0447\u043d\u0451\u043c \u0441 \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f \u0438\u0437 <code>ScriptableObject<\/code> \u0432\u043c\u0435\u0441\u0442\u043e <code>MonoBehaviour<\/code>:<\/p>\n<pre><code class=\"cs\">public class SwordData : ScriptableObject {  }<\/code><\/pre>\n<p>  \u042d\u0442\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0441\u043e\u043e\u0431\u0449\u0430\u0435\u0442 Unity, \u0447\u0442\u043e \u043c\u044b \u043f\u043e-\u043f\u0440\u0435\u0436\u043d\u0435\u043c\u0443 \u0445\u043e\u0442\u0438\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0438 \u043c\u0435\u0442\u043e\u0434\u044b Unity, \u043a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u044b\u0439 MonoBehaviour, \u043d\u043e \u043d\u0430\u043c \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u0438\u043a\u0440\u0435\u043f\u043b\u044f\u0442\u044c \u044d\u0442\u043e\u0442 \u0441\u043a\u0440\u0438\u043f\u0442 \u043a GameObject. \u0412\u043c\u0435\u0441\u0442\u043e \u044d\u0442\u043e\u0433\u043e \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u043a\u0430\u043a \u043b\u044e\u0431\u043e\u0439 \u043e\u0431\u044b\u0447\u043d\u044b\u0439 \u0430\u0441\u0441\u0435\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u043f\u0440\u0435\u0444\u0430\u0431\u0430, \u0441\u0446\u0435\u043d\u044b \u0438\u043b\u0438 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u0430.<\/p>\n<p>  \u0417\u0430\u043f\u043e\u043b\u043d\u0438\u043c \u0441\u043a\u0440\u0438\u043f\u0442 \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c\u0438 \u043f\u043e\u043b\u044f\u043c\u0438, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0431\u0443\u0434\u0443\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c\u0441\u044f \u0432\u0441\u0435 \u0434\u0430\u043d\u043d\u044b\u0435, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438, \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u043c\u043e\u0439 \u0432 UI Sword Merchant.<\/p>\n<pre><code class=\"cs\">public class SwordData : ScriptableObject {     [SerializeField]     private string swordName;     [SerializeField]     private string description;     [SerializeField]     private Sprite icon;     [SerializeField]     private int goldCost;     [SerializeField]     private int attackDamage; }<\/code><\/pre>\n<p>  <\/p>\n<ul>\n<li><em>swordName<\/em>: <code>string<\/code>, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0431\u0443\u0434\u0435\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u044c\u0441\u044f \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043c\u0435\u0447\u0430.<\/li>\n<li><em>description<\/em>: <code>string<\/code>, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0431\u0443\u0434\u0435\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u044c\u0441\u044f \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043c\u0435\u0447\u0430.<\/li>\n<li><em>icon<\/em>: \u0441\u043f\u0440\u0430\u0439\u0442, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c\u0441\u044f \u0437\u043d\u0430\u0447\u043e\u043a \u043c\u0435\u0447\u0430.<\/li>\n<li><em>goldCost<\/em>: <code>int<\/code> \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u0438 \u043c\u0435\u0447\u0430 \u0432 \u0437\u043e\u043b\u043e\u0442\u0435.<\/li>\n<li><em>attackDamage<\/em>: <code>int<\/code> \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0443\u0440\u043e\u043d\u0430 \u043f\u0440\u0438 \u0430\u0442\u0430\u043a\u0435 \u043c\u0435\u0447\u043e\u043c.<\/li>\n<\/ul>\n<p>  <\/p>\n<blockquote><p><em>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435: SerializeField<\/em><\/p>\n<p>  \u0412 Unity \u0430\u0442\u0440\u0438\u0431\u0443\u0442 SerializeField \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u0447\u0430\u0441\u0442\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u0430, \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0435 \u0432 \u0418\u043d\u0441\u043f\u0435\u043a\u0442\u043e\u0440\u0435. \u041e\u043d \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u0437\u0430\u0434\u0430\u0432\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0435, \u043d\u0435 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044f \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0438\u0437 \u0434\u0440\u0443\u0433\u0438\u0445 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432.<\/p><\/blockquote>\n<p>  \u041a\u0430\u0436\u0434\u043e\u043c\u0443 \u043c\u0435\u0447\u0443 \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u0430\u044f \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f Scriptable Object <em>SwordData<\/em>. \u041d\u043e \u043f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u043c\u044b \u0441\u043c\u043e\u0436\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u044d\u0442\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438, \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c Scriptable Object \u0432 Asset Menu.<\/p>\n<p>  \u0414\u043e\u0431\u0430\u0432\u0438\u043c \u043d\u0430\u0448 Scriptable Object \u0432 Asset Menu, \u0434\u043e\u0431\u0430\u0432\u0438\u0432 \u043a \u043a\u043b\u0430\u0441\u0441\u0443 <em>SwordData<\/em> \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0430\u0442\u0440\u0438\u0431\u0443\u0442:<\/p>\n<pre><code class=\"cs\">[CreateAssetMenu(fileName = \"New SwordData\", menuName = \"Sword Data\", order = 51)] public class SwordData : ScriptableObject<\/code><\/pre>\n<p>  <\/p>\n<ul>\n<li><em>fileName<\/em>: \u0438\u043c\u044f \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u0430\u0441\u0441\u0435\u0442\u0430.<\/li>\n<li><em>menuName<\/em>: \u0438\u043c\u044f \u0430\u0441\u0441\u0435\u0442\u0430, \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u043c\u043e\u0435 \u0432 Asset Menu.<\/li>\n<li><em>order<\/em>: \u043c\u0435\u0441\u0442\u043e \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u0438\u044f \u0430\u0441\u0441\u0435\u0442\u0430 \u0432 Asset Menu. Unity \u0440\u0430\u0437\u0434\u0435\u043b\u044f\u0435\u0442 \u0430\u0441\u0441\u0435\u0442\u044b \u043d\u0430 \u043f\u043e\u0434\u0433\u0440\u0443\u043f\u043f\u044b \u0441 \u043c\u043d\u043e\u0436\u0438\u0442\u0435\u043b\u0435\u043c 50. \u0422\u043e \u0435\u0441\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 51 \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0442 \u043d\u043e\u0432\u044b\u0439 \u0430\u0441\u0441\u0435\u0442 \u0432\u043e \u0432\u0442\u043e\u0440\u0443\u044e \u0433\u0440\u0443\u043f\u043f\u0443 Asset Menu.<\/li>\n<\/ul>\n<p>  \u0415\u0441\u043b\u0438 \u0432\u0441\u0451 \u0441\u0434\u0435\u043b\u0430\u043d\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e, \u0442\u043e \u0432\u044b \u0441\u043c\u043e\u0436\u0435\u0442\u0435 \u0437\u0430\u0439\u0442\u0438 \u0432 <em>Assets &gt;&gt; Create<\/em> \u0438 \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0432 \u043c\u0435\u043d\u044e \u043d\u043e\u0432\u044b\u0439 \u0430\u0441\u0441\u0435\u0442 <em>Sword Data<\/em>. \u041e\u043d \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d \u0432\u043e \u0432\u0442\u043e\u0440\u043e\u0439 \u0433\u0440\u0443\u043f\u043f\u0435 \u043f\u043e\u0434 \u0430\u0441\u0441\u0435\u0442\u043e\u043c Folder:<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/027\/83d\/d78\/02783dd7809273371aeaf0fde21cbb07.png\"><\/div>\n<p>  \u0422\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0436\u0430\u0442\u044c \u043f\u0440\u0430\u0432\u043e\u0439 \u043a\u043b\u0430\u0432\u0438\u0448\u0435\u0439 \u043c\u044b\u0448\u0438 \u0432 \u043e\u043a\u043d\u0435 Project \u0438 \u0442\u043e\u0436\u0435 \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u043d\u043e\u0432\u044b\u0439 \u0430\u0441\u0441\u0435\u0442 Sword Data:<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/ec8\/f0c\/1cf\/ec8f0c1cf7b7b861517c0b6838d9c80c.png\"><\/div>\n<p>  <\/p>\n<h3>\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445<\/h3>\n<p>  \u0423\u043f\u043e\u0440\u044f\u0434\u043e\u0447\u0438\u043c \u043f\u0440\u043e\u0435\u043a\u0442, \u0441\u043e\u0437\u0434\u0430\u0432 \u0432 \u043f\u0430\u043f\u043a\u0435 Scripts \u043f\u0430\u043f\u043a\u0443 \u0441 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c <em>Scriptable Objects<\/em>, \u0430 \u0432\u043d\u0443\u0442\u0440\u0438 \u044d\u0442\u043e\u0439 \u043f\u0430\u043f\u043a\u0438 \u2014 \u0435\u0449\u0451 \u043e\u0434\u043d\u0443 \u043f\u0430\u043f\u043a\u0443 \u0441 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c <em>Sword Data<\/em>.<\/p>\n<p>  \u0412\u043d\u0443\u0442\u0440\u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0442\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u0439 \u043f\u0430\u043f\u043a\u0438 Sword Data folder \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043d\u0430\u0448 \u043f\u0435\u0440\u0432\u044b\u0439 \u0430\u0441\u0441\u0435\u0442 Sword Data.<\/p>\n<p>  \u0423 \u043d\u043e\u0432\u043e\u0433\u043e \u0430\u0441\u0441\u0435\u0442\u0430 Sword Data \u043f\u043e-\u043f\u0440\u0435\u0436\u043d\u0435\u043c\u0443 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0435 \u0440\u0430\u043d\u0435\u0435 \u0438\u043c\u044f \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e <em>fileName<\/em>. \u0412\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u0430\u0441\u0441\u0435\u0442 \u0438 \u0434\u0443\u0431\u043b\u0438\u0440\u0443\u0439\u0442\u0435 \u0435\u0433\u043e \u0448\u0435\u0441\u0442\u044c \u0440\u0430\u0437 (<i>Ctrl\/Cmd + D<\/i>), \u0447\u0442\u043e\u0431\u044b \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u0435\u043c\u044c \u0430\u0441\u0441\u0435\u0442\u043e\u0432 Sword Data, \u043f\u043e \u043e\u0434\u043d\u043e\u043c\u0443 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0438\u0437 \u043c\u0435\u0447\u0435\u0439. \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u0443\u0439\u0442\u0435 \u043a\u0430\u0436\u0434\u044b\u0439 \u0430\u0441\u0441\u0435\u0442 \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441 \u043f\u0440\u0435\u0444\u0430\u0431\u0430\u043c\u0438:<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/9e6\/953\/191\/9e69531917c13064e6af81b31b58fdf7.gif\"><\/div>\n<p>  \u041d\u0430\u0436\u043c\u0438\u0442\u0435 \u043d\u0430 \u043f\u0435\u0440\u0432\u044b\u0439 \u0430\u0441\u0441\u0435\u0442 <em>Sword Data<\/em> \u0432 \u043f\u0430\u043f\u043a\u0435 Sword Data \u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 \u043d\u0430 \u043e\u043a\u043d\u043e <em>Inspector<\/em>:<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/af3\/380\/b20\/af3380b20efd5dc0a7485f4f3c7c971a.png\"><\/div>\n<p>  \u0417\u0434\u0435\u0441\u044c \u043c\u044b \u0432\u0438\u0434\u0438\u043c \u0430\u0441\u0441\u0435\u0442, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0431\u0443\u0434\u0435\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u044c\u0441\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u043c \u043c\u0435\u0447\u0435. \u0417\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u0435 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043c\u0435\u0447\u0430. \u041f\u043e\u0441\u0442\u0430\u0440\u0430\u0439\u0442\u0435\u0441\u044c \u0434\u0430\u0442\u044c \u0438\u043c \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u043e\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435, \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c \u0432 \u0437\u043e\u043b\u043e\u0442\u0435 \u0438 \u0443\u0440\u043e\u043d \u043f\u0440\u0438 \u0430\u0442\u0430\u043a\u0435. \u0412 \u043f\u043e\u043b\u0435 Icon Sprite \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0441\u043f\u0440\u0430\u0439\u0442\u044b, \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0435 \u0432 \u043f\u0430\u043f\u043a\u0435 <em>Sword Icons<\/em>:<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/b48\/d31\/025\/b48d3102517ad8e0f0877dd6cc28faff.gif\"><\/div>\n<p>  \u041f\u043e\u0437\u0434\u0440\u0430\u0432\u043b\u044f\u044e! \u0412\u044b \u0441\u043e\u0437\u0434\u0430\u043b\u0438 Scriptable Object \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043b\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u044d\u0442\u043e\u0433\u043e Scriptable Object \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0430\u0441\u0441\u0435\u0442\u043e\u0432.<\/p>\n<h2>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 Scriptable Object<\/h2>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u043c \u043a \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044e \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 \u044d\u0442\u0438\u0445 Scriptable Objects.<\/p>\n<p>  \u0412\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432-<em>\u043f\u043e\u043b\u0443\u0447\u0430\u0442\u0435\u043b\u0435\u0439<\/em> (getter methods), \u0447\u0442\u043e\u0431\u044b \u0434\u0440\u0443\u0433\u0438\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u044b \u043c\u043e\u0433\u043b\u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0447\u0430\u0441\u0442\u043d\u044b\u043c \u043f\u043e\u043b\u044f\u043c \u0432\u043d\u0443\u0442\u0440\u0438 Scriptable Object. \u041e\u0442\u043a\u0440\u043e\u0435\u043c <em>SwordData.cs<\/em> \u0438 \u0434\u043e\u043f\u0438\u0448\u0435\u043c \u043f\u043e\u0434 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u043c\u0438 \u0440\u0430\u043d\u0435\u0435 \u043f\u043e\u043b\u044f\u043c\u0438 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:<\/p>\n<pre><code class=\"cs\">    public string SwordName     {         get         {             return swordName;         }     }      public string Description     {         get         {             return description;         }     }      public Sprite Icon     {         get         {             return icon;         }     }      public int GoldCost     {         get         {             return goldCost;         }     }      public int AttackDamage     {         get         {             return attackDamage;         }     }<\/code><\/pre>\n<p>  \u041e\u0442\u043a\u0440\u043e\u0435\u043c <em>Sword.cs<\/em> \u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434:<\/p>\n<pre><code class=\"cs\">    [SerializeField]     private SwordData swordData; \/\/ 1      private void OnMouseDown() \/\/ 2     {         Debug.Log(swordData.name); \/\/ 3         Debug.Log(swordData.Description); \/\/ 3         Debug.Log(swordData.Icon.name); \/\/ 3         Debug.Log(swordData.GoldCost); \/\/ 3         Debug.Log(swordData.AttackDamage); \/\/ 3     }<\/code><\/pre>\n<p>  \u0412\u043e\u0442, \u0447\u0442\u043e \u043c\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u044d\u0442\u0438\u043c \u043a\u043e\u0434\u043e\u043c:<\/p>\n<ol>\n<li>\u041a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043b\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u044d\u0442\u043e\u0433\u043e \u043c\u0435\u0447\u0430.<\/li>\n<li><a href=\"https:\/\/docs.unity3d.com\/ScriptReference\/MonoBehaviour.OnMouseDown.html\"> OnMouseDown<\/a> \u2014 \u044d\u0442\u043e \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f MonoBehaviour, \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c\u0430\u044f \u043f\u0440\u0438 \u043d\u0430\u0436\u0430\u0442\u0438\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c \u043b\u0435\u0432\u043e\u0439 \u043a\u043b\u0430\u0432\u0438\u0448\u0438 \u043c\u044b\u0448\u0438.<\/li>\n<li>\u041f\u0440\u0438\u043c\u0435\u0440\u044b \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u043d\u0430\u0448\u0435\u0433\u043e \u0430\u0441\u0441\u0435\u0442\u0430 Scriptable Object asset<\/li>\n<\/ol>\n<p>  \u0412\u0435\u0440\u043d\u0451\u043c\u0441\u044f \u0432 Unity \u0438 \u043f\u0435\u0440\u0435\u0439\u0434\u0451\u043c \u043a \u043e\u043a\u043d\u0443 <em>Hierarchy<\/em>. \u0412\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u0438\u0433\u0440\u043e\u0432\u043e\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 1_Longsword \u0432 \u043f\u0440\u0435\u0444\u0430\u0431\u0435 \u043c\u0435\u0447\u0430. \u0414\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u0430\u0441\u0441\u0435\u0442 1_Longsword Data \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 Sword Data \u0441\u043a\u0440\u0438\u043f\u0442\u0430 Sword.cs \u0432 \u043e\u043a\u043d\u0435 Inspector:<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/89d\/dca\/502\/89ddca5023e919e838d92da776ca4e20.png\"><\/div>\n<p>  \u041d\u0430\u0436\u043c\u0438\u0442\u0435 \u043d\u0430 Play (<i>Ctrl\/Cmd + P<\/i>) \u0432 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0435 Unity, \u0430 \u0437\u0430\u0442\u0435\u043c \u0449\u0451\u043b\u043a\u043d\u0438\u0442\u0435 \u0441\u0430\u043c\u044b\u0439 \u043b\u0435\u0432\u044b\u0439 \u043c\u0435\u0447:<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/c8f\/2e0\/336\/c8f2e0336b61da17786068f13a5e787b.png\"><\/div>\n<p>  \u0412 \u043a\u043e\u043d\u0441\u043e\u043b\u044c \u0434\u043e\u043b\u0436\u043d\u0430 \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f, \u043d\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u044e\u0449\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435, \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u0430\u0441\u0441\u0435\u0442\u0430 Sword Data.<\/p>\n<p>  Scriptable Objects \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u0441 \u043b\u0451\u0433\u043a\u043e\u0441\u0442\u044c\u044e \u0437\u0430\u043c\u0435\u043d\u044f\u0442\u044c \u044d\u0442\u0438 \u0434\u0430\u043d\u043d\u044b\u0435. \u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u0440\u0430\u0437\u043d\u044b\u0435 Sword Data Scriptable Object \u0432 \u043f\u043e\u043b\u0435 Sword Data \u043c\u0435\u0447\u0430.<\/p>\n<h2>Scriptable Objects \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u0439<\/h2>\n<p>  \u0418\u0442\u0430\u043a, \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u043b\u0438 Scriptable Object, \u0438 \u0432\u044b \u0443\u0432\u0438\u0434\u0435\u043b\u0438, \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0435\u0433\u043e \u0434\u0430\u043d\u043d\u044b\u043c \u0432\u043d\u0443\u0442\u0440\u0438 \u0438\u0433\u0440\u044b. \u041d\u043e \u043d\u0430\u043c \u0432\u0441\u0451 \u0440\u0430\u0432\u043d\u043e \u043d\u0443\u0436\u043d\u043e \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c Sword Data \u0441 UI!<\/p>\n<p>  \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0431\u044b\u0441\u0442\u0440\u044b\u0439 \u0438 \u0433\u0440\u044f\u0437\u043d\u044b\u0439 \u043f\u0430\u0442\u0442\u0435\u0440\u043d <a href=\"http:\/\/gameprogrammingpatterns.com\/singleton.html\">Singleton<\/a>. \u041e\u0434\u043d\u0430\u043a\u043e \u043c\u044b \u0442\u0435\u043f\u0435\u0440\u044c \u043e\u0431\u043b\u0430\u0434\u0430\u0435\u043c \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044f\u043c\u0438\u2026<\/p>\n<p>  \u2026\u0430 \u0438\u043c\u0435\u043d\u043d\u043e Scriptable Objects! \u0412\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u0438\u043c\u0438 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0447\u0438\u0441\u0442\u043e\u0433\u043e \u0438 \u0430\u043a\u043a\u0443\u0440\u0430\u0442\u043d\u043e \u0440\u0430\u0437\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u0433\u043e \u043d\u0430 \u0447\u0430\u0441\u0442\u0438 \u043a\u043e\u0434\u0430.<\/p>\n<p>  \u0412 \u044d\u0442\u043e\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0435 \u0432\u044b \u0443\u0437\u043d\u0430\u0435\u0442\u0435, \u043a\u0430\u043a \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c Game Events \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043b\u0430\u0441\u0441\u0430 <a href=\"https:\/\/docs.unity3d.com\/ScriptReference\/Events.UnityEvent.html\">UnityEvent<\/a>.<\/p>\n<h3>Game Events \u0438 Listeners<\/h3>\n<p>  \u0412 \u043f\u0430\u043f\u043a\u0435 Scripts \u0441\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u0434\u0432\u0430 \u0441\u043a\u0440\u0438\u043f\u0442\u0430: <em>GameEvent.cs<\/em> \u0438 <em>GameEventListener.cs<\/em>. \u041e\u043d\u0438 \u0437\u0430\u0432\u0438\u0441\u044f\u0442 \u0434\u0440\u0443\u0433 \u043e\u0442 \u0434\u0440\u0443\u0433\u0430, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0447\u0442\u043e\u0431\u044b \u0438\u0437\u0431\u0430\u0432\u0438\u0442\u044c\u0441\u044f \u043e\u0442 \u043e\u0448\u0438\u0431\u043e\u043a, \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043e\u0431\u0430.<\/p>\n<pre><code class=\"cs\">using System.Collections.Generic; using UnityEngine;  [CreateAssetMenu(fileName = \"New Game Event\", menuName = \"Game Event\", order = 52)] \/\/ 1 public class GameEvent : ScriptableObject \/\/ 2 {     private List&lt;GameEventListener&gt; listeners = new List&lt;GameEventListener&gt;(); \/\/ 3      public void Raise() \/\/ 4     {         for (int i = listeners.Count - 1; i &gt;= 0; i--) \/\/ 5         {             listeners[i].OnEventRaised(); \/\/ 6         }     }      public void RegisterListener(GameEventListener listener) \/\/ 7     {         listeners.Add(listener);     }      public void UnregisterListener(GameEventListener listener) \/\/ 8     {         listeners.Remove(listener);     } }<\/code><\/pre>\n<p>  \u0412\u043e\u0442 \u0447\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442 \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u043d\u043d\u044b\u0439 \u0432\u044b\u0448\u0435 \u043a\u043e\u0434:<\/p>\n<ol>\n<li>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 GameEvent \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0430\u0441\u0441\u0435\u0442\u0430 \u0432 Asset Menu.<\/li>\n<li>GameEvent \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f Scriptable Object, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0434\u043e\u043b\u0436\u0435\u043d \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043e\u0442 ScriptableObject.<\/li>\n<li>\u0421\u043f\u0438\u0441\u043e\u043a GameEventListeners, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u043f\u043e\u0434\u043f\u0438\u0441\u0430\u043d\u044b \u043d\u0430 GameEvent.<\/li>\n<li>\u041c\u0435\u0442\u043e\u0434 \u0434\u043b\u044f \u0432\u044b\u0437\u043e\u0432\u0430 \u0432\u0441\u0435\u0445 \u043f\u043e\u0434\u043f\u0438\u0441\u0447\u0438\u043a\u043e\u0432 GameEvent.<\/li>\n<li>\u041f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u043f\u043e\u0434\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0439 GameEventListener \u0431\u0443\u0434\u0435\u0442 \u043f\u0435\u0440\u0432\u044b\u043c \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u043c (\u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u043c \u043f\u0440\u0438\u0448\u0451\u043b, \u043f\u0435\u0440\u0432\u044b\u043c \u0432\u044b\u0448\u0435\u043b).<\/li>\n<li>\u0412\u044b\u0437\u043e\u0432 \u043a\u0430\u0436\u0434\u043e\u0433\u043e UnityEvent GameEventListeners.<\/li>\n<li>\u041c\u0435\u0442\u043e\u0434, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0439 GameEventListeners \u043f\u043e\u0434\u043f\u0438\u0441\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u044d\u0442\u043e\u0442 GameEvent.<\/li>\n<li>\u041c\u0435\u0442\u043e\u0434, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0439 GameEventListeners \u043e\u0442\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u043e\u0442 \u044d\u0442\u043e\u0433\u043e GameEvent.<\/li>\n<\/ol>\n<pre><code class=\"cs\">using UnityEngine; using UnityEngine.Events; \/\/ 1  public class GameEventListener : MonoBehaviour {     [SerializeField]     private GameEvent gameEvent; \/\/ 2     [SerializeField]     private UnityEvent response; \/\/ 3      private void OnEnable() \/\/ 4     {         gameEvent.RegisterListener(this);     }      private void OnDisable() \/\/ 5     {         gameEvent.UnregisterListener(this);     }      public void OnEventRaised() \/\/ 6     {         response.Invoke();     } }<\/code><\/pre>\n<p>  \u0412 \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u043c \u0432\u044b\u0448\u0435 \u043a\u043e\u0434\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u0435 \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430:<\/p>\n<ol>\n<li>\u0422\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043a\u043b\u0430\u0441\u0441\u0430 UnityEvent.<\/li>\n<li>GameEvent, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0434\u043f\u0438\u0441\u0430\u043d \u044d\u0442\u043e\u0442 GameEventListener.<\/li>\n<li>\u041e\u0442\u043a\u043b\u0438\u043a UnityEvent, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c\u0441\u044f, \u043f\u0440\u0438 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u0435\u043c GameEvent \u044d\u0442\u043e\u0433\u043e GameEventListener.<\/li>\n<li>\u041f\u0440\u0438\u0432\u044f\u0437\u043a\u0430 GameEvent \u043a GameEventListener, \u043a\u043e\u0433\u0434\u0430 \u044d\u0442\u043e\u0442 GameObject \u0432\u043a\u043b\u044e\u0447\u0435\u043d.<\/li>\n<li>\u041e\u0442\u0432\u044f\u0437\u043a\u0430 GameEvent \u043e\u0442 GameEventListener, \u043a\u043e\u0433\u0434\u0430 \u044d\u0442\u043e\u0442 GameObject \u043e\u0442\u043a\u043b\u044e\u0447\u0435\u043d.<\/li>\n<li>\u0412\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 GameEvent, \u043f\u0440\u0438\u0432\u043e\u0434\u044f\u0449\u0435\u0439 \u043a \u0432\u044b\u0437\u043e\u0432\u0443 \u0441\u043b\u0443\u0448\u0430\u0442\u0435\u043b\u0435\u043c GameEventListener \u0441\u043e\u0431\u044b\u0442\u0438\u044f UnityEvent.<\/li>\n<\/ol>\n<p>  \u0421\u043b\u043e\u0436\u043d\u043e? \u041d\u0438\u0447\u0435\u0433\u043e, \u0441\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0435\u043c \u0440\u0430\u0437\u0431\u0435\u0440\u0451\u0442\u0435\u0441\u044c!<\/p>\n<h3>\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0430<\/h3>\n<p>  \u0412\u0435\u0440\u043d\u0438\u0442\u0435\u0441\u044c \u0432 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440 Unity \u0438 \u0441\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u043d\u043e\u0432\u0443\u044e \u043f\u0430\u043f\u043a\u0443 <em>Game Events<\/em> \u0432 Scripts &gt;&gt; ScriptableObjects. \u0417\u0430\u0442\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u0441\u0435\u043c\u044c Game Events \u0438\u0437 Asset Menu, \u043a\u0430\u043a \u043c\u044b \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u043b\u0438 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0430\u0441\u0441\u0435\u0442\u0430 Sword Data. \u0420\u0430\u0437\u043c\u0435\u0441\u0442\u0438\u0442\u0435 \u0438\u0445 \u0432 \u043d\u043e\u0432\u043e\u0439 \u043f\u0430\u043f\u043a\u0435 Game Events.<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/055\/47b\/22a\/05547b22a285c4be816e03839eeead05.png\"><\/div>\n<p>  \u0417\u0430\u043c\u0435\u043d\u0438\u0442\u0435 \u043a\u043e\u0434 \u0432\u043d\u0443\u0442\u0440\u0438 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 <em>Sword.cs<\/em> \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c\u0438 \u0441\u0442\u0440\u043e\u043a\u0430\u043c\u0438:<\/p>\n<pre><code class=\"cs\">    [SerializeField]     private GameEvent OnSwordSelected; \/\/ 1      private void OnMouseDown()     {         OnSwordSelected.Raise(); \/\/ 2     }<\/code><\/pre>\n<p>  \u042d\u0442\u043e\u0442 \u043a\u043e\u0434 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u0432 \u043b\u0430\u0432\u043a\u0443 \u0442\u043e\u0440\u0433\u043e\u0432\u0446\u0430 \u043c\u0435\u0447\u0430\u043c\u0438 \u0434\u0432\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438:<\/p>\n<ol>\n<li>\u0413\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044e Game Event \u043f\u0440\u0438 \u0432\u044b\u0431\u043e\u0440\u0435 \u043c\u0435\u0447\u0430.<\/li>\n<li>\u0413\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044e \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u043f\u0440\u0438 \u043d\u0430\u0436\u0430\u0442\u0438\u0438 \u043d\u0430 \u043c\u0435\u0447.<\/li>\n<\/ol>\n<p>  \u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u0435 \u0441\u043a\u0440\u0438\u043f\u0442. \u0422\u0435\u043f\u0435\u0440\u044c \u0432 \u043a\u0430\u0436\u0434\u043e\u043c GameObject \u043c\u0435\u0447\u0430 \u0432 Hierarchy \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u0435 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u0435 OnSwordSelected.<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/9ac\/f02\/acd\/9acf02acd43968a370dd2208793919fe.gif\"><\/div>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0443 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043c\u0435\u0447\u0430 \u0435\u0441\u0442\u044c \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u0441\u043e\u0431\u044b\u0442\u0438\u0435, \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c\u043e\u0435 \u043f\u0440\u0438 \u043d\u0430\u0436\u0430\u0442\u0438\u0438 \u043d\u0430 \u043c\u0435\u0447.<\/p>\n<h2>\u0418\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f \u0441 UI<\/h2>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c UI. \u041d\u0430\u0448\u0430 \u0446\u0435\u043b\u044c \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 Sword Data \u043f\u0440\u0438 \u043d\u0430\u0436\u0430\u0442\u0438\u0438 \u043d\u0430 \u043a\u0430\u0436\u0434\u044b\u0439 \u043c\u0435\u0447.<\/p>\n<h3>\u0421\u0441\u044b\u043b\u043a\u0438 UI<\/h3>\n<p>  \u041f\u0435\u0440\u0435\u0434 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435\u043c UI \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u043a\u0430\u0436\u0434\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 UI. \u041d\u0430\u0447\u043d\u0451\u043c \u0441 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043d\u043e\u0432\u043e\u0433\u043e \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u043f\u043e\u0434 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c <em>SwordMerchant.cs<\/em> \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0432 \u044d\u0442\u043e\u0442 \u043d\u043e\u0432\u044b\u0439 \u0441\u043a\u0440\u0438\u043f\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u043a\u043e\u0434\u0430:<\/p>\n<pre><code class=\"cs\">using UnityEngine; using UnityEngine.UI;  public class SwordMerchant : MonoBehaviour {     [SerializeField]     private Text swordName; \/\/ 1     [SerializeField]     private Text description; \/\/ 2     [SerializeField]     private Image icon; \/\/ 3     [SerializeField]     private Text goldCost; \/\/ 4     [SerializeField]     private Text attackDamage; \/\/ 5 }<\/code><\/pre>\n<p>  \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u044d\u0442\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u043c\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:<\/p>\n<ol>\n<li>\u0421\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 Text \u0438\u0433\u0440\u043e\u0432\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430 <em>NameText<\/em>.<\/li>\n<li>\u0421\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 Text \u0438\u0433\u0440\u043e\u0432\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430 <em>DescriptionText<\/em>.<\/li>\n<li>\u0421\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 Image \u0438\u0433\u0440\u043e\u0432\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430 <em>Sword_Icon<\/em>.<\/li>\n<li>\u0421\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 Text \u0438\u0433\u0440\u043e\u0432\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430 <em>GoldText<\/em>.<\/li>\n<li>\u0421\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 Text \u0438\u0433\u0440\u043e\u0432\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430 <em>AttackText<\/em>.<\/li>\n<\/ol>\n<p>  \u0423\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0435 \u0432\u044b\u0448\u0435 \u0438\u0433\u0440\u043e\u0432\u044b\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u044b \u0432 <em>SwordMerchantCanvas &gt;&gt; SwordMerchantPanel<\/em> \u043e\u043a\u043d\u0430 Hierarchy. \u0414\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0441\u043a\u0440\u0438\u043f\u0442 \u043a GameObject <em>SwordMerchantCanvas<\/em>, \u0430 \u0437\u0430\u0442\u0435\u043c \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u0442\u0435 \u0432\u0441\u0435 \u0441\u0441\u044b\u043b\u043a\u0438:<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/f2b\/a6f\/294\/f2ba6f2948bc57b02efa9a1a925453e8.png\"><\/div>\n<p>  <\/p>\n<h3>\u0421\u043b\u0443\u0448\u0430\u0442\u0435\u043b\u0438 \u0438 \u043e\u0442\u043a\u043b\u0438\u043a\u0438 UI<\/h3>\n<p>  \u0423 \u0432\u0441\u0435\u0445 \u043c\u0435\u0447\u0435\u0439 \u0435\u0441\u0442\u044c \u0441\u043e\u0431\u044b\u0442\u0438\u0435, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0434\u043f\u0438\u0441\u0430\u0442\u044c\u0441\u044f UI \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u043a\u0440\u0438\u043f\u0442\u0430 <em>GameEventListener<\/em>. \u0414\u043e\u0431\u0430\u0432\u044c\u0442\u0435 <em>GameEventListener<\/em> \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0441\u043e\u0431\u044b\u0442\u0438\u044f OnSwordSelected \u043a GameObject <em>SwordMerchantCanvas<\/em>:<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/51c\/3ea\/618\/51c3ea618cb29226356febe1ff1aa8c1.gif\"><\/div>\n<p>  \u041a\u0430\u043a \u0432\u044b \u043c\u043e\u0433\u043b\u0438 \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0443 \u043d\u0430\u0448\u0435\u0433\u043e Game Event Listener \u0435\u0441\u0442\u044c \u0434\u0432\u0430 \u043f\u043e\u043b\u044f: \u0441\u043e\u0431\u044b\u0442\u0438\u0435 Game Event, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043e\u043d \u0441\u043b\u0443\u0448\u0430\u0435\u0442, \u0438 \u043e\u0442\u043a\u043b\u0438\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 Game Event.<\/p>\n<p>  \u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u0442\u043a\u043b\u0438\u043a \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c UI. \u0414\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0432 \u0441\u043a\u0440\u0438\u043f\u0442 <em>SwordMerchant.cs<\/em> \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043c\u0435\u0442\u043e\u0434:<\/p>\n<pre><code class=\"cs\">    public void UpdateDisplayUI(SwordData swordData)     {         swordName.text = swordData.SwordName;         description.text = swordData.Description;         icon.sprite = swordData.Icon;         goldCost.text = swordData.GoldCost.ToString();         attackDamage.text = swordData.AttackDamage.ToString();     }<\/code><\/pre>\n<p>  \u042d\u0442\u043e\u0442 \u043c\u0435\u0442\u043e\u0434 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0430\u0441\u0441\u0435\u0442 Sword Data, \u0430 \u0437\u0430\u0442\u0435\u043c \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u0442 \u043a\u0430\u0436\u0434\u043e\u0435 \u043f\u043e\u043b\u0435 UI \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0433\u043e \u043f\u043e\u043b\u044f Sword Data. \u0417\u0430\u043c\u0435\u0442\u044c\u0442\u0435, \u0447\u0442\u043e <em>GoldCost<\/em> \u0438 <em>AttackDamage<\/em> \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0442 <code>int<\/code>, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0434\u043b\u044f \u0442\u0435\u043a\u0441\u0442\u0430 \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u0432 string.<\/p>\n<p>  \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043d\u0430\u0448\u0435\u0433\u043e \u043d\u043e\u0432\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043e\u0442\u043a\u043b\u0438\u043a \u043a \u043a\u0430\u0436\u0434\u043e\u043c\u0443 <em>GameEventListener<\/em>.<\/p>\n<p>  \u0414\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c\u043e\u0433\u043e \u043e\u0442\u043a\u043b\u0438\u043a\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u043e\u043b\u044f <em>None (Object)<\/em> \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u043d\u0430\u0448 \u0438\u0433\u0440\u043e\u0432\u043e\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 <em>SwordMerchantCanvas<\/em>. \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u0432\u044b\u0431\u0435\u0440\u0435\u043c <em>SwordMerchant.UpdateDisplayUI<\/em> \u0438\u0437 \u0440\u0430\u0441\u043a\u0440\u044b\u0432\u0430\u044e\u0449\u0435\u0433\u043e\u0441\u044f \u043c\u0435\u043d\u044e \u0441\u043f\u0440\u0430\u0432\u0430 \u043e\u0442 \u0440\u0430\u0441\u043a\u0440\u044b\u0432\u0430\u044e\u0449\u0435\u0433\u043e\u0441\u044f \u0441\u043f\u0438\u0441\u043a\u0430 <em>Runtime Only<\/em>.<\/p>\n<p>  \u0411\u0443\u0434\u044c\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u044b \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u0430\u0441\u0441\u0435\u0442 Sword Data \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0441\u043e\u0431\u044b\u0442\u0438\u044f <em>OnSwordSelected<\/em>.<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/d4d\/ce8\/e05\/d4dce8e052a2440f4495a94dec1fc47d.png\"><\/div>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0438\u0433\u0440\u0443, \u043d\u0430\u0436\u0430\u0442\u044c \u043d\u0430 \u043c\u0435\u0447 \u0438 \u0443\u0432\u0438\u0434\u0435\u0442\u044c, \u0447\u0442\u043e UI \u043e\u0431\u043d\u043e\u0432\u0438\u043b\u0441\u044f \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c!<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/ddb\/365\/357\/ddb365357b74dc1e5d86d337d90c8398.gif\"><\/div>\n<p>  \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c Game Events, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e <em>SwordMerchantCanvas<\/em>, \u0438 \u0432\u0441\u0451 \u043f\u043e-\u043f\u0440\u0435\u0436\u043d\u0435\u043c\u0443 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c, \u0442\u043e\u043b\u044c\u043a\u043e \u0431\u0435\u0437 UI. \u042d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442, \u0447\u0442\u043e \u043f\u0440\u0435\u0444\u0430\u0431\u044b \u043c\u0435\u0447\u0435\u0439 \u043e\u0442\u0434\u0435\u043b\u0435\u043d\u044b \u043e\u0442 <em>SwordMerchantCanvas<\/em>.<\/p>\n<h2>\u041a\u0443\u0434\u0430 \u0434\u0432\u0438\u0433\u0430\u0442\u044c\u0441\u044f \u0434\u0430\u043b\u044c\u0448\u0435?<\/h2>\n<p>  \u0415\u0441\u043b\u0438 \u0432\u044b \u0447\u0442\u043e-\u0442\u043e \u0443\u043f\u0443\u0441\u0442\u0438\u043b\u0438 \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430, \u0442\u043e \u043c\u043e\u0436\u0435\u0442\u0435 <a href=\"https:\/\/koenig-media.raywenderlich.com\/uploads\/2018\/03\/ScriptableObjects.zip\">\u0441\u043a\u0430\u0447\u0430\u0442\u044c \u0433\u043e\u0442\u043e\u0432\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442<\/a>, \u043d\u0430\u0445\u043e\u0434\u044f\u0449\u0438\u0439\u0441\u044f \u0432 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u0430\u0445 \u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b\u0430.<\/p>\n<p>  \u0415\u0441\u043b\u0438 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0434\u0432\u0438\u0433\u0430\u0442\u044c\u0441\u044f \u0434\u0430\u043b\u044c\u0448\u0435, \u0442\u043e \u043f\u043e\u043f\u044b\u0442\u0430\u0439\u0442\u0435\u0441\u044c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u043a\u0430\u0436\u0434\u044b\u0439 \u043c\u0435\u0447 \u0432\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u043b \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0437\u0432\u0443\u043a. \u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u0440\u0430\u0441\u0448\u0438\u0440\u0438\u0442\u044c Scriptable Object Sword Data \u0438 \u0441\u043b\u0443\u0448\u0430\u043d\u0438\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u0439 <code>OnSwordSelected<\/code>.<\/p>\n<p>  \u0425\u043e\u0442\u0438\u0442\u0435 \u0431\u043e\u043b\u044c\u0448\u0435 \u0443\u0437\u043d\u0430\u0442\u044c \u043e Unity? \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 \u043d\u0430\u0448\u0443 <a href=\"https:\/\/videos.raywenderlich.com\/courses\/47-beginning-c\/lessons\/1\">\u0441\u0435\u0440\u0438\u044e \u0432\u0438\u0434\u0435\u043e<\/a> \u043f\u043e Unity \u0438\u043b\u0438 \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0439\u0442\u0435 <a href=\"https:\/\/www.raywenderlich.com\/category\/unity\">\u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b\u044b \u043f\u043e Unity<\/a>.<\/div>\n<p>        <script class=\"js-mediator-script\">!function(e){function t(t,n){if(!(n in e)){for(var r,a=e.document,i=a.scripts,o=i.length;o--;)if(-1!==i[o].src.indexOf(t)){r=i[o];break}if(!r){r=a.createElement(\"script\"),r.type=\"text\/javascript\",r.async=!0,r.defer=!0,r.src=t,r.charset=\"UTF-8\";var d=function(){var e=a.getElementsByTagName(\"script\")[0];e.parentNode.insertBefore(r,e)};\"[object Opera]\"==e.opera?a.addEventListener?a.addEventListener(\"DOMContentLoaded\",d,!1):e.attachEvent(\"onload\",d):d()}}}t(\"\/\/mediator.mail.ru\/script\/2820404\/\",\"_mediator\")}(window);<\/script>     <br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/post\/421523\/\"> https:\/\/habr.com\/post\/421523\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div data-io-article-url=\"https:\/\/habr.com\/post\/421523\/\" class=\"post__text post__text-html js-mediator-article\">\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/ddb\/365\/357\/ddb365357b74dc1e5d86d337d90c8398.gif\" alt=\"image\"><\/div>\n<p>  \u0412 \u044d\u0442\u043e\u043c \u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b\u0435 \u0432\u044b \u0443\u0437\u043d\u0430\u0435\u0442\u0435, \u043a\u0430\u043a \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Scriptable Objects \u0432 Unity. Scriptable Objects \u043f\u043e\u043c\u043e\u0433\u0443\u0442 \u0443\u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0432\u0430\u0448 \u0440\u0430\u0431\u043e\u0447\u0438\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441, \u0441\u043d\u0438\u0437\u0438\u0442\u044c \u043e\u0431\u044a\u0451\u043c \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u043c\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438 \u0438 \u0434\u0430\u0436\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0442 \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u044c \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443 \u043a\u043e\u0434\u0430.<\/p>\n<p>  \u0421\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 <a href=\"https:\/\/docs.unity3d.com\/Manual\/class-ScriptableObject.html\">Unity<\/a>, ScriptableObject \u2014 \u044d\u0442\u043e \u043a\u043e\u0434 \u043a\u043b\u0430\u0441\u0441\u0430, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0439 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0432 \u0438\u0433\u0440\u0435 Scriptable Objects \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u043e\u0431\u044a\u0451\u043c\u043e\u0432 \u043e\u0431\u0449\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445, \u043d\u0435 \u0437\u0430\u0432\u0438\u0441\u044f\u0449\u0438\u0445 \u043e\u0442 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u043e\u0432 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432.<\/p>\n<p>  \u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043f\u0440\u0438\u0447\u0438\u043d \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f Scriptable Objects \u0432 Unity. \u041e\u043d\u0438 \u043c\u043e\u0433\u0443\u0442 \u0441\u043d\u0438\u0437\u0438\u0442\u044c \u043e\u0431\u044a\u0451\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u043e\u0439 \u043f\u043e\u0434 \u043a\u0430\u0436\u0434\u044b\u0439 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0440\u0435\u0444\u0430\u0431 \u043f\u0430\u043c\u044f\u0442\u0438, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043f\u043e \u0441\u0432\u043e\u0435\u0439 \u0441\u0443\u0442\u0438 Scriptable Object \u0441\u043b\u0435\u0434\u0443\u044e\u0442 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u0443 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 <a href=\"http:\/\/www.gameprogrammingpatterns.com\/flyweight.html\">Flyweight<\/a>.<\/p>\n<p>  \u0415\u0449\u0451 \u043e\u0434\u043d\u043e \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u043e Scriptable Objects, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0431\u0443\u0434\u0435\u0442 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0442\u0435\u043c\u043e\u0439 \u044d\u0442\u043e\u0433\u043e \u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b\u0430, \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0438\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0434\u043b\u044f \u0443\u0434\u043e\u0431\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u0441\u044b\u043b\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445. \u041c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u044d\u0442\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043b\u0430\u0432\u043a\u0438 \u0442\u043e\u0440\u0433\u043e\u0432\u0446\u0430 \u043c\u0435\u0447\u0430\u043c\u0438, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0431\u0443\u0434\u0443\u0442 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c\u0441\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b, \u0446\u0435\u043d\u044b \u0438 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u043c\u0435\u0447\u0435\u0439.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-288786","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/288786","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=288786"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/288786\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=288786"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=288786"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=288786"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}