{"id":333023,"date":"2022-05-12T03:00:11","date_gmt":"2022-05-12T03:00:11","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=333023"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=333023","title":{"rendered":"<span>Unity. \u041b\u0435\u043d\u0438\u0432\u044b\u0439 ECS<\/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<p>ECS &#8212; <strong>Entity-Component-System<\/strong> &#8212; \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0443\u0434\u043e\u0431\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b \u0438\u0433\u0440. \u0412\u044b\u043d\u0435\u0441\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b, \u043f\u043e\u043c\u0435\u0449\u0451\u043d\u043d\u044b\u0435 \u0432 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438 \u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c\u044b\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u043c\u0438, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0435, \u0434\u0430\u0436\u0435 \u0441\u0430\u043c\u043e\u0435 \u0441\u043b\u043e\u0436\u043d\u043e\u0435, \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 &#171;\u0436\u043e\u043d\u0433\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c&#187; \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 \u0432\u043d\u0443\u0442\u0440\u0438 \u043d\u0438\u0445. \u0418\u043c\u0435\u043d\u043d\u043e \u043d\u0430 \u043d\u0435\u0433\u043e \u043f\u0430\u043b \u043d\u0430\u0448 \u0432\u0437\u043e\u0440 \u043f\u0440\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043f\u043e\u0448\u0430\u0433\u043e\u0432\u043e\u0439 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0438 \u043d\u0430 Unity.<\/p>\n<p>\u0414\u043b\u044f \u0442\u0435\u0445, \u043a\u0442\u043e \u043d\u0435 \u043a\u0430\u0441\u0430\u043b\u0441\u044f \u0434\u0430\u043d\u043d\u043e\u0439 \u0442\u0435\u043c\u044b, \u0432\u043a\u0440\u0430\u0442\u0446\u0435 \u043e\u0431\u044a\u044f\u0441\u043d\u044e \u043a\u0430\u043a \u0432\u043e\u043e\u0431\u0449\u0435 \u0443\u0441\u0442\u0440\u043e\u0435\u043d ECS: \u0432\u044b \u0434\u0435\u043b\u0438\u0442\u0435 \u0432\u0435\u0441\u044c \u0432\u0430\u0448 \u043f\u0440\u043e\u0435\u043a\u0442 \u043d\u0430 \u0442\u0440\u0438 \u0430\u0441\u043f\u0435\u043a\u0442\u0430. \u041f\u0435\u0440\u0432\u044b\u0439 &#8212; <strong>\u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438 (Entities)<\/strong> &#8212; \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0430\u0431\u043e\u0440 &#171;\u043f\u0443\u0441\u0442\u044b\u0448\u0435\u043a&#187; (\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432), \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435 \u043e\u0431\u043b\u0430\u0434\u0430\u044e\u0442 \u043d\u0438\u043a\u0430\u043a\u043e\u0439 \u043b\u043e\u0433\u0438\u043a\u043e\u0439. \u041e\u043d\u0438 \u043d\u0443\u0436\u043d\u044b \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f <strong>\u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 (Components) <\/strong>&#8212; \u0432\u0442\u043e\u0440\u043e\u0439 \u0430\u0441\u043f\u0435\u043a\u0442. \u042d\u0442\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u044b, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435, \u043e\u0434\u043d\u0430\u043a\u043e, \u0442\u043e\u0436\u0435 \u043d\u0435 \u0438\u043c\u0435\u044e\u0449\u0438\u0435 \u043a\u0430\u043a\u043e\u0439-\u043b\u0438\u0431\u043e \u043b\u043e\u0433\u0438\u043a\u0438 (\u0440\u0430\u0437\u0432\u0435 \u0447\u0442\u043e \u043a\u0440\u043e\u043c\u0435 \u043f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0435\u0439, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 &#171;HealthComponent&#187; \u043c\u043e\u0436\u0435\u0442 \u0443\u043c\u0435\u0442\u044c \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c \u0442\u0435\u043a\u0443\u0449\u0435\u0435 \u0437\u0434\u043e\u0440\u043e\u0432\u044c\u0435 \u0432 \u043f\u0440\u043e\u0446\u0435\u043d\u0442\u0430\u0445, \u043d\u0435 \u0431\u043e\u043b\u0435\u0435). \u0410 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b <strong>\u0441\u0438\u0441\u0442\u0435\u043c\u0430\u043c\u0438 (Systems)<\/strong>, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044e\u0442 \u0432\u0441\u044e \u043b\u043e\u0433\u0438\u043a\u0443 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0434\u0430\u043d\u043d\u044b\u0445, \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0445 \u0438\u0437 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441\u0438\u0441\u0442\u0435\u043c\u0430 &#171;HealthSystem&#187; \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u0442\u0435\u043a\u0443\u0449\u0435\u0435 \u0437\u0434\u043e\u0440\u043e\u0432\u044c\u0435 \u0443 \u0432\u0441\u0435\u0445 &#171;HealthComponent&#187;, \u0438 \u0438\u043d\u0438\u0446\u0438\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0438\u0433\u0440\u044b\u0432\u0430\u043d\u0438\u0435 \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0438 \u0441\u043c\u0435\u0440\u0442\u0438 \u0443 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0432\u0438\u0441\u0438\u0442 &#171;HealthComponent&#187;, \u0437\u0434\u043e\u0440\u043e\u0432\u044c\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043e\u043f\u0443\u0441\u0442\u0438\u043b\u043e\u0441\u044c \u0434\u043e \u043d\u0443\u043b\u044f.<\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u0440\u0430\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f \u043d\u0430\u0448\u0435\u0439 \u043e\u0442\u0432\u0430\u0436\u043d\u043e\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 \u0432\u044b\u044f\u0441\u043d\u0438\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u0432 \u043f\u0435\u0440\u0432\u0443\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c, \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u043c\u044b\u0445 ECS \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u044b \u0432 Unity, \u043e\u0434\u043d\u0430\u043a\u043e \u043e\u043d\u0438 \u043a \u043d\u0435\u0439 \u043d\u0435 \u043f\u0440\u0438\u0432\u044f\u0437\u0430\u043d\u044b, \u0447\u0442\u043e \u043f\u043e\u0434\u0440\u0430\u0437\u0443\u043c\u0435\u0432\u0430\u0435\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u0438\u0445 \u043a\u0430\u043a-\u043b\u0438\u0431\u043e \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b. \u041d\u043e \u0437\u0430\u0447\u0435\u043c \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c\u0441\u044f \u0441 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u043e\u0439, \u0435\u0441\u043b\u0438 \u043c\u043e\u0436\u043d\u043e \u043d\u0435 \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c\u0441\u044f \u0441 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u043e\u0439? \u041d\u0430 \u0442\u043e\u043c \u0438 \u0440\u0435\u0448\u0438\u043b\u0438 \u043c\u044b \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0432\u043e\u0439 \u043b\u0435\u043d\u0438\u0432\u044b\u0439 ECS \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e \u0434\u043b\u044f Unity.<\/p>\n<p><em>\u0421\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u043f\u043e\u043b\u0443\u0447\u0438\u0432\u0448\u0430\u044f\u0441\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u043d\u0435 \u0434\u0430\u0441\u0442 \u0432\u0430\u043c \u0442\u043e\u0439 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u043e\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0442\u0430\u043a \u0440\u0430\u0441\u0445\u0432\u0430\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u043c \u0443\u043f\u043e\u043c\u0438\u043d\u0430\u043d\u0438\u0438 ECS, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u044f \u0432\u0438\u0434\u0435\u043b. \u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0446\u0435\u043b\u044c\u044e \u0431\u044b\u043b\u043e \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0435 \u0431\u043e\u043b\u0435\u0435-\u043c\u0435\u043d\u0435\u0435 \u0441\u043a\u043b\u0430\u0434\u043d\u043e\u0439 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b \u043f\u0440\u043e\u0435\u043a\u0442\u0430.<\/em> <\/p>\n<p>\u0418\u0442\u0430\u043a, \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043b\u0438 \u043c\u044b \u0432 \u043f\u0435\u0440\u0432\u0443\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u044f\u0432\u043d\u043e \u043d\u0435 \u0447\u0438\u0441\u0442\u044b\u0439 ECS, \u043d\u043e \u043f\u043e\u0441\u0442\u0430\u0440\u0430\u043b\u0438\u0441\u044c \u043f\u0440\u0438\u0431\u043b\u0438\u0437\u0438\u0442\u044c\u0441\u044f \u043a \u043d\u0435\u043c\u0443 \u043d\u0430\u0441\u0442\u043e\u043b\u044c\u043a\u043e, \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u044d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 Unity \u0438 \u043d\u0430\u0448\u0435 \u043b\u0438\u0447\u043d\u043e\u0435 \u0432\u0438\u0434\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u0430.<\/p>\n<p>\u041d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0441\u043f\u043e\u0439\u043b\u0435\u0440. \u041d\u0430 \u0432\u044b\u0445\u043e\u0434\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0430\u0441\u044c \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a\u0430\u044f \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430: <\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/dd4\/241\/4a4\/dd42414a44535a7d34973cd69cce49b2.png\" alt=\"\u0427\u0430\u0441\u0442\u044c \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b \u0438\u0433\u0440\u044b\" title=\"\u0427\u0430\u0441\u0442\u044c \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b \u0438\u0433\u0440\u044b\" width=\"982\" height=\"837\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/dd4\/241\/4a4\/dd42414a44535a7d34973cd69cce49b2.png\"\/><figcaption>\u0427\u0430\u0441\u0442\u044c \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b \u0438\u0433\u0440\u044b<\/figcaption><\/figure>\n<p>\u041f\u0435\u0440\u0435\u0439\u0434\u0451\u043c \u0436\u0435 \u043a \u044d\u0442\u0430\u043f\u0430\u043c \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438! \u0411\u0435\u0440\u0451\u043c \u0432 \u0440\u0443\u043a\u0438 \u043a\u043b\u0430\u0432\u0438\u0430\u0442\u0443\u0440\u0443 \u0438 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u043c \u043f\u0438\u0441\u0430\u0442\u044c. \u041d\u0430\u0447\u043d\u0451\u043c \u0441 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0438 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u0433\u0434\u0435-\u0442\u043e \u0432 \u044d\u0444\u0435\u043c\u0435\u0440\u043d\u043e\u043c \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435, \u0430 \u043a \u043d\u0438\u043c \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u043b\u0451\u0433\u043a\u0438\u0439 \u0438 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0431\u044b\u0441\u0442\u0440\u044b\u0439 \u0434\u043e\u0441\u0442\u0443\u043f, \u0442\u0430\u043a \u0447\u0442\u043e \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b \u0433\u0434\u0435-\u0442\u043e \u0432\u0435\u0441\u0442\u0438 \u043c\u0430\u0441\u0441\u0438\u0432\u044b \u0441\u0441\u044b\u043b\u043e\u043a \u043d\u0430 \u043d\u0438\u0445, \u0438 \u044d\u0442\u0438\u043c &#171;\u0433\u0434\u0435-\u0442\u043e&#187; \u0443 \u043d\u0430\u0441 \u0431\u0443\u0434\u0435\u0442 ECSInstance &#8212; \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043a\u043b\u0430\u0441\u0441 \u0441 \u0434\u0432\u0443\u043c\u044f \u043f\u043e\u043b\u044f\u043c\u0438: \u0441\u043f\u0438\u0441\u043e\u043a \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 \u0438 \u0441\u043f\u0438\u0441\u043e\u043a \u0441\u0438\u0441\u0442\u0435\u043c. \u041a\u043e\u0434 \u0435\u0433\u043e \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a:<\/p>\n<pre><code class=\"cs\">public class ECSInstance {     private static ECSInstance instance;        public List&lt;ECSComponent> Components;     public List&lt;ECSSystem> Systems;        private ECSInstance()     {         Components = new List&lt;ECSComponent>();         Systems = new List&lt;ECSSystem>();     }     public static ECSInstance Instance()     {         if(instance == null)             instance = new ECSInstance();         return instance;     } }<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043a \u043d\u0435\u043c\u0443 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043e\u0442\u043e\u0432\u0441\u044e\u0434\u0443 \u0432 \u043a\u043e\u0434\u0435, \u0438 \u0435\u0433\u043e \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c\u0441\u044f \u0438 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u043d\u0430 \u043f\u0440\u043e\u0442\u044f\u0436\u0435\u043d\u0438\u0438 \u0432\u0441\u0435\u0439 \u0438\u0433\u0440\u044b. \u0421\u0438\u043d\u0433\u043b\u0442\u043e\u043d \u043f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u043e \u043f\u043e\u0434\u043e\u0448\u0451\u043b \u043d\u0430 \u0440\u043e\u043b\u044c \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u0430 \u0434\u043b\u044f \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430. \u041e\u0434\u043d\u0430\u043a\u043e, \u043a\u0430\u043a \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u044d\u0442\u0438 \u0441\u043f\u0438\u0441\u043a\u0438 \u043f\u0443\u0441\u0442\u044b\u0435, \u0438 \u043d\u0438\u0433\u0434\u0435 \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u043a\u043b\u0430\u0441\u0441\u0430 \u043d\u0435 \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f. \u0421 \u044d\u0442\u0438\u043c \u043c\u044b \u0440\u0430\u0437\u0431\u0435\u0440\u0451\u043c\u0441\u044f \u043f\u043e\u0437\u0436\u0435, \u043a\u043e\u0433\u0434\u0430 \u0434\u043e\u0439\u0434\u0451\u043c \u0434\u043e \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u0438\u044f \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432. \u0418, \u043f\u043e\u043a\u0430 \u0447\u0442\u043e, \u043d\u0435 \u0441\u043e\u0432\u0441\u0435\u043c \u0443\u0434\u043e\u0431\u043d\u043e \u0434\u043e\u0441\u0442\u0430\u0432\u0430\u0442\u044c \u043e\u0442\u0441\u044e\u0434\u0430 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b \u0438\u043b\u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u044b, \u0442\u0430\u043a \u0447\u0442\u043e \u043c\u044b \u043d\u0430\u043f\u0438\u0441\u0430\u043b\u0438 \u0434\u0432\u0430 \u043a\u043b\u0430\u0441\u0441\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441 \u044d\u0442\u0438\u043c \u043f\u043e\u043c\u043e\u0433\u0430\u044e\u0442 \u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c\u0441\u044f. \u0417\u043d\u0430\u043a\u043e\u043c\u044c\u0442\u0435\u0441\u044c \u0441 \u043d\u0438\u043c\u0438, \u043f\u0435\u0440\u0432\u044b\u0439 &#8212; \u044d\u0442\u043e \u043a\u043b\u0430\u0441\u0441 ECSFilter. \u041e\u043d \u043d\u0443\u0436\u0435\u043d \u0434\u043b\u044f \u0443\u0434\u043e\u0431\u043d\u043e\u0433\u043e \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430\u043c:<\/p>\n<pre><code class=\"cs\">public class ECSFilter {     public List&lt;ECSComponent> Components;        public ECSFilter(ECSComponent[] components) { Components = new List&lt;ECSComponent>(components); }); }     public ECSFilter(List&lt;ECSComponent> components) { Components = components; }     public ECSFilter() { Components = ECSInstance.Instance().Components; }          public ECSFilter OfType&lt;T>()     {         List&lt;ECSComponent> new_list = new List&lt;ECSComponent>();         foreach(var c in Components)             if(c.GetType() == typeof(T))                 new_list.Add(c);         return new ECSFilter(new_list);     }        public ECSFilter WithoutType&lt;T>()     {         List&lt;ECSComponent> new_list = new List&lt;ECSComponent>();         foreach (var c in Components)             if (c.GetType() != typeof(T))                 new_list.Add(c);         return new ECSFilter(new_list);     }      public List&lt;T> GetComponents&lt;T>() where T: ECSComponent     {         List&lt;T> new_list = new List&lt;T>();         foreach (var c in Components)             if (c.GetType() == typeof(T))                 new_list.Add((T)c);         return new_list;     }        public List&lt;T> GetComponents&lt;T>(Func&lt;T, bool> predicate) where T: ECSComponent     {         List&lt;T> new_list = new List&lt;T>();         foreach (var c in Components)             if (c.GetType() == typeof(T))                 if(predicate.Invoke((T)c))                     new_list.Add((T)c);         return new_list;     } }<\/code><\/pre>\n<p>\u0417\u0430 \u0441\u0447\u0451\u0442 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438, \u0444\u0438\u043b\u044c\u0442\u0440 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u043c \u043a \u043d\u0430\u0431\u043e\u0440\u0443 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432, \u043d\u0435 \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 \u0441 ECSInstance, \u0438 \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442\u0441\u044f \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u0435\u043c \u0438\u0437 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 \u0442\u0435\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0443\u0434\u043e\u0432\u043b\u0435\u0442\u0432\u043e\u0440\u044f\u044e\u0442 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u043c. \u041c\u0435\u0442\u043e\u0434\u044b OfType \u0438 WithoutType \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0442 \u0441\u0430\u043c \u0444\u0438\u043b\u044c\u0442\u0440, \u0442\u0430\u043a \u0447\u0442\u043e \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0432\u044b\u0437\u0432\u0430\u043d\u044b \u0432 \u0446\u0435\u043f\u043e\u0447\u043a\u0435:<\/p>\n<pre><code class=\"cs\">... ECSFilter filter = new ECSFilter(); List&lt;ECSComponent> = filter.OfType&lt;Moveable>().WithoutType&lt;Selectable>().Components; ...<\/code><\/pre>\n<p>\u0412\u0442\u043e\u0440\u043e\u0439 &#8212; \u043a\u043b\u0430\u0441\u0441 ECSService. \u0412\u0441\u0451 \u0436\u0435, \u043e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0435\u0433\u043e \u0437\u0430\u0434\u0430\u0447\u0430 &#8212; \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0441\u0438\u0441\u0442\u0435\u043c \u0438 \u0432\u044b\u0437\u043e\u0432 \u0438\u0445  \u0433\u043b\u0430\u0432\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u043e\u0434\u043d\u0430\u043a\u043e \u044f \u043f\u0440\u0438\u043d\u044f\u043b \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0442\u0430\u043a\u0436\u0435 \u0434\u0430\u0442\u044c \u044d\u0442\u043e\u043c\u0443 \u043a\u043b\u0430\u0441\u0441\u0443 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0443\u044e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u0443 (\u0431\u044b\u043b \u0435\u0449\u0451 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u043b\u043e\u0433\u0438\u043a\u0443 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0432 ECSInstance, \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0439 \u0432\u044b\u0448\u0435). \u0422\u0430\u043a\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u044f \u043f\u0440\u0438\u043d\u044f\u043b \u043d\u0430 \u0441\u043b\u0443\u0447\u0430\u0439, \u0435\u0441\u043b\u0438 \u0432 \u0431\u0443\u0434\u0443\u0449\u0435\u043c \u0437\u0430\u0445\u043e\u0447\u0435\u0442\u0441\u044f \u0434\u0430\u0442\u044c ECSService \u0431\u043e\u043b\u044c\u0448\u0435 \u043b\u043e\u0433\u0438\u043a\u0438, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u043e\u0439 \u0441 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435\u043c \u0441\u0438\u0441\u0442\u0435\u043c. \u041a\u043e\u0434:<\/p>\n<pre><code class=\"cs\">public class ECSService : MonoBehaviour {     void InitSystems()     {         var Systems = ECSInstance.Instance().Systems;                  Systems.Add(new InputSystem(this));         Systems.Add(new SelectionSystem(this));         Systems.Add(new MoveSystem(this));         Systems.Add(new AttackSystem(this));         \/\/Systems.Add(...     }      void Awake()     {         InitSystems();     }      void Start()     {         foreach (var s in ECSInstance.Instance().Systems)             s.Init();     }      void Update()     {         foreach (var s in ECSInstance.Instance().Systems)             s.Run();     }      public T GetSystem&lt;T>() where T: IECSSystem     {         foreach(var s in ECSInstance.Instance().Systems)             if (s.GetType() == typeof(T))                 return (T)s;         return null;     } }<\/code><\/pre>\n<p>\u041a\u0430\u043a \u0432\u0438\u0434\u043d\u043e, \u0438\u043c\u0435\u043d\u043d\u043e \u0432 \u044d\u0442\u043e\u043c \u043a\u043b\u0430\u0441\u0441\u0435 &#171;\u0431\u0435\u0440\u0451\u0442 \u043d\u0430\u0447\u0430\u043b\u043e&#187; \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0435\u0436\u0435\u043a\u0430\u0434\u0440\u043e\u0432\u043e\u0439 \u043b\u043e\u0433\u0438\u043a\u0438 \u043a\u0430\u0436\u0434\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b. \u042f \u0443\u0432\u0435\u0440\u0435\u043d, \u0447\u0442\u043e \u0446\u0438\u043a\u043b foreach \u043f\u043e \u0432\u0441\u0435\u043c \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u043c \u0441 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0447\u0435\u043d\u044c \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u043c \u0440\u0435\u0448\u0435\u043d\u0438\u0435\u043c, \u043e\u0434\u043d\u0430\u043a\u043e, \u043d\u0435 \u0441\u0442\u043e\u0438\u0442 \u0437\u0430\u0431\u044b\u0432\u0430\u0442\u044c, \u0447\u0442\u043e ECS \u0443 \u043d\u0430\u0441 \u043b\u0435\u043d\u0438\u0432\u044b\u0439 :). \u041f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u0441\u0438\u0441\u0442\u0435\u043c \u0441\u0435\u0440\u0432\u0438\u0441 \u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0432\u043d\u0443\u0442\u0440\u0438 \u043d\u0438\u0445 \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u0441\u0435\u0431\u044f \u0436\u0435, \u0447\u0442\u043e\u0431\u044b \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0438\u043c\u0435\u043b\u0430 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0441\u0432\u043e\u0438\u043c &#171;\u0441\u043e\u0431\u0440\u0430\u0442\u044c\u044f\u043c&#187;. \u041d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u044f \u043f\u043e\u043c\u043d\u044e, \u0432 \u041e\u041e\u041f \u044d\u0442\u043e\u0442 \u043f\u0440\u0438\u0451\u043c \u043d\u0430\u0437\u044b\u0432\u0430\u044e\u0442 &#171;\u0438\u043d\u044a\u0435\u043a\u0446\u0438\u044f \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438&#187;.<\/p>\n<p>\u0412\u043e\u0442 \u0438 \u0432\u0441\u0451 \u043d\u0430 \u0447\u0451\u043c \u0434\u0435\u0440\u0436\u0438\u0442\u0441\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 ECS. \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u0441 \u0447\u0438\u0441\u0442\u043e\u0439 \u0434\u0443\u0448\u043e\u0439 \u043c\u043e\u0436\u0435\u043c \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043a \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 \u0438 \u0441\u0438\u0441\u0442\u0435\u043c.<\/p>\n<p>\u0412\u0441\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b \u0443 \u043d\u0430\u0441 \u043d\u0430\u0441\u043b\u0435\u0434\u0443\u044e\u0442\u0441\u044f \u043e\u0442 ECSComponent, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u0435\u0431\u044f \u0432 \u0441\u043f\u0438\u0441\u043e\u043a \u043f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043d\u043e\u0432\u043e\u0433\u043e \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430:<\/p>\n<pre><code class=\"cs\">public class ECSComponent : MonoBehaviour {     private void Awake()     {         ECSInstance.Instance().Components.Add(this);     }      public void AddComponent&lt;T>(T component) where T: ECSComponent     {         gameObject.AddComponent&lt;T>();         ECSInstance.Instance().Components.Add(component);     }      public void RemoveComponent&lt;T>(T component) where T: ECSComponent     {         ECSInstance.Instance().Components.Remove(component);         Destroy(component);     } }<\/code><\/pre>\n<p>\u042d\u0442\u043e, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043d\u0435\u0443\u0434\u043e\u0431\u0441\u0442\u0432\u043e, \u0442\u0430\u043a \u043a\u0430\u043a \u0442\u0430\u043a\u0438\u0435 \u0432\u0430\u0436\u043d\u044b\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b \u043a\u0430\u043a transform, renderer, \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b Unity \u043d\u0435 \u0432\u0445\u043e\u0434\u044f\u0442 \u0432 \u0441\u043f\u0438\u0441\u043e\u043a \u0438 \u043d\u0438\u043a\u0430\u043a \u043d\u0435 \u0441\u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043e\u0442\u0442\u0443\u0434\u0430 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u044b. \u041e\u0434\u043d\u0430\u043a\u043e, \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0435\u043c \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043a gameObject \u043d\u0430\u0448\u0438\u0445 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 \u043c\u044b \u0432\u043f\u043e\u043b\u043d\u0435 \u0441\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c\u0441\u044f.<\/p>\n<p>\u041d\u0430\u043a\u043e\u043d\u0435\u0446, ECSSystem &#8212; \u0441\u0443\u043f\u0435\u0440\u043a\u043b\u0430\u0441\u0441 \u0441\u0438\u0441\u0442\u0435\u043c:<\/p>\n<pre><code class=\"cs\">public class IECSSystem {     public ECSService Service;        public IECSSystem(ECSService service) { Service = service; }        public virtual void Run() { }     public virtual void Init() { } }<\/code><\/pre>\n<p>\u041d\u0438\u0447\u0435\u0433\u043e \u0441\u0432\u0435\u0440\u0445\u044a\u0435\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e, \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0430\u0440\u0430 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 &#8212; \u043e\u0434\u0438\u043d \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u0441\u0442\u0430\u0440\u0442\u0435 (Unity \u0441\u0438\u0433\u043d\u0430\u043b Start Monobehaviour \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u043c), \u0430 \u0434\u0440\u0443\u0433\u043e\u0439 &#8212; \u043a\u0430\u0436\u0434\u044b\u0439 \u0444\u0440\u0435\u0439\u043c. \u0422\u0443\u0442 \u0436\u0435 \u0432\u0438\u0434\u0435\u043d \u0438 \u0441\u0435\u0440\u0432\u0438\u0441, \u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0431\u044b\u043b\u043e \u0441\u043a\u0430\u0437\u0430\u043d\u043e \u0432\u044b\u0448\u0435.<\/p>\n<p>\u041d\u0443 \u0432\u043e\u0442 \u0438 \u0432\u0441\u0451, \u0432\u0430\u043c \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u043b\u0438\u0448\u044c \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043d\u0430 \u043a\u0430\u0440\u0442\u0443 \u0432\u0430\u0448\u0435\u0433\u043e \u0431\u0443\u0434\u0443\u0449\u0435\u0433\u043e \u0432\u043e\u0438\u043d\u0430\/\u0434\u0435\u0440\u0435\u0432\u043e\/\u043f\u043e\u043b\u0442\u043e\u0440\u0430\u0448\u043a\u0443 \u043b\u0438\u043c\u043e\u043d\u0430\u0434\u0430 \u0432 \u0432\u0438\u0434\u0435 \u043f\u0443\u0441\u0442\u044b\u0448\u043a\u0438, \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0432\u043e\u0439 \u043f\u0435\u0440\u0432\u044b\u0439 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u0438\u044f) \u0438 \u0432 \u043f\u0435\u0440\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0447\u0442\u043e-\u0442\u043e \u0432\u0440\u043e\u0434\u0435&#8230;<\/p>\n<pre><code class=\"cs\">public override void Run() {     ECSFilter f = new ECSFilter();     List&lt;Movable> components = f.GetComponents&lt;Movable>();     foreach (var c in components)         UpdateComponent(c); }<\/code><\/pre>\n<p><em>\u0415\u0441\u043b\u0438 \u0432\u044b \u043e\u0446\u0435\u043d\u0438\u0442\u0435 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b, \u0432 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b \u0432\u044b\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0443\u044e \u0441\u0442\u0430\u0442\u044c\u044e, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 ECS \u0438 UI \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 Unity \u043f\u0440\u043e\u0435\u043a\u0442\u0430. \u041d\u0435\u043f\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u0436\u0434\u0451\u043c \u0432\u0430\u0448 \u0444\u0438\u0434\u0431\u0435\u043a. <\/em>\u0423\u0434\u0430\u0447\u0438 \u0432\u0430\u043c \u0432 \u0432\u0430\u0448\u0438\u0445 \u043d\u0430\u0447\u0438\u043d\u0430\u043d\u0438\u044f\u0445!<\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"v-portal\" style=\"display:none;\"><\/div>\n<\/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\/665272\/\"> https:\/\/habr.com\/ru\/post\/665272\/<\/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<p>ECS &#8212; <strong>Entity-Component-System<\/strong> &#8212; \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0443\u0434\u043e\u0431\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b \u0438\u0433\u0440. \u0412\u044b\u043d\u0435\u0441\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b, \u043f\u043e\u043c\u0435\u0449\u0451\u043d\u043d\u044b\u0435 \u0432 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438 \u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c\u044b\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u043c\u0438, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0435, \u0434\u0430\u0436\u0435 \u0441\u0430\u043c\u043e\u0435 \u0441\u043b\u043e\u0436\u043d\u043e\u0435, \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 &#171;\u0436\u043e\u043d\u0433\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c&#187; \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 \u0432\u043d\u0443\u0442\u0440\u0438 \u043d\u0438\u0445. \u0418\u043c\u0435\u043d\u043d\u043e \u043d\u0430 \u043d\u0435\u0433\u043e \u043f\u0430\u043b \u043d\u0430\u0448 \u0432\u0437\u043e\u0440 \u043f\u0440\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043f\u043e\u0448\u0430\u0433\u043e\u0432\u043e\u0439 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0438 \u043d\u0430 Unity.<\/p>\n<p>\u0414\u043b\u044f \u0442\u0435\u0445, \u043a\u0442\u043e \u043d\u0435 \u043a\u0430\u0441\u0430\u043b\u0441\u044f \u0434\u0430\u043d\u043d\u043e\u0439 \u0442\u0435\u043c\u044b, \u0432\u043a\u0440\u0430\u0442\u0446\u0435 \u043e\u0431\u044a\u044f\u0441\u043d\u044e \u043a\u0430\u043a \u0432\u043e\u043e\u0431\u0449\u0435 \u0443\u0441\u0442\u0440\u043e\u0435\u043d ECS: \u0432\u044b \u0434\u0435\u043b\u0438\u0442\u0435 \u0432\u0435\u0441\u044c \u0432\u0430\u0448 \u043f\u0440\u043e\u0435\u043a\u0442 \u043d\u0430 \u0442\u0440\u0438 \u0430\u0441\u043f\u0435\u043a\u0442\u0430. \u041f\u0435\u0440\u0432\u044b\u0439 &#8212; <strong>\u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438 (Entities)<\/strong> &#8212; \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0430\u0431\u043e\u0440 &#171;\u043f\u0443\u0441\u0442\u044b\u0448\u0435\u043a&#187; (\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432), \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435 \u043e\u0431\u043b\u0430\u0434\u0430\u044e\u0442 \u043d\u0438\u043a\u0430\u043a\u043e\u0439 \u043b\u043e\u0433\u0438\u043a\u043e\u0439. \u041e\u043d\u0438 \u043d\u0443\u0436\u043d\u044b \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f <strong>\u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 (Components) <\/strong>&#8212; \u0432\u0442\u043e\u0440\u043e\u0439 \u0430\u0441\u043f\u0435\u043a\u0442. \u042d\u0442\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u044b, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435, \u043e\u0434\u043d\u0430\u043a\u043e, \u0442\u043e\u0436\u0435 \u043d\u0435 \u0438\u043c\u0435\u044e\u0449\u0438\u0435 \u043a\u0430\u043a\u043e\u0439-\u043b\u0438\u0431\u043e \u043b\u043e\u0433\u0438\u043a\u0438 (\u0440\u0430\u0437\u0432\u0435 \u0447\u0442\u043e \u043a\u0440\u043e\u043c\u0435 \u043f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0435\u0439, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 &#171;HealthComponent&#187; \u043c\u043e\u0436\u0435\u0442 \u0443\u043c\u0435\u0442\u044c \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c \u0442\u0435\u043a\u0443\u0449\u0435\u0435 \u0437\u0434\u043e\u0440\u043e\u0432\u044c\u0435 \u0432 \u043f\u0440\u043e\u0446\u0435\u043d\u0442\u0430\u0445, \u043d\u0435 \u0431\u043e\u043b\u0435\u0435). \u0410 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b <strong>\u0441\u0438\u0441\u0442\u0435\u043c\u0430\u043c\u0438 (Systems)<\/strong>, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044e\u0442 \u0432\u0441\u044e \u043b\u043e\u0433\u0438\u043a\u0443 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0434\u0430\u043d\u043d\u044b\u0445, \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0445 \u0438\u0437 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441\u0438\u0441\u0442\u0435\u043c\u0430 &#171;HealthSystem&#187; \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u0442\u0435\u043a\u0443\u0449\u0435\u0435 \u0437\u0434\u043e\u0440\u043e\u0432\u044c\u0435 \u0443 \u0432\u0441\u0435\u0445 &#171;HealthComponent&#187;, \u0438 \u0438\u043d\u0438\u0446\u0438\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0438\u0433\u0440\u044b\u0432\u0430\u043d\u0438\u0435 \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0438 \u0441\u043c\u0435\u0440\u0442\u0438 \u0443 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0432\u0438\u0441\u0438\u0442 &#171;HealthComponent&#187;, \u0437\u0434\u043e\u0440\u043e\u0432\u044c\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043e\u043f\u0443\u0441\u0442\u0438\u043b\u043e\u0441\u044c \u0434\u043e \u043d\u0443\u043b\u044f.<\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u0440\u0430\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f \u043d\u0430\u0448\u0435\u0439 \u043e\u0442\u0432\u0430\u0436\u043d\u043e\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 \u0432\u044b\u044f\u0441\u043d\u0438\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u0432 \u043f\u0435\u0440\u0432\u0443\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c, \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u043c\u044b\u0445 ECS \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u044b \u0432 Unity, \u043e\u0434\u043d\u0430\u043a\u043e \u043e\u043d\u0438 \u043a \u043d\u0435\u0439 \u043d\u0435 \u043f\u0440\u0438\u0432\u044f\u0437\u0430\u043d\u044b, \u0447\u0442\u043e \u043f\u043e\u0434\u0440\u0430\u0437\u0443\u043c\u0435\u0432\u0430\u0435\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u0438\u0445 \u043a\u0430\u043a-\u043b\u0438\u0431\u043e \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b. \u041d\u043e \u0437\u0430\u0447\u0435\u043c \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c\u0441\u044f \u0441 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u043e\u0439, \u0435\u0441\u043b\u0438 \u043c\u043e\u0436\u043d\u043e \u043d\u0435 \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c\u0441\u044f \u0441 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u043e\u0439? \u041d\u0430 \u0442\u043e\u043c \u0438 \u0440\u0435\u0448\u0438\u043b\u0438 \u043c\u044b \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0432\u043e\u0439 \u043b\u0435\u043d\u0438\u0432\u044b\u0439 ECS \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e \u0434\u043b\u044f Unity.<\/p>\n<p><em>\u0421\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u043f\u043e\u043b\u0443\u0447\u0438\u0432\u0448\u0430\u044f\u0441\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u043d\u0435 \u0434\u0430\u0441\u0442 \u0432\u0430\u043c \u0442\u043e\u0439 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u043e\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0442\u0430\u043a \u0440\u0430\u0441\u0445\u0432\u0430\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u043c \u0443\u043f\u043e\u043c\u0438\u043d\u0430\u043d\u0438\u0438 ECS, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u044f \u0432\u0438\u0434\u0435\u043b. \u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0446\u0435\u043b\u044c\u044e \u0431\u044b\u043b\u043e \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0435 \u0431\u043e\u043b\u0435\u0435-\u043c\u0435\u043d\u0435\u0435 \u0441\u043a\u043b\u0430\u0434\u043d\u043e\u0439 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b \u043f\u0440\u043e\u0435\u043a\u0442\u0430.<\/em> <\/p>\n<p>\u0418\u0442\u0430\u043a, \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043b\u0438 \u043c\u044b \u0432 \u043f\u0435\u0440\u0432\u0443\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u044f\u0432\u043d\u043e \u043d\u0435 \u0447\u0438\u0441\u0442\u044b\u0439 ECS, \u043d\u043e \u043f\u043e\u0441\u0442\u0430\u0440\u0430\u043b\u0438\u0441\u044c \u043f\u0440\u0438\u0431\u043b\u0438\u0437\u0438\u0442\u044c\u0441\u044f \u043a \u043d\u0435\u043c\u0443 \u043d\u0430\u0441\u0442\u043e\u043b\u044c\u043a\u043e, \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u044d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 Unity \u0438 \u043d\u0430\u0448\u0435 \u043b\u0438\u0447\u043d\u043e\u0435 \u0432\u0438\u0434\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u0430.<\/p>\n<p>\u041d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0441\u043f\u043e\u0439\u043b\u0435\u0440. \u041d\u0430 \u0432\u044b\u0445\u043e\u0434\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0430\u0441\u044c \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a\u0430\u044f \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430: <\/p>\n<figure class=\"full-width\"><figcaption>\u0427\u0430\u0441\u0442\u044c \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b \u0438\u0433\u0440\u044b<\/figcaption><\/figure>\n<p>\u041f\u0435\u0440\u0435\u0439\u0434\u0451\u043c \u0436\u0435 \u043a \u044d\u0442\u0430\u043f\u0430\u043c \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438! \u0411\u0435\u0440\u0451\u043c \u0432 \u0440\u0443\u043a\u0438 \u043a\u043b\u0430\u0432\u0438\u0430\u0442\u0443\u0440\u0443 \u0438 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u043c \u043f\u0438\u0441\u0430\u0442\u044c. \u041d\u0430\u0447\u043d\u0451\u043c \u0441 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0438 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u0433\u0434\u0435-\u0442\u043e \u0432 \u044d\u0444\u0435\u043c\u0435\u0440\u043d\u043e\u043c \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435, \u0430 \u043a \u043d\u0438\u043c \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u043b\u0451\u0433\u043a\u0438\u0439 \u0438 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0431\u044b\u0441\u0442\u0440\u044b\u0439 \u0434\u043e\u0441\u0442\u0443\u043f, \u0442\u0430\u043a \u0447\u0442\u043e \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b \u0433\u0434\u0435-\u0442\u043e \u0432\u0435\u0441\u0442\u0438 \u043c\u0430\u0441\u0441\u0438\u0432\u044b \u0441\u0441\u044b\u043b\u043e\u043a \u043d\u0430 \u043d\u0438\u0445, \u0438 \u044d\u0442\u0438\u043c &#171;\u0433\u0434\u0435-\u0442\u043e&#187; \u0443 \u043d\u0430\u0441 \u0431\u0443\u0434\u0435\u0442 ECSInstance &#8212; \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043a\u043b\u0430\u0441\u0441 \u0441 \u0434\u0432\u0443\u043c\u044f \u043f\u043e\u043b\u044f\u043c\u0438: \u0441\u043f\u0438\u0441\u043e\u043a \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 \u0438 \u0441\u043f\u0438\u0441\u043e\u043a \u0441\u0438\u0441\u0442\u0435\u043c. \u041a\u043e\u0434 \u0435\u0433\u043e \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a:<\/p>\n<pre><code class=\"cs\">public class ECSInstance {     private static ECSInstance instance;        public List&lt;ECSComponent> Components;     public List&lt;ECSSystem> Systems;        private ECSInstance()     {         Components = new List&lt;ECSComponent>();         Systems = new List&lt;ECSSystem>();     }     public static ECSInstance Instance()     {         if(instance == null)             instance = new ECSInstance();         return instance;     } }<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043a \u043d\u0435\u043c\u0443 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043e\u0442\u043e\u0432\u0441\u044e\u0434\u0443 \u0432 \u043a\u043e\u0434\u0435, \u0438 \u0435\u0433\u043e \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c\u0441\u044f \u0438 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u043d\u0430 \u043f\u0440\u043e\u0442\u044f\u0436\u0435\u043d\u0438\u0438 \u0432\u0441\u0435\u0439 \u0438\u0433\u0440\u044b. \u0421\u0438\u043d\u0433\u043b\u0442\u043e\u043d \u043f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u043e \u043f\u043e\u0434\u043e\u0448\u0451\u043b \u043d\u0430 \u0440\u043e\u043b\u044c \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u0430 \u0434\u043b\u044f \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430. \u041e\u0434\u043d\u0430\u043a\u043e, \u043a\u0430\u043a \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u044d\u0442\u0438 \u0441\u043f\u0438\u0441\u043a\u0438 \u043f\u0443\u0441\u0442\u044b\u0435, \u0438 \u043d\u0438\u0433\u0434\u0435 \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u043a\u043b\u0430\u0441\u0441\u0430 \u043d\u0435 \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f. \u0421 \u044d\u0442\u0438\u043c \u043c\u044b \u0440\u0430\u0437\u0431\u0435\u0440\u0451\u043c\u0441\u044f \u043f\u043e\u0437\u0436\u0435, \u043a\u043e\u0433\u0434\u0430 \u0434\u043e\u0439\u0434\u0451\u043c \u0434\u043e \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u0438\u044f \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432. \u0418, \u043f\u043e\u043a\u0430 \u0447\u0442\u043e, \u043d\u0435 \u0441\u043e\u0432\u0441\u0435\u043c \u0443\u0434\u043e\u0431\u043d\u043e \u0434\u043e\u0441\u0442\u0430\u0432\u0430\u0442\u044c \u043e\u0442\u0441\u044e\u0434\u0430 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b \u0438\u043b\u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u044b, \u0442\u0430\u043a \u0447\u0442\u043e \u043c\u044b \u043d\u0430\u043f\u0438\u0441\u0430\u043b\u0438 \u0434\u0432\u0430 \u043a\u043b\u0430\u0441\u0441\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441 \u044d\u0442\u0438\u043c \u043f\u043e\u043c\u043e\u0433\u0430\u044e\u0442 \u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c\u0441\u044f. \u0417\u043d\u0430\u043a\u043e\u043c\u044c\u0442\u0435\u0441\u044c \u0441 \u043d\u0438\u043c\u0438, \u043f\u0435\u0440\u0432\u044b\u0439 &#8212; \u044d\u0442\u043e \u043a\u043b\u0430\u0441\u0441 ECSFilter. \u041e\u043d \u043d\u0443\u0436\u0435\u043d \u0434\u043b\u044f \u0443\u0434\u043e\u0431\u043d\u043e\u0433\u043e \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430\u043c:<\/p>\n<pre><code class=\"cs\">public class ECSFilter {     public List&lt;ECSComponent> Components;        public ECSFilter(ECSComponent[] components) { Components = new List&lt;ECSComponent>(components); }); }     public ECSFilter(List&lt;ECSComponent> components) { Components = components; }     public ECSFilter() { Components = ECSInstance.Instance().Components; }          public ECSFilter OfType&lt;T>()     {         List&lt;ECSComponent> new_list = new List&lt;ECSComponent>();         foreach(var c in Components)             if(c.GetType() == typeof(T))                 new_list.Add(c);         return new ECSFilter(new_list);     }        public ECSFilter WithoutType&lt;T>()     {         List&lt;ECSComponent> new_list = new List&lt;ECSComponent>();         foreach (var c in Components)             if (c.GetType() != typeof(T))                 new_list.Add(c);         return new ECSFilter(new_list);     }      public List&lt;T> GetComponents&lt;T>() where T: ECSComponent     {         List&lt;T> new_list = new List&lt;T>();         foreach (var c in Components)             if (c.GetType() == typeof(T))                 new_list.Add((T)c);         return new_list;     }        public List&lt;T> GetComponents&lt;T>(Func&lt;T, bool> predicate) where T: ECSComponent     {         List&lt;T> new_list = new List&lt;T>();         foreach (var c in Components)             if (c.GetType() == typeof(T))                 if(predicate.Invoke((T)c))                     new_list.Add((T)c);         return new_list;     } }<\/code><\/pre>\n<p>\u0417\u0430 \u0441\u0447\u0451\u0442 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438, \u0444\u0438\u043b\u044c\u0442\u0440 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u043c \u043a \u043d\u0430\u0431\u043e\u0440\u0443 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432, \u043d\u0435 \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 \u0441 ECSInstance, \u0438 \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442\u0441\u044f \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u0435\u043c \u0438\u0437 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 \u0442\u0435\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0443\u0434\u043e\u0432\u043b\u0435\u0442\u0432\u043e\u0440\u044f\u044e\u0442 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u043c. \u041c\u0435\u0442\u043e\u0434\u044b OfType \u0438 WithoutType \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0442 \u0441\u0430\u043c \u0444\u0438\u043b\u044c\u0442\u0440, \u0442\u0430\u043a \u0447\u0442\u043e \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0432\u044b\u0437\u0432\u0430\u043d\u044b \u0432 \u0446\u0435\u043f\u043e\u0447\u043a\u0435:<\/p>\n<pre><code class=\"cs\">... ECSFilter filter = new ECSFilter(); List&lt;ECSComponent> = filter.OfType&lt;Moveable>().WithoutType&lt;Selectable>().Components; ...<\/code><\/pre>\n<p>\u0412\u0442\u043e\u0440\u043e\u0439 &#8212; \u043a\u043b\u0430\u0441\u0441 ECSService. \u0412\u0441\u0451 \u0436\u0435, \u043e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0435\u0433\u043e \u0437\u0430\u0434\u0430\u0447\u0430 &#8212; \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0441\u0438\u0441\u0442\u0435\u043c \u0438 \u0432\u044b\u0437\u043e\u0432 \u0438\u0445  \u0433\u043b\u0430\u0432\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u043e\u0434\u043d\u0430\u043a\u043e \u044f \u043f\u0440\u0438\u043d\u044f\u043b \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0442\u0430\u043a\u0436\u0435 \u0434\u0430\u0442\u044c \u044d\u0442\u043e\u043c\u0443 \u043a\u043b\u0430\u0441\u0441\u0443 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0443\u044e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u0443 (\u0431\u044b\u043b \u0435\u0449\u0451 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u043b\u043e\u0433\u0438\u043a\u0443 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0432 ECSInstance, \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0439 \u0432\u044b\u0448\u0435). \u0422\u0430\u043a\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u044f \u043f\u0440\u0438\u043d\u044f\u043b \u043d\u0430 \u0441\u043b\u0443\u0447\u0430\u0439, \u0435\u0441\u043b\u0438 \u0432 \u0431\u0443\u0434\u0443\u0449\u0435\u043c \u0437\u0430\u0445\u043e\u0447\u0435\u0442\u0441\u044f \u0434\u0430\u0442\u044c ECSService \u0431\u043e\u043b\u044c\u0448\u0435 \u043b\u043e\u0433\u0438\u043a\u0438, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u043e\u0439 \u0441 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435\u043c \u0441\u0438\u0441\u0442\u0435\u043c. \u041a\u043e\u0434:<\/p>\n<pre><code class=\"cs\">public class ECSService : MonoBehaviour {     void InitSystems()     {         var Systems = ECSInstance.Instance().Systems;                  Systems.Add(new InputSystem(this));         Systems.Add(new SelectionSystem(this));         Systems.Add(new MoveSystem(this));         Systems.Add(new AttackSystem(this));         \/\/Systems.Add(...     }      void Awake()     {         InitSystems();     }      void Start()     {         foreach (var s in ECSInstance.Instance().Systems)             s.Init();     }      void Update()     {         foreach (var s in ECSInstance.Instance().Systems)             s.Run();     }      public T GetSystem&lt;T>() where T: IECSSystem     {         foreach(var s in ECSInstance.Instance().Systems)             if (s.GetType() == typeof(T))                 return (T)s;         return null;     } }<\/code><\/pre>\n<p>\u041a\u0430\u043a \u0432\u0438\u0434\u043d\u043e, \u0438\u043c\u0435\u043d\u043d\u043e \u0432 \u044d\u0442\u043e\u043c \u043a\u043b\u0430\u0441\u0441\u0435 &#171;\u0431\u0435\u0440\u0451\u0442 \u043d\u0430\u0447\u0430\u043b\u043e&#187; \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0435\u0436\u0435\u043a\u0430\u0434\u0440\u043e\u0432\u043e\u0439 \u043b\u043e\u0433\u0438\u043a\u0438 \u043a\u0430\u0436\u0434\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b. \u042f \u0443\u0432\u0435\u0440\u0435\u043d, \u0447\u0442\u043e \u0446\u0438\u043a\u043b foreach \u043f\u043e \u0432\u0441\u0435\u043c \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u043c \u0441 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0447\u0435\u043d\u044c \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u043c \u0440\u0435\u0448\u0435\u043d\u0438\u0435\u043c, \u043e\u0434\u043d\u0430\u043a\u043e, \u043d\u0435 \u0441\u0442\u043e\u0438\u0442 \u0437\u0430\u0431\u044b\u0432\u0430\u0442\u044c, \u0447\u0442\u043e ECS \u0443 \u043d\u0430\u0441 \u043b\u0435\u043d\u0438\u0432\u044b\u0439 :). \u041f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u0441\u0438\u0441\u0442\u0435\u043c \u0441\u0435\u0440\u0432\u0438\u0441 \u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0432\u043d\u0443\u0442\u0440\u0438 \u043d\u0438\u0445 \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u0441\u0435\u0431\u044f \u0436\u0435, \u0447\u0442\u043e\u0431\u044b \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0438\u043c\u0435\u043b\u0430 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0441\u0432\u043e\u0438\u043c &#171;\u0441\u043e\u0431\u0440\u0430\u0442\u044c\u044f\u043c&#187;. \u041d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u044f \u043f\u043e\u043c\u043d\u044e, \u0432 \u041e\u041e\u041f \u044d\u0442\u043e\u0442 \u043f\u0440\u0438\u0451\u043c \u043d\u0430\u0437\u044b\u0432\u0430\u044e\u0442 &#171;\u0438\u043d\u044a\u0435\u043a\u0446\u0438\u044f \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438&#187;.<\/p>\n<p>\u0412\u043e\u0442 \u0438 \u0432\u0441\u0451 \u043d\u0430 \u0447\u0451\u043c \u0434\u0435\u0440\u0436\u0438\u0442\u0441\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 ECS. \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u0441 \u0447\u0438\u0441\u0442\u043e\u0439 \u0434\u0443\u0448\u043e\u0439 \u043c\u043e\u0436\u0435\u043c \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043a \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 \u0438 \u0441\u0438\u0441\u0442\u0435\u043c.<\/p>\n<p>\u0412\u0441\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b \u0443 \u043d\u0430\u0441 \u043d\u0430\u0441\u043b\u0435\u0434\u0443\u044e\u0442\u0441\u044f \u043e\u0442 ECSComponent, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u0435\u0431\u044f \u0432 \u0441\u043f\u0438\u0441\u043e\u043a \u043f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043d\u043e\u0432\u043e\u0433\u043e \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430:<\/p>\n<pre><code class=\"cs\">public class ECSComponent : MonoBehaviour {     private void Awake()     {         ECSInstance.Instance().Components.Add(this);     }      public void AddComponent&lt;T>(T component) where T: ECSComponent     {         gameObject.AddComponent&lt;T>();         ECSInstance.Instance().Components.Add(component);     }      public void RemoveComponent&lt;T>(T component) where T: ECSComponent     {         ECSInstance.Instance().Components.Remove(component);         Destroy(component);     } }<\/code><\/pre>\n<p>\u042d\u0442\u043e, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043d\u0435\u0443\u0434\u043e\u0431\u0441\u0442\u0432\u043e, \u0442\u0430\u043a \u043a\u0430\u043a \u0442\u0430\u043a\u0438\u0435 \u0432\u0430\u0436\u043d\u044b\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b \u043a\u0430\u043a transform, renderer, \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b Unity \u043d\u0435 \u0432\u0445\u043e\u0434\u044f\u0442 \u0432 \u0441\u043f\u0438\u0441\u043e\u043a \u0438 \u043d\u0438\u043a\u0430\u043a \u043d\u0435 \u0441\u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043e\u0442\u0442\u0443\u0434\u0430 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u044b. \u041e\u0434\u043d\u0430\u043a\u043e, \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0435\u043c \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043a gameObject \u043d\u0430\u0448\u0438\u0445 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 \u043c\u044b \u0432\u043f\u043e\u043b\u043d\u0435 \u0441\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c\u0441\u044f.<\/p>\n<p>\u041d\u0430\u043a\u043e\u043d\u0435\u0446, ECSSystem &#8212; \u0441\u0443\u043f\u0435\u0440\u043a\u043b\u0430\u0441\u0441 \u0441\u0438\u0441\u0442\u0435\u043c:<\/p>\n<pre><code class=\"cs\">public class IECSSystem {     public ECSService Service;        public IECSSystem(ECSService service) { Service = service; }        public virtual void Run() { }     public virtual void Init() { } }<\/code><\/pre>\n<p>\u041d\u0438\u0447\u0435\u0433\u043e \u0441\u0432\u0435\u0440\u0445\u044a\u0435\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e, \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0430\u0440\u0430 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 &#8212; \u043e\u0434\u0438\u043d \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u0441\u0442\u0430\u0440\u0442\u0435 (Unity \u0441\u0438\u0433\u043d\u0430\u043b Start Monobehaviour \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u043c), \u0430 \u0434\u0440\u0443\u0433\u043e\u0439 &#8212; \u043a\u0430\u0436\u0434\u044b\u0439 \u0444\u0440\u0435\u0439\u043c. \u0422\u0443\u0442 \u0436\u0435 \u0432\u0438\u0434\u0435\u043d \u0438 \u0441\u0435\u0440\u0432\u0438\u0441, \u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0431\u044b\u043b\u043e \u0441\u043a\u0430\u0437\u0430\u043d\u043e \u0432\u044b\u0448\u0435.<\/p>\n<p>\u041d\u0443 \u0432\u043e\u0442 \u0438 \u0432\u0441\u0451, \u0432\u0430\u043c \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u043b\u0438\u0448\u044c \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043d\u0430 \u043a\u0430\u0440\u0442\u0443 \u0432\u0430\u0448\u0435\u0433\u043e \u0431\u0443\u0434\u0443\u0449\u0435\u0433\u043e \u0432\u043e\u0438\u043d\u0430\/\u0434\u0435\u0440\u0435\u0432\u043e\/\u043f\u043e\u043b\u0442\u043e\u0440\u0430\u0448\u043a\u0443 \u043b\u0438\u043c\u043e\u043d\u0430\u0434\u0430 \u0432 \u0432\u0438\u0434\u0435 \u043f\u0443\u0441\u0442\u044b\u0448\u043a\u0438, \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0432\u043e\u0439 \u043f\u0435\u0440\u0432\u044b\u0439 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u0438\u044f) \u0438 \u0432 \u043f\u0435\u0440\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0447\u0442\u043e-\u0442\u043e \u0432\u0440\u043e\u0434\u0435&#8230;<\/p>\n<pre><code class=\"cs\">public override void Run() {     ECSFilter f = new ECSFilter();     List&lt;Movable> components = f.GetComponents&lt;Movable>();     foreach (var c in components)         UpdateComponent(c); }<\/code><\/pre>\n<p><em>\u0415\u0441\u043b\u0438 \u0432\u044b \u043e\u0446\u0435\u043d\u0438\u0442\u0435 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b, \u0432 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b \u0432\u044b\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0443\u044e \u0441\u0442\u0430\u0442\u044c\u044e, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 ECS \u0438 UI \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 Unity \u043f\u0440\u043e\u0435\u043a\u0442\u0430. \u041d\u0435\u043f\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u0436\u0434\u0451\u043c \u0432\u0430\u0448 \u0444\u0438\u0434\u0431\u0435\u043a. <\/em>\u0423\u0434\u0430\u0447\u0438 \u0432\u0430\u043c \u0432 \u0432\u0430\u0448\u0438\u0445 \u043d\u0430\u0447\u0438\u043d\u0430\u043d\u0438\u044f\u0445!<\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"v-portal\" style=\"display:none;\"><\/div>\n<\/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\/665272\/\"> https:\/\/habr.com\/ru\/post\/665272\/<\/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-333023","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/333023","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=333023"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/333023\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=333023"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=333023"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=333023"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}