{"id":342671,"date":"2022-12-15T03:00:22","date_gmt":"2022-12-15T03:00:22","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=342671"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=342671","title":{"rendered":"<span>Unity UI Toolkit: MVVM \u043d\u043d\u0430\u0434\u0430?<\/span>"},"content":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/b81\/66f\/9b1\/b8166f9b11aeb0e07b713cf78241ae58.png\" alt=\"\u0418\u0437\u043e\u0431\u0440\u0430\u0436\u0451\u043d\u044b\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043d\u0430\u0439\u0442\u0438 \u043d\u0430 GitHub \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0432 \u043f\u0430\u043f\u043a\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432\" title=\"\u0418\u0437\u043e\u0431\u0440\u0430\u0436\u0451\u043d\u044b\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043d\u0430\u0439\u0442\u0438 \u043d\u0430 GitHub \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0432 \u043f\u0430\u043f\u043a\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432\" width=\"1300\" height=\"915\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/b81\/66f\/9b1\/b8166f9b11aeb0e07b713cf78241ae58.png\"\/><figcaption>\u0418\u0437\u043e\u0431\u0440\u0430\u0436\u0451\u043d\u044b\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043d\u0430\u0439\u0442\u0438 \u043d\u0430 GitHub \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0432 \u043f\u0430\u043f\u043a\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432<\/figcaption><\/figure>\n<p>\u041d\u0438 \u0434\u043b\u044f \u043a\u043e\u0433\u043e \u043d\u0435 \u0441\u0435\u043a\u0440\u0435\u0442, \u0447\u0442\u043e Unity \u0441\u0435\u0439\u0447\u0430\u0441 \u0430\u043a\u0442\u0438\u0432\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u043d\u0430\u0434 \u043d\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u043e\u0439 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 <a href=\"https:\/\/unity.com\/features\/ui-toolkit\" rel=\"noopener noreferrer nofollow\">UI Toolkit<\/a>. \u042d\u0442\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432 \u0432\u0434\u043e\u0445\u043d\u043e\u0432\u043b\u0451\u043d\u043d\u044b\u0439 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u043c\u0438 \u043f\u043e\u0434\u0445\u043e\u0434\u0430\u043c\u0438 \u0432\u0435\u0431-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438.<\/p>\n<p>\u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u0434\u0432\u0443\u0445 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u0447\u0430\u0441\u0442\u0435\u0439:<\/p>\n<ul>\n<li>\n<p>UXML \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442 \u2013 \u044f\u0437\u044b\u043a \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0438, \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043d\u0430 HTML \u0438 XML, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430.<\/p>\n<\/li>\n<li>\n<p>Unity Style Sheets (USS) \u2013 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0441\u0442\u0438\u043b\u0435\u0439, \u043f\u043e\u0445\u043e\u0436\u0438 \u043d\u0430 \u043a\u0430\u0441\u043a\u0430\u0434\u043d\u044b\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0441\u0442\u0438\u043b\u0435\u0439 CSS, \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u044e\u0442 \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u044b\u0435 \u0441\u0442\u0438\u043b\u0438 \u0438 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043a \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u043c\u0443 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0443.<\/p>\n<\/li>\n<\/ul>\n<p>\u0418 \u0432\u0441\u0451 \u0431\u044b \u0445\u043e\u0440\u043e\u0448\u043e, \u043d\u043e \u043a\u0430\u043a\u043e\u0433\u043e \u0431\u044b\u043b\u043e \u043c\u043e\u0451 \u0443\u0434\u0438\u0432\u043b\u0435\u043d\u0438\u0435, \u0447\u0442\u043e, \u043f\u0440\u043e\u0434\u0435\u043b\u0430\u0432 \u0442\u0430\u043a\u0443\u044e \u0440\u0430\u0431\u043e\u0442\u0443, \u043e\u043d\u0438 \u043d\u0435 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u043b\u0438 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u0430 \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445, \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0435\u0433\u043e \u0432 runtime. \u0424\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e, \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u043d\u0438\u044f \u0435\u0441\u0442\u044c, \u043d\u043e \u043e\u043d \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432 \u0434\u043b\u044f \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0430.<\/p>\n<p>\u0410 \u043c\u043d\u0435 \u0442\u0430\u043a \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0432\u043d\u043e\u0432\u044c \u043f\u0440\u0438\u043a\u043e\u0441\u043d\u0443\u0442\u044c\u0441\u044f \u043a WPF \u0438 MVVM, \u043d\u043e \u0432 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435 Unity, \u0447\u0442\u043e \u0431\u044b\u043b\u043e \u0440\u0435\u0448\u0435\u043d\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c data-binding&#8217;\u0430. \u0412\u0434\u043e\u0445\u043d\u043e\u0432\u043b\u044f\u043b\u0441\u044f \u044f <a href=\"https:\/\/github.com\/CommunityToolkit\/dotnet\" rel=\"noopener noreferrer nofollow\">.NET Community Toolkit<\/a>, \u0442\u0430\u043a \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u0432\u044b \u0443\u0436\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u043b\u0438 \u0441 \u044d\u0442\u0438\u043c \u043d\u0430\u0431\u043e\u0440\u043e\u043c \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432, \u0434\u043b\u044f \u0432\u0430\u0441 \u0432\u0441\u0451 \u0431\u0443\u0434\u0435\u0442 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u0437\u043d\u0430\u043a\u043e\u043c\u043e.<\/p>\n<p>\u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0430\u0441\u044c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c:<\/p>\n<ul>\n<li>\n<p>\u0421\u0432\u044f\u0437\u044b\u0432\u0430\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0435\u0435 \u0432 runtime<\/p>\n<\/li>\n<li>\n<p>\u041f\u0440\u0438\u0432\u044f\u0437\u043a\u0443 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0441\u0432\u043e\u0439\u0441\u0442\u0432 \u0443 \u043e\u0434\u043d\u043e\u0433\u043e UI \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u0445 UI \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432<\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u0430 \u0441 <a href=\"https:\/\/github.com\/Cysharp\/UniTask\" rel=\"noopener noreferrer nofollow\">UniTask<\/a> \u0434\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0445 \u043a\u043e\u043c\u0430\u043d\u0434<\/p>\n<\/li>\n<\/ul>\n<p>\u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043d\u0430\u0431\u043e\u0440 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0445 \u043a\u043b\u0430\u0441\u0441\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0431\u043b\u0435\u0433\u0447\u0430\u044e\u0442 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0448\u0430\u0431\u043b\u043e\u043d\u0430 MVVM.<\/p>\n<p>\u0412 \u044d\u0442\u043e\u0442 \u043d\u0430\u0431\u043e\u0440 \u0432\u0445\u043e\u0434\u044f\u0442:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/github.com\/ChebanovDD\/UnityMvvmToolkit#viewmodel\" rel=\"noopener noreferrer nofollow\">ViewModel<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/github.com\/ChebanovDD\/UnityMvvmToolkit#canvasviewtbindingcontext\" rel=\"noopener noreferrer nofollow\">CanvasView&lt;TBindingContext><\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/github.com\/ChebanovDD\/UnityMvvmToolkit#documentviewtbindingcontext\" rel=\"noopener noreferrer nofollow\">DocumentView&lt;TBindingContext><\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/github.com\/ChebanovDD\/UnityMvvmToolkit#command--commandt\" rel=\"noopener noreferrer nofollow\">Command &amp; Command&lt;T><\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/github.com\/ChebanovDD\/UnityMvvmToolkit#asynccommand--asynccommandt\" rel=\"noopener noreferrer nofollow\">AsyncCommand &amp; AsyncCommand&lt;T><\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/github.com\/ChebanovDD\/UnityMvvmToolkit#asynclazycommand--asynclazycommandt\" rel=\"noopener noreferrer nofollow\">AsyncLazyCommand &amp; AsyncLazyCommand&lt;T><\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/github.com\/ChebanovDD\/UnityMvvmToolkit#propertyvalueconvertertsourcetype-ttargettype\" rel=\"noopener noreferrer nofollow\">PropertyValueConverter&lt;TSourceType, TTargetType><\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/github.com\/ChebanovDD\/UnityMvvmToolkit#parametervalueconverterttargettype\" rel=\"noopener noreferrer nofollow\">ParameterValueConverter&lt;TTargetType><\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/github.com\/ChebanovDD\/UnityMvvmToolkit#command--commandt\" rel=\"noopener noreferrer nofollow\">ICommand &amp; ICommand&lt;T><\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/github.com\/ChebanovDD\/UnityMvvmToolkit#asynccommand--asynccommandt\" rel=\"noopener noreferrer nofollow\">IAsyncCommand &amp; IAsyncCommand&lt;T><\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/github.com\/ChebanovDD\/UnityMvvmToolkit#propertyvalueconvertertsourcetype-ttargettype\" rel=\"noopener noreferrer nofollow\">IPropertyValueConverter&lt;TSourceType, TTargetType><\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/github.com\/ChebanovDD\/UnityMvvmToolkit#parametervalueconverterttargettype\" rel=\"noopener noreferrer nofollow\">IParameterValueConverter&lt;TTargetType><\/a><\/p>\n<\/li>\n<\/ul>\n<p>\u0422\u0430\u043a\u0436\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d \u0431\u0430\u0437\u043e\u0432\u044b\u0439 \u043d\u0430\u0431\u043e\u0440 UI \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/github.com\/ChebanovDD\/UnityMvvmToolkit#bindablelabel\" rel=\"noopener noreferrer nofollow\">BindableLabel<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/github.com\/ChebanovDD\/UnityMvvmToolkit#bindabletextfield\" rel=\"noopener noreferrer nofollow\">BindableTextField<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/github.com\/ChebanovDD\/UnityMvvmToolkit#bindablebutton\" rel=\"noopener noreferrer nofollow\">BindableButton<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/github.com\/ChebanovDD\/UnityMvvmToolkit#bindablelistview\" rel=\"noopener noreferrer nofollow\">BindableListView<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/github.com\/ChebanovDD\/UnityMvvmToolkit#bindablescrollview\" rel=\"noopener noreferrer nofollow\">BindableScrollView<\/a><\/p>\n<\/li>\n<\/ul>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0440\u0430\u0431\u043e\u0442\u0443 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e <code>HelloWorld<\/code>&#8216;\u0430.<\/p>\n<p>\u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u043c <code>UnityMvvmToolkit<\/code> \u0432 \u043f\u0440\u043e\u0435\u043a\u0442:<\/p>\n<ol>\n<li>\n<p>\u041e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 <code>Edit\/Project Settings\/Package Manager<\/code><\/p>\n<\/li>\n<li>\n<p>\u0414\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u043d\u043e\u0432\u044b\u0439\u00a0<code>Scoped Registry<\/code><\/p>\n<\/li>\n<\/ol>\n<pre><code>Name      package.openupm.com URL       https:\/\/package.openupm.com Scope(s)  com.chebanovdd.unitymvvmtoolkit<\/code><\/pre>\n<ol start=\"3\">\n<li>\n<p>\u041e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 <code>Window\/Package Manager<\/code><\/p>\n<\/li>\n<li>\n<p>\u0412\u044b\u0431\u0435\u0440\u0438\u0442\u0435 <code>My Registries<\/code><\/p>\n<\/li>\n<li>\n<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0435 \u043f\u0430\u043a\u0435\u0442 <code>UnityMvvmToolkit<\/code><\/p>\n<\/li>\n<\/ol>\n<p>\u041f\u0435\u0440\u0432\u044b\u043c \u0434\u0435\u043b\u043e\u043c \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043d\u0430\u0448\u0443 ViewModel:<\/p>\n<pre><code class=\"cs\">using UnityMvvmToolkit.Core;  public class MyFirstViewModel : ViewModel {     public string Text { get; } = \"Hello World\"; }<\/code><\/pre>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043d\u0430 \u0441\u0446\u0435\u043d\u0443 <code>UI Document<\/code> \u0432\u044b\u0431\u0440\u0430\u0432 <code>GameObject\/UI Toolkit\/UI Document<\/code>.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/76b\/c38\/d69\/76bc38d6914133625f958a4d2f7f1e87.png\" alt=\"\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 UI \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430 \u043d\u0430 \u0441\u0446\u0435\u043d\u0443\" title=\"\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 UI \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430 \u043d\u0430 \u0441\u0446\u0435\u043d\u0443\" width=\"1440\" height=\"810\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/76b\/c38\/d69\/76bc38d6914133625f958a4d2f7f1e87.png\"\/><figcaption>\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 UI \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430 \u043d\u0430 \u0441\u0446\u0435\u043d\u0443<\/figcaption><\/figure>\n<p>\u0417\u0430\u0442\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0444\u0430\u0439\u043b <code>MyFirstView.uxml<\/code>. \u042d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0448\u0430 View.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/b63\/140\/c4e\/b63140c4e95d97087fe42cb763ca30cd.png\" alt=\"\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 UXML \u0444\u0430\u0439\u043b\u0430\" title=\"\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 UXML \u0444\u0430\u0439\u043b\u0430\" width=\"2100\" height=\"1200\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/b63\/140\/c4e\/b63140c4e95d97087fe42cb763ca30cd.png\"\/><figcaption>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 UXML \u0444\u0430\u0439\u043b\u0430<\/figcaption><\/figure>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e \u043a\u0430\u043a \u0444\u0430\u0439\u043b <code>MyFirstView.uxml<\/code> \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u043d. \u041e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 \u0435\u0433\u043e \u0432 <code>UI Builder<\/code> \u0438 \u0434\u043e\u0431\u0430\u0432\u044c\u0442\u0435 UI \u044d\u043b\u0435\u043c\u0435\u043d\u0442 <code>BindableLabel<\/code>, \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0432 \u0432 \u043f\u043e\u043b\u0435 <code>Binding Text Path<\/code> \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <code>Text<\/code> (\u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043d\u0430\u0448\u0435\u0433\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u0438\u0437 ViewModel).<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/1da\/118\/87e\/1da11887e50c3e08dc000069639412c6.png\" alt=\"UI Builder\" title=\"UI Builder\" width=\"1340\" height=\"849\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/1da\/118\/87e\/1da11887e50c3e08dc000069639412c6.png\"\/><figcaption>UI Builder<\/figcaption><\/figure>\n<p>\u0412\u0441\u0451, \u043d\u0430\u0448\u0430 View \u0433\u043e\u0442\u043e\u0432\u0430. \u0415\u0441\u043b\u0438 \u043e\u0442\u043a\u0440\u044b\u0442\u044c \u0435\u0451 \u0432 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0435 \u043a\u043e\u0434\u0430, \u0442\u043e \u0442\u0430\u043c \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a\u043e\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0435:<\/p>\n<pre><code class=\"xml\">&lt;ui:UXML xmlns:uitk=\"UnityMvvmToolkit.UITK.BindableUIElements\" xmlns:ui=\"UnityEngine.UIElements\">     &lt;uitk:BindableLabel binding-text-path=\"Text\" \/> &lt;\/ui:UXML><\/code><\/pre>\n<p>\u0417\u0430\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u0448\u0430\u0433\u043e\u043c \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043a\u043b\u0430\u0441\u0441\u0430 <code>MyFirstDocumentView<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442 \u043d\u0430\u0448\u0443 ViewModel \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 <code>BindingContext<\/code>&#8216;\u0430 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u0439 View.<\/p>\n<pre><code class=\"cs\">using UnityMvvmToolkit.UITK;  public class MyFirstDocumentView : DocumentView&lt;MyFirstViewModel> { }<\/code><\/pre>\n<p>\u042d\u0442\u043e\u0442 \u043a\u043b\u0430\u0441\u0441 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0432\u0430\u0432\u0438\u0442\u044c \u043a UI Document&#8217;\u0443 \u043d\u0430 \u0441\u0446\u0435\u043d\u0435 \u0438 \u0437\u0430\u0434\u0430\u0442\u044c \u043d\u0430\u0448\u0443 View \u0442\u0430\u043c \u0436\u0435.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/89a\/39f\/221\/89a39f221423cdd40c56bf81d1205a0b.png\" alt=\"\u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 UI \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430 \u043d\u0430 \u0441\u0446\u0435\u043d\u0435\" title=\"\u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 UI \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430 \u043d\u0430 \u0441\u0446\u0435\u043d\u0435\" width=\"604\" height=\"448\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/89a\/39f\/221\/89a39f221423cdd40c56bf81d1205a0b.png\"\/><figcaption>\u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 UI \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430 \u043d\u0430 \u0441\u0446\u0435\u043d\u0435<\/figcaption><\/figure>\n<p>\u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0432 \u043f\u0440\u043e\u0435\u043a\u0442, \u043c\u044b \u0443\u0432\u0438\u0434\u0438\u043c \u043d\u0430\u0448 <code>Hello World<\/code>.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/bca\/292\/58d\/bca29258d349628fac359675bb053e10.png\" alt=\"\u041f\u043e\u043b\u0443\u0447\u0438\u0432\u0448\u0438\u0439\u0441\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\" title=\"\u041f\u043e\u043b\u0443\u0447\u0438\u0432\u0448\u0438\u0439\u0441\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\" width=\"864\" height=\"480\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/bca\/292\/58d\/bca29258d349628fac359675bb053e10.png\"\/><figcaption>\u041f\u043e\u043b\u0443\u0447\u0438\u0432\u0448\u0438\u0439\u0441\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442<\/figcaption><\/figure>\n<p>\u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0430\u0441\u044c \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0433\u0438\u0431\u043a\u043e\u0439 \u0438 \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0435\u043c\u043e\u0439. \u0412 \u0447\u0451\u043c \u043c\u043e\u0436\u043d\u043e \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f, \u0438\u0437\u0443\u0447\u0438\u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 <code>Counter<\/code> \u0438\u0437 \u043f\u0430\u043f\u043a\u0438 <a href=\"https:\/\/github.com\/ChebanovDD\/UnityMvvmToolkit\/tree\/main\/samples\" rel=\"noopener noreferrer nofollow\">\u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432<\/a>, \u0433\u0434\u0435 \u0432 UI \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430.<\/p>\n<p>\u0412\u043e\u0442 \u0442\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 CounterView:<\/p>\n<pre><code class=\"xml\">&lt;UXML>     &lt;BindableContentPage binding-theme-mode-path=\"ThemeMode\" class=\"counter-screen\">         &lt;VisualElement class=\"number-container\">             &lt;BindableCountLabel binding-text-path=\"Count\" class=\"count-label count-label--animation\" \/>         &lt;\/VisualElement>         &lt;BindableThemeSwitcher binding-value-path=\"ThemeMode, Converter={ThemeModeToBoolConverter}\" \/>         &lt;BindableCounterSlider increment-command=\"IncrementCommand\" decrement-command=\"DecrementCommand\" \/>     &lt;\/BindableContentPage> &lt;\/UXML><\/code><\/pre>\n<p>\u0410 \u0442\u0430\u043a CounterViewModel:<\/p>\n<pre><code class=\"cs\">public class CounterViewModel : ViewModel {     private int _count;     private ThemeMode _themeMode;      public CounterViewModel()     {         IncrementCommand = new Command(IncrementCount);         DecrementCommand = new Command(DecrementCount);     }      public int Count     {         get => _count;         set => Set(ref _count, value);     }      public ThemeMode ThemeMode     {         get => _themeMode;         set => Set(ref _themeMode, value);     }      public ICommand IncrementCommand { get; }     public ICommand DecrementCommand { get; }      private void IncrementCount() => Count++;     private void DecrementCount() => Count--; }<\/code><\/pre>\n<p>\u0412 \u0437\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438. \u041f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c <code>UnityMvvmToolkit<\/code> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 reflection, \u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0441\u0432\u043e\u0439\u0441\u0442\u0432 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u0430 \u0447\u0435\u0440\u0435\u0437 \u0434\u0435\u043b\u0435\u0433\u0430\u0442\u044b.<\/p>\n<pre><code class=\"cs\">public static class PropertyInfoExtensions {     public static Func&lt;TObjectType, TValueType> CreateGetValueDelegate&lt;TObjectType, TValueType>(         this PropertyInfo propertyInfo)     {         return (Func&lt;TObjectType, TValueType>) Delegate.CreateDelegate(typeof(Func&lt;TObjectType, TValueType>),             propertyInfo.GetMethod);     }      public static Action&lt;TObjectType, TValueType> CreateSetValueDelegate&lt;TObjectType, TValueType>(         this PropertyInfo propertyInfo)     {         return (Action&lt;TObjectType, TValueType>) Delegate.CreateDelegate(typeof(Action&lt;TObjectType, TValueType>),             propertyInfo.SetMethod);     } }<\/code><\/pre>\n<p>\u042d\u0442\u043e\u0442 \u043f\u043e\u0434\u0445\u043e\u0434 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u0443\u043f\u0430\u043a\u043e\u0432\u043a\u0438 (boxing) \u0438 \u0440\u0430\u0441\u043f\u0430\u043a\u043e\u0432\u043a\u0438 (unboxing) \u0434\u043b\u044f \u0442\u0438\u043f\u043e\u0432 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439, \u0447\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0443\u043b\u0443\u0447\u0448\u0430\u0435\u0442 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c. \u0412 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438, \u043e\u043d \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0432 65 \u0440\u0430\u0437 \u0431\u044b\u0441\u0442\u0440\u0435\u0435, \u0447\u0435\u043c \u0442\u043e\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b <code>GetValue<\/code> \u0438 <code>SetValue<\/code>, \u0438 \u0432\u043e\u043e\u0431\u0449\u0435 \u043d\u0435 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u044e \u043f\u0430\u043c\u044f\u0442\u0438.<\/p>\n<p>\u0412\u0441\u0435 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438, \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u0438 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u043d\u0430\u00a0<a href=\"https:\/\/github.com\/ChebanovDD\/UnityMvvmToolkit\" rel=\"noopener noreferrer nofollow\">GitHub<\/a>, \u0442\u0430\u043a\u0436\u0435 \u043f\u0430\u043a\u0435\u0442 \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u043d \u043d\u0430 \u043f\u043b\u043e\u0449\u0430\u0434\u043a\u0435\u00a0<a href=\"https:\/\/openupm.com\/packages\/com.chebanovdd.unitymvvmtoolkit\/\" rel=\"noopener noreferrer nofollow\">OpenUPM<\/a>. \u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u0438\u0434\u0435\u0438, \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438\u043b\u0438 \u0436\u0435\u043b\u0430\u043d\u0438\u0435 \u043f\u043e\u0443\u0447\u0430\u0432\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0432 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435, \u0434\u043e\u0431\u0440\u043e \u043f\u043e\u0436\u0430\u043b\u043e\u0432\u0430\u0442\u044c \u0432 <a href=\"https:\/\/github.com\/ChebanovDD\/UnityMvvmToolkit\/discussions\" rel=\"noopener noreferrer nofollow\">\u0434\u0438\u0441\u043a\u0443\u0441\u0441\u0438\u0438<\/a>.<\/p>\n<p>\u0410 \u0447\u0442\u043e \u0432\u044b \u0434\u0443\u043c\u0430\u0435\u0442\u0435 \u043e \u0442\u0430\u043a\u043e\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0445 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432 \u0432 Unity?<\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p> <!----> <!----><\/div>\n<p> <!----> <!----><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\/ru\/post\/689134\/\"> https:\/\/habr.com\/ru\/post\/689134\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><figcaption>\u0418\u0437\u043e\u0431\u0440\u0430\u0436\u0451\u043d\u044b\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043d\u0430\u0439\u0442\u0438 \u043d\u0430 GitHub \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0432 \u043f\u0430\u043f\u043a\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432<\/figcaption><\/figure>\n<p>\u041d\u0438 \u0434\u043b\u044f \u043a\u043e\u0433\u043e \u043d\u0435 \u0441\u0435\u043a\u0440\u0435\u0442, \u0447\u0442\u043e Unity \u0441\u0435\u0439\u0447\u0430\u0441 \u0430\u043a\u0442\u0438\u0432\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u043d\u0430\u0434 \u043d\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u043e\u0439 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 <a href=\"https:\/\/unity.com\/features\/ui-toolkit\" rel=\"noopener noreferrer nofollow\">UI Toolkit<\/a>. \u042d\u0442\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432 \u0432\u0434\u043e\u0445\u043d\u043e\u0432\u043b\u0451\u043d\u043d\u044b\u0439 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u043c\u0438 \u043f\u043e\u0434\u0445\u043e\u0434\u0430\u043c\u0438 \u0432\u0435\u0431-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438.<\/p>\n<p>\u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u0434\u0432\u0443\u0445 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u0447\u0430\u0441\u0442\u0435\u0439:<\/p>\n<ul>\n<li>\n<p>UXML \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442 \u2013 \u044f\u0437\u044b\u043a \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0438, \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043d\u0430 HTML \u0438 XML, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430.<\/p>\n<\/li>\n<li>\n<p>Unity Style Sheets (USS) \u2013 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0441\u0442\u0438\u043b\u0435\u0439, \u043f\u043e\u0445\u043e\u0436\u0438 \u043d\u0430 \u043a\u0430\u0441\u043a\u0430\u0434\u043d\u044b\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0441\u0442\u0438\u043b\u0435\u0439 CSS, \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u044e\u0442 \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u044b\u0435 \u0441\u0442\u0438\u043b\u0438 \u0438 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043a \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u043c\u0443 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0443.<\/p>\n<\/li>\n<\/ul>\n<p>\u0418 \u0432\u0441\u0451 \u0431\u044b \u0445\u043e\u0440\u043e\u0448\u043e, \u043d\u043e \u043a\u0430\u043a\u043e\u0433\u043e \u0431\u044b\u043b\u043e \u043c\u043e\u0451 \u0443\u0434\u0438\u0432\u043b\u0435\u043d\u0438\u0435, \u0447\u0442\u043e, \u043f\u0440\u043e\u0434\u0435\u043b\u0430\u0432 \u0442\u0430\u043a\u0443\u044e \u0440\u0430\u0431\u043e\u0442\u0443, \u043e\u043d\u0438 \u043d\u0435 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u043b\u0438 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u0430 \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445, \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0435\u0433\u043e \u0432 runtime. \u0424\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e, \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u043d\u0438\u044f \u0435\u0441\u0442\u044c, \u043d\u043e \u043e\u043d \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432 \u0434\u043b\u044f \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0430.<\/p>\n<p>\u0410 \u043c\u043d\u0435 \u0442\u0430\u043a \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0432\u043d\u043e\u0432\u044c \u043f\u0440\u0438\u043a\u043e\u0441\u043d\u0443\u0442\u044c\u0441\u044f \u043a WPF \u0438 MVVM, \u043d\u043e \u0432 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435 Unity, \u0447\u0442\u043e \u0431\u044b\u043b\u043e \u0440\u0435\u0448\u0435\u043d\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c data-binding&#8217;\u0430. \u0412\u0434\u043e\u0445\u043d\u043e\u0432\u043b\u044f\u043b\u0441\u044f \u044f <a href=\"https:\/\/github.com\/CommunityToolkit\/dotnet\" rel=\"noopener noreferrer nofollow\">.NET Community Toolkit<\/a>, \u0442\u0430\u043a \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u0432\u044b \u0443\u0436\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u043b\u0438 \u0441 \u044d\u0442\u0438\u043c \u043d\u0430\u0431\u043e\u0440\u043e\u043c \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432, \u0434\u043b\u044f \u0432\u0430\u0441 \u0432\u0441\u0451 \u0431\u0443\u0434\u0435\u0442 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u0437\u043d\u0430\u043a\u043e\u043c\u043e.<\/p>\n<p>\u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0430\u0441\u044c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c:<\/p>\n<ul>\n<li>\n<p>\u0421\u0432\u044f\u0437\u044b\u0432\u0430\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0435\u0435 \u0432 runtime<\/p>\n<\/li>\n<li>\n<p>\u041f\u0440\u0438\u0432\u044f\u0437\u043a\u0443 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0441\u0432\u043e\u0439\u0441\u0442\u0432 \u0443 \u043e\u0434\u043d\u043e\u0433\u043e UI \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u0445 UI \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432<\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u0430 \u0441 <a href=\"https:\/\/github.com\/Cysharp\/UniTask\" rel=\"noopener noreferrer nofollow\">UniTask<\/a> \u0434\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0445 \u043a\u043e\u043c\u0430\u043d\u0434<\/p>\n<\/li>\n<\/ul>\n<p>\u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043d\u0430\u0431\u043e\u0440 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0445 \u043a\u043b\u0430\u0441\u0441\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0431\u043b\u0435\u0433\u0447\u0430\u044e\u0442 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0448\u0430\u0431\u043b\u043e\u043d\u0430 MVVM.<\/p>\n<p>\u0412 \u044d\u0442\u043e\u0442 \u043d\u0430\u0431\u043e\u0440 \u0432\u0445\u043e\u0434\u044f\u0442:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/github.com\/ChebanovDD\/UnityMvvmToolkit#viewmodel\" rel=\"noopener noreferrer nofollow\">ViewModel<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/github.com\/ChebanovDD\/UnityMvvmToolkit#canvasviewtbindingcontext\" rel=\"noopener noreferrer nofollow\">CanvasView&lt;TBindingContext><\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/github.com\/ChebanovDD\/UnityMvvmToolkit#documentviewtbindingcontext\" rel=\"noopener noreferrer nofollow\">DocumentView&lt;TBindingContext><\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/github.com\/ChebanovDD\/UnityMvvmToolkit#command--commandt\" rel=\"noopener noreferrer nofollow\">Command &amp; Command&lt;T><\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/github.com\/ChebanovDD\/UnityMvvmToolkit#asynccommand--asynccommandt\" rel=\"noopener noreferrer nofollow\">AsyncCommand &amp; AsyncCommand&lt;T><\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/github.com\/ChebanovDD\/UnityMvvmToolkit#asynclazycommand--asynclazycommandt\" rel=\"noopener noreferrer nofollow\">AsyncLazyCommand &amp; AsyncLazyCommand&lt;T><\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/github.com\/ChebanovDD\/UnityMvvmToolkit#propertyvalueconvertertsourcetype-ttargettype\" rel=\"noopener noreferrer nofollow\">PropertyValueConverter&lt;TSourceType, TTargetType><\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/github.com\/ChebanovDD\/UnityMvvmToolkit#parametervalueconverterttargettype\" rel=\"noopener noreferrer nofollow\">ParameterValueConverter&lt;TTargetType><\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/github.com\/ChebanovDD\/UnityMvvmToolkit#command--commandt\" rel=\"noopener noreferrer nofollow\">ICommand &amp; ICommand&lt;T><\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/github.com\/ChebanovDD\/UnityMvvmToolkit#asynccommand--asynccommandt\" rel=\"noopener noreferrer nofollow\">IAsyncCommand &amp; IAsyncCommand&lt;T><\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/github.com\/ChebanovDD\/UnityMvvmToolkit#propertyvalueconvertertsourcetype-ttargettype\" rel=\"noopener noreferrer nofollow\">IPropertyValueConverter&lt;TSourceType, TTargetType><\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/github.com\/ChebanovDD\/UnityMvvmToolkit#parametervalueconverterttargettype\" rel=\"noopener noreferrer nofollow\">IParameterValueConverter&lt;TTargetType><\/a><\/p>\n<\/li>\n<\/ul>\n<p>\u0422\u0430\u043a\u0436\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d \u0431\u0430\u0437\u043e\u0432\u044b\u0439 \u043d\u0430\u0431\u043e\u0440 UI \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/github.com\/ChebanovDD\/UnityMvvmToolkit#bindablelabel\" rel=\"noopener noreferrer nofollow\">BindableLabel<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/github.com\/ChebanovDD\/UnityMvvmToolkit#bindabletextfield\" rel=\"noopener noreferrer nofollow\">BindableTextField<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/github.com\/ChebanovDD\/UnityMvvmToolkit#bindablebutton\" rel=\"noopener noreferrer nofollow\">BindableButton<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/github.com\/ChebanovDD\/UnityMvvmToolkit#bindablelistview\" rel=\"noopener noreferrer nofollow\">BindableListView<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/github.com\/ChebanovDD\/UnityMvvmToolkit#bindablescrollview\" rel=\"noopener noreferrer nofollow\">BindableScrollView<\/a><\/p>\n<\/li>\n<\/ul>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0440\u0430\u0431\u043e\u0442\u0443 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e <code>HelloWorld<\/code>&#8216;\u0430.<\/p>\n<p>\u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u043c <code>UnityMvvmToolkit<\/code> \u0432 \u043f\u0440\u043e\u0435\u043a\u0442:<\/p>\n<ol>\n<li>\n<p>\u041e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 <code>Edit\/Project Settings\/Package Manager<\/code><\/p>\n<\/li>\n<li>\n<p>\u0414\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u043d\u043e\u0432\u044b\u0439\u00a0<code>Scoped Registry<\/code><\/p>\n<\/li>\n<\/ol>\n<pre><code>Name      package.openupm.com URL       https:\/\/package.openupm.com Scope(s)  com.chebanovdd.unitymvvmtoolkit<\/code><\/pre>\n<ol start=\"3\">\n<li>\n<p>\u041e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 <code>Window\/Package Manager<\/code><\/p>\n<\/li>\n<li>\n<p>\u0412\u044b\u0431\u0435\u0440\u0438\u0442\u0435 <code>My Registries<\/code><\/p>\n<\/li>\n<li>\n<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0435 \u043f\u0430\u043a\u0435\u0442 <code>UnityMvvmToolkit<\/code><\/p>\n<\/li>\n<\/ol>\n<p>\u041f\u0435\u0440\u0432\u044b\u043c \u0434\u0435\u043b\u043e\u043c \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043d\u0430\u0448\u0443 ViewModel:<\/p>\n<pre><code class=\"cs\">using UnityMvvmToolkit.Core;  public class MyFirstViewModel : ViewModel {     public string Text { get; } = \"Hello World\"; }<\/code><\/pre>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043d\u0430 \u0441\u0446\u0435\u043d\u0443 <code>UI Document<\/code> \u0432\u044b\u0431\u0440\u0430\u0432 <code>GameObject\/UI Toolkit\/UI Document<\/code>.<\/p>\n<figure class=\"full-width\"><figcaption>\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 UI \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430 \u043d\u0430 \u0441\u0446\u0435\u043d\u0443<\/figcaption><\/figure>\n<p>\u0417\u0430\u0442\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0444\u0430\u0439\u043b <code>MyFirstView.uxml<\/code>. \u042d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0448\u0430 View.<\/p>\n<figure class=\"full-width\"><figcaption>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 UXML \u0444\u0430\u0439\u043b\u0430<\/figcaption><\/figure>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e \u043a\u0430\u043a \u0444\u0430\u0439\u043b <code>MyFirstView.uxml<\/code> \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u043d. \u041e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 \u0435\u0433\u043e \u0432 <code>UI Builder<\/code> \u0438 \u0434\u043e\u0431\u0430\u0432\u044c\u0442\u0435 UI \u044d\u043b\u0435\u043c\u0435\u043d\u0442 <code>BindableLabel<\/code>, \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0432 \u0432 \u043f\u043e\u043b\u0435 <code>Binding Text Path<\/code> \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <code>Text<\/code> (\u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043d\u0430\u0448\u0435\u0433\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u0438\u0437 ViewModel).<\/p>\n<figure class=\"full-width\"><figcaption>UI Builder<\/figcaption><\/figure>\n<p>\u0412\u0441\u0451, \u043d\u0430\u0448\u0430 View \u0433\u043e\u0442\u043e\u0432\u0430. \u0415\u0441\u043b\u0438 \u043e\u0442\u043a\u0440\u044b\u0442\u044c \u0435\u0451 \u0432 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0435 \u043a\u043e\u0434\u0430, \u0442\u043e \u0442\u0430\u043c \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a\u043e\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0435:<\/p>\n<pre><code class=\"xml\">&lt;ui:UXML xmlns:uitk=\"UnityMvvmToolkit.UITK.BindableUIElements\" xmlns:ui=\"UnityEngine.UIElements\">     &lt;uitk:BindableLabel binding-text-path=\"Text\" \/> &lt;\/ui:UXML><\/code><\/pre>\n<p>\u0417\u0430\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u0448\u0430\u0433\u043e\u043c \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043a\u043b\u0430\u0441\u0441\u0430 <code>MyFirstDocumentView<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442 \u043d\u0430\u0448\u0443 ViewModel \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 <code>BindingContext<\/code>&#8216;\u0430 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u0439 View.<\/p>\n<pre><code class=\"cs\">using UnityMvvmToolkit.UITK;  public class MyFirstDocumentView : DocumentView&lt;MyFirstViewModel> { }<\/code><\/pre>\n<p>\u042d\u0442\u043e\u0442 \u043a\u043b\u0430\u0441\u0441 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0432\u0430\u0432\u0438\u0442\u044c \u043a UI Document&#8217;\u0443 \u043d\u0430 \u0441\u0446\u0435\u043d\u0435 \u0438 \u0437\u0430\u0434\u0430\u0442\u044c \u043d\u0430\u0448\u0443 View \u0442\u0430\u043c \u0436\u0435.<\/p>\n<figure class=\"full-width\"><figcaption>\u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 UI \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430 \u043d\u0430 \u0441\u0446\u0435\u043d\u0435<\/figcaption><\/figure>\n<p>\u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0432 \u043f\u0440\u043e\u0435\u043a\u0442, \u043c\u044b \u0443\u0432\u0438\u0434\u0438\u043c \u043d\u0430\u0448 <code>Hello World<\/code>.<\/p>\n<figure class=\"full-width\"><figcaption>\u041f\u043e\u043b\u0443\u0447\u0438\u0432\u0448\u0438\u0439\u0441\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442<\/figcaption><\/figure>\n<p>\u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0430\u0441\u044c \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0433\u0438\u0431\u043a\u043e\u0439 \u0438 \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0435\u043c\u043e\u0439. \u0412 \u0447\u0451\u043c \u043c\u043e\u0436\u043d\u043e \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f, \u0438\u0437\u0443\u0447\u0438\u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 <code>Counter<\/code> \u0438\u0437 \u043f\u0430\u043f\u043a\u0438 <a href=\"https:\/\/github.com\/ChebanovDD\/UnityMvvmToolkit\/tree\/main\/samples\" rel=\"noopener noreferrer nofollow\">\u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432<\/a>, \u0433\u0434\u0435 \u0432 UI \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430.<\/p>\n<p>\u0412\u043e\u0442 \u0442\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 CounterView:<\/p>\n<pre><code class=\"xml\">&lt;UXML>     &lt;BindableContentPage binding-theme-mode-path=\"ThemeMode\" class=\"counter-screen\">         &lt;VisualElement class=\"number-container\">             &lt;BindableCountLabel binding-text-path=\"Count\" class=\"count-label count-label--animation\" \/>         &lt;\/VisualElement>         &lt;BindableThemeSwitcher binding-value-path=\"ThemeMode, Converter={ThemeModeToBoolConverter}\" \/>         &lt;BindableCounterSlider increment-command=\"IncrementCommand\" decrement-command=\"DecrementCommand\" \/>     &lt;\/BindableContentPage> &lt;\/UXML><\/code><\/pre>\n<p>\u0410 \u0442\u0430\u043a CounterViewModel:<\/p>\n<pre><code class=\"cs\">public class CounterViewModel : ViewModel {     private int _count;     private ThemeMode _themeMode;      public CounterViewModel()     {         IncrementCommand = new Command(IncrementCount);         DecrementCommand = new Command(DecrementCount);     }      public int Count     {         get => _count;         set => Set(ref _count, value);     }      public ThemeMode ThemeMode     {         get => _themeMode;         set => Set(ref _themeMode, value);     }      public ICommand IncrementCommand { get; }     public ICommand DecrementCommand { get; }      private void IncrementCount() => Count++;     private void DecrementCount() => Count--; }<\/code><\/pre>\n<p>\u0412 \u0437\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438. \u041f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c <code>UnityMvvmToolkit<\/code> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 reflection, \u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0441\u0432\u043e\u0439\u0441\u0442\u0432 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u0430 \u0447\u0435\u0440\u0435\u0437 \u0434\u0435\u043b\u0435\u0433\u0430\u0442\u044b.<\/p>\n<pre><code class=\"cs\">public static class PropertyInfoExtensions {     public static Func&lt;TObjectType, TValueType> CreateGetValueDelegate&lt;TObjectType, TValueType>(         this PropertyInfo propertyInfo)     {         return (Func&lt;TObjectType, TValueType>) Delegate.CreateDelegate(typeof(Func&lt;TObjectType, TValueType>),             propertyInfo.GetMethod);     }      public static Action&lt;TObjectType, TValueType> CreateSetValueDelegate&lt;TObjectType, TValueType>(         this PropertyInfo propertyInfo)     {         return (Action&lt;TObjectType, TValueType>) Delegate.CreateDelegate(typeof(Action&lt;TObjectType, TValueType>),             propertyInfo.SetMethod);     } }<\/code><\/pre>\n<p>\u042d\u0442\u043e\u0442 \u043f\u043e\u0434\u0445\u043e\u0434 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u0443\u043f\u0430\u043a\u043e\u0432\u043a\u0438 (boxing) \u0438 \u0440\u0430\u0441\u043f\u0430\u043a\u043e\u0432\u043a\u0438 (unboxing) \u0434\u043b\u044f \u0442\u0438\u043f\u043e\u0432 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439, \u0447\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0443\u043b\u0443\u0447\u0448\u0430\u0435\u0442 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c. \u0412 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438, \u043e\u043d \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0432 65 \u0440\u0430\u0437 \u0431\u044b\u0441\u0442\u0440\u0435\u0435, \u0447\u0435\u043c \u0442\u043e\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b <code>GetValue<\/code> \u0438 <code>SetValue<\/code>, \u0438 \u0432\u043e\u043e\u0431\u0449\u0435 \u043d\u0435 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u044e \u043f\u0430\u043c\u044f\u0442\u0438.<\/p>\n<p>\u0412\u0441\u0435 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438, \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u0438 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u043d\u0430\u00a0<a href=\"https:\/\/github.com\/ChebanovDD\/UnityMvvmToolkit\" rel=\"noopener noreferrer nofollow\">GitHub<\/a>, \u0442\u0430\u043a\u0436\u0435 \u043f\u0430\u043a\u0435\u0442 \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u043d \u043d\u0430 \u043f\u043b\u043e\u0449\u0430\u0434\u043a\u0435\u00a0<a href=\"https:\/\/openupm.com\/packages\/com.chebanovdd.unitymvvmtoolkit\/\" rel=\"noopener noreferrer nofollow\">OpenUPM<\/a>. \u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u0438\u0434\u0435\u0438, \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438\u043b\u0438 \u0436\u0435\u043b\u0430\u043d\u0438\u0435 \u043f\u043e\u0443\u0447\u0430\u0432\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0432 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435, \u0434\u043e\u0431\u0440\u043e \u043f\u043e\u0436\u0430\u043b\u043e\u0432\u0430\u0442\u044c \u0432 <a href=\"https:\/\/github.com\/ChebanovDD\/UnityMvvmToolkit\/discussions\" rel=\"noopener noreferrer nofollow\">\u0434\u0438\u0441\u043a\u0443\u0441\u0441\u0438\u0438<\/a>.<\/p>\n<p>\u0410 \u0447\u0442\u043e \u0432\u044b \u0434\u0443\u043c\u0430\u0435\u0442\u0435 \u043e \u0442\u0430\u043a\u043e\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0445 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432 \u0432 Unity?<\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p> <!----> <!----><\/div>\n<p> <!----> <!----><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\/ru\/post\/689134\/\"> https:\/\/habr.com\/ru\/post\/689134\/<\/a><br \/><\/br><\/br><\/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-342671","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/342671","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=342671"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/342671\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=342671"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=342671"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=342671"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}