{"id":358117,"date":"2024-05-21T00:04:53","date_gmt":"2024-05-21T00:04:53","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=358117"},"modified":"-0001-11-30T00:00:00","modified_gmt":"2024-05-21T00:04:53","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=358117","title":{"rendered":"<span>One-on-one. \u0414\u0435\u0432\u043b\u043e\u0433.\u00a0\u041a\u0430\u0440\u0442\u0430 \u0441\u043e \u0441\u043b\u043e\u0436\u043d\u044b\u043c \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u043c \u044d\u0444\u0444\u0435\u043a\u0442\u043e\u043c<\/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>\u041d\u0430 \u044d\u0442\u043e\u0439 \u043d\u0435\u0434\u0435\u043b\u0435 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u043b (\u0438 \u043f\u043e\u043a\u0430 \u0447\u0442\u043e \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u043b) \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433. \u0417\u0430 \u0441\u0447\u0435\u0442 \u044d\u0442\u043e\u0433\u043e \u0431\u044b\u0441\u0442\u0440\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u043b \u043a\u0430\u0440\u0442\u0443, \u043d\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0440\u0430\u043d\u044c\u0448\u0435 \u0443\u0448\u043b\u0430 \u0431\u044b \u043a\u0443\u0447\u0430 \u0432\u0440\u0435\u043c\u0435\u043d\u0438.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/9f1\/565\/0c8\/9f15650c8f93e6b8d411606575e1652a.gif\" width=\"1513\" height=\"851\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/9f1\/565\/0c8\/9f15650c8f93e6b8d411606575e1652a.gif\"\/><\/figure>\n<h3>\u0412\u0432\u043e\u0434\u043d\u0430\u044f \u0438\u043d\u0444\u0430<\/h3>\n<p>\u0414\u0435\u043b\u0430\u044e \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u043e\u043d\u043d\u0443\u044e \u043a\u0430\u0440\u0442\u043e\u0447\u043d\u0443\u044e PvP-\u0438\u0433\u0440\u0443 \u043d\u0430 Unity \u0438 C#.\u00a0<a href=\"https:\/\/github.com\/nigylam\/One-on-one\" rel=\"noopener noreferrer nofollow\">\u0413\u0438\u0442\u0445\u0430\u0431<\/a>.<\/p>\n<h3>\u0427\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u043b<\/h3>\n<p>\u0414\u043e\u0431\u0430\u0432\u0438\u043b \u043a\u0430\u0440\u0442\u0443 \u0441 \u044d\u0444\u0444\u0435\u043a\u0442\u043e\u043c: &#171;\u0421\u0431\u0440\u043e\u0441\u044c\u0442\u0435 \u043a\u0430\u0440\u0442\u0443 \u0441\u043e \u0441\u0432\u043e\u0435\u0439 \u0440\u0443\u043a\u0438. \u0415\u0441\u043b\u0438 \u044d\u0442\u043e \u0430\u0442\u0430\u043a\u0430, \u043d\u0430\u043d\u043e\u0441\u0438\u0442 9 \u0443\u0440\u043e\u043d\u0430&#187;. \u0422\u043e \u0435\u0441\u0442\u044c, \u043a\u0430\u0440\u0442\u0430 \u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u043d\u0435\u0441\u0442\u0438 \u0438\u043b\u0438 \u043d\u0435 \u043d\u0430\u043d\u0435\u0441\u0442\u0438 \u0443\u0440\u043e\u043d \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a\u0443\u044e \u043a\u0430\u0440\u0442\u0443 \u044f \u0441\u0431\u0440\u043e\u0441\u0438\u043b \u0441\u043e \u0441\u0432\u043e\u0435\u0439 \u0440\u0443\u043a\u0438. \u0420\u0430\u043d\u044c\u0448\u0435 \u044f \u0431\u044b \u043d\u0435 \u0437\u043d\u0430\u043b, \u043a\u0430\u043a \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c. \u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u0443 \u043c\u0435\u043d\u044f \u0435\u0441\u0442\u044c \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0438\u0432\u0435\u043d\u0442\u043e\u0432, \u043f\u0440\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u043a\u043e\u0442\u043e\u0440\u043e\u0439 <a href=\"https:\/\/habr.com\/en\/articles\/767436\/\" rel=\"noopener noreferrer nofollow\">\u044f \u043f\u0438\u0441\u0430\u043b \u043d\u0430 \u043f\u0440\u043e\u0448\u043b\u043e\u0439 \u043d\u0435\u0434\u0435\u043b\u0435<\/a>. \u042f \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u044e \u0442\u0438\u043f \u043a\u0430\u0440\u0442\u044b \u0438\u0437 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0433\u043e \u0438\u0432\u0435\u043d\u0442\u0430 \u0432 \u0441\u0442\u0430\u043a\u0435 \u0438 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043d\u0435\u0433\u043e \u0440\u0435\u0448\u0430\u044e, \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u043b\u0438 \u043d\u0430\u043d\u0435\u0441\u0435\u043d\u0438\u0435 \u0443\u0440\u043e\u043d\u0430:<\/p>\n<pre><code class=\"cs\">if (cardManager.eventStack.Peek().Card.GetComponent&lt;CardScript>().cardType == CardScript.CardType.Attack)                 {                     cardScript.otherSide.DealDamage(cardScript.finalDamage);                 }                 cardScript.playerActionCompleted = true;                 break; <\/code><\/pre>\n<p>\u0418\u0437 \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433\u0430: \u0442\u0435\u043f\u0435\u0440\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u043e \u043a\u0430\u0436\u0434\u043e\u0439 \u043a\u0430\u0440\u0442\u0435 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0441\u043a\u0440\u0438\u043f\u0442:<\/p>\n<pre><code class=\"cs\">public class CardData : MonoBehaviour {     public Dictionary&lt;string, Card> cardDictionary = new Dictionary&lt;string, Card>();      void Awake()     {         cardDictionary[\"BlueAttack1\"] = new Card {Damage = 5 };         cardDictionary[\"BlueAttack2\"] = new Card { Mana = 1, Damage = 4, DrawCards = 2 };         cardDictionary[\"BlueDefend1\"] = new Card { Block = 6 };         cardDictionary[\"RedAttack1\"] = new Card { Damage = 6 };         cardDictionary[\"RedAttack2\"] = new Card { Damage = 12, Mana = 2 };         cardDictionary[\"RedDefend1\"] = new Card { Block = 5 };         cardDictionary[\"RedPower1\"] = new Card { GainStrength = 1, Mana = 1 };         cardDictionary[\"GraySkill1\"] = new Card { IsSpecial = true, DrawCards = 2 };         cardDictionary[\"GraySkill2\"] = new Card { AddCardBuff = 1 };         cardDictionary[\"BlueAttack3\"] = new Card { IsSpecial = true, Damage = 9, Mana = 1 };         cardDictionary[\"BlueSkill1\"] = new Card { IsSpecial = true, Mana = 1 };     } }  public class Card {     public int Mana = 0;     public bool IsSpecial = false;     public int Damage = 0;     public int Block = 0;     public int GainStrength = 0;     public int GainDexterity = 0;     public int DrawCards = 0;     public int AddCardBuff = 0; }<\/code><\/pre>\n<p>\u0417\u043d\u0430\u044e, \u0447\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043a\u043e\u043b\u0445\u043e\u0437\u043d\u043e \u0438 \u0442\u0443\u0442 \u0432\u0440\u043e\u0434\u0435 \u043a\u0430\u043a \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431. \u041d\u043e \u0440\u0430\u043d\u044c\u0448\u0435 \u0443 \u043c\u0435\u043d\u044f \u0432\u043e\u043e\u0431\u0449\u0435 \u0432\u0441\u0435 \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0441\u0442\u0438\u043a\u0438 \u0432\u044b\u0442\u0430\u0441\u043a\u0438\u0432\u0430\u043b\u0438\u0441\u044c \u0438\u0437 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043a\u0430\u0440\u0442\u044b, \u0445\u0440\u0430\u043d\u044f\u0449\u0435\u0433\u043e\u0441\u044f \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 \u043b\u043e\u043a\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438, \u0432\u043e\u0442 \u0442\u0430\u043a\u0438\u043c \u0432\u043e\u0442 \u043a\u0440\u0438\u0432\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c. \u041c\u043d\u0435 \u044d\u0442\u043e \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u043e\u0441\u0442\u044b\u043c, \u0447\u0442\u043e\u0431\u044b \u0440\u0430\u0437\u043c\u0435\u0447\u0430\u0442\u044c \u0432 \u043a\u0430\u0440\u0442\u0430\u0445, \u0433\u0434\u0435 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0431\u043b\u043e\u043a, \u0433\u0434\u0435 \u0443\u0440\u043e\u043d \u0438 \u0442.\u0434. :))<\/p>\n<pre><code class=\"cs\">     if (cardDescriptionDynamic.Contains(\"[\"))             {                 int firstSym = cardDescriptionDynamic.IndexOf('[');                 int secondSym = cardDescriptionDynamic.IndexOf(']');                 string damage = \"\";                 for (int i = firstSym + 1; i &lt; secondSym; i++)                 {                     damage += cardDescriptionDynamic[i];                 }                 cardDamage = Int32.Parse(damage);                 cardDescriptionDynamic = cardDescriptionDynamic.Replace(\"[\", \"\");                 cardDescriptionDynamic = cardDescriptionDynamic.Replace(\"]\", \"\");                 finalDamage = cardDamage + cardSide.Strength;                 cardDescriptionDynamic = cardDescriptionDynamic.Replace(damage, finalDamage.ToString());                 if (cardSide.Strength != 0)                 {                     string coloredDamage = \"&lt;color=\" + (cardSide.Strength > 0 ? \"green\" : \"red\") + \">\" + finalDamage.ToString() + \"&lt;\/color>\";                     cardDescriptionDynamic = cardDescriptionDynamic.Replace(finalDamage.ToString(), coloredDamage);                 }             }<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u044d\u0442\u043e \u0432\u0441\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0437\u0430\u0431\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 \u043b\u043e\u043a\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0438 \u043f\u043e\u0434\u0441\u0432\u0435\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/683\/447\/cf8\/683447cf84091253da4e9673583b6d7a.png\" width=\"1031\" height=\"106\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/683\/447\/cf8\/683447cf84091253da4e9673583b6d7a.png\"\/><\/figure>\n<hr\/>\n<p>\u042d\u0442\u043e\u0442 \u043f\u043e\u0441\u0442 \u0432\u0445\u043e\u0434\u0438\u0442 \u0432 \u0446\u0438\u043a\u043b \u043f\u043e\u0441\u0442\u043e\u0432 \u043f\u0440\u043e \u0438\u0433\u0440\u0443, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u044f \u043f\u043e\u0442\u0438\u0445\u043e\u043d\u044c\u043a\u0443 \u0434\u0435\u043b\u0430\u044e \u0443\u0436\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043c\u0435\u0441\u044f\u0446\u0435\u0432. \u042f \u0434\u0435\u043b\u044e\u0441\u044c \u0432\u0441\u0435\u043c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u043c: \u043a\u0430\u043a\u0438\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u044f \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044e \u0432 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435, \u0433\u0435\u0439\u043c\u0434\u0438\u0437\u0430\u0439\u043d\u0435, \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0435, \u0430\u0440\u0442\u0435 \u0438 \u0434\u0440\u0443\u0433\u0438\u0445 \u0441\u0444\u0435\u0440\u0430\u0445. \u041f\u043e\u0434\u043f\u0438\u0441\u044b\u0432\u0430\u0439\u0442\u0435\u0441\u044c \u0442\u0443\u0442 \u0438\u043b\u0438 \u0432 \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c-\u043a\u0430\u043d\u0430\u043b\u0435: <a href=\"https:\/\/t.me\/+SNA0S4OFHIJmODNi\" rel=\"noopener noreferrer nofollow\">@nigylam_blog<\/a>.<\/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\/articles\/768958\/\"> https:\/\/habr.com\/ru\/articles\/768958\/<\/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>\u041d\u0430 \u044d\u0442\u043e\u0439 \u043d\u0435\u0434\u0435\u043b\u0435 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u043b (\u0438 \u043f\u043e\u043a\u0430 \u0447\u0442\u043e \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u043b) \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433. \u0417\u0430 \u0441\u0447\u0435\u0442 \u044d\u0442\u043e\u0433\u043e \u0431\u044b\u0441\u0442\u0440\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u043b \u043a\u0430\u0440\u0442\u0443, \u043d\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0440\u0430\u043d\u044c\u0448\u0435 \u0443\u0448\u043b\u0430 \u0431\u044b \u043a\u0443\u0447\u0430 \u0432\u0440\u0435\u043c\u0435\u043d\u0438.<\/p>\n<figure class=\"full-width\"><\/figure>\n<h3>\u0412\u0432\u043e\u0434\u043d\u0430\u044f \u0438\u043d\u0444\u0430<\/h3>\n<p>\u0414\u0435\u043b\u0430\u044e \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u043e\u043d\u043d\u0443\u044e \u043a\u0430\u0440\u0442\u043e\u0447\u043d\u0443\u044e PvP-\u0438\u0433\u0440\u0443 \u043d\u0430 Unity \u0438 C#.\u00a0<a href=\"https:\/\/github.com\/nigylam\/One-on-one\" rel=\"noopener noreferrer nofollow\">\u0413\u0438\u0442\u0445\u0430\u0431<\/a>.<\/p>\n<h3>\u0427\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u043b<\/h3>\n<p>\u0414\u043e\u0431\u0430\u0432\u0438\u043b \u043a\u0430\u0440\u0442\u0443 \u0441 \u044d\u0444\u0444\u0435\u043a\u0442\u043e\u043c: &#171;\u0421\u0431\u0440\u043e\u0441\u044c\u0442\u0435 \u043a\u0430\u0440\u0442\u0443 \u0441\u043e \u0441\u0432\u043e\u0435\u0439 \u0440\u0443\u043a\u0438. \u0415\u0441\u043b\u0438 \u044d\u0442\u043e \u0430\u0442\u0430\u043a\u0430, \u043d\u0430\u043d\u043e\u0441\u0438\u0442 9 \u0443\u0440\u043e\u043d\u0430&#187;. \u0422\u043e \u0435\u0441\u0442\u044c, \u043a\u0430\u0440\u0442\u0430 \u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u043d\u0435\u0441\u0442\u0438 \u0438\u043b\u0438 \u043d\u0435 \u043d\u0430\u043d\u0435\u0441\u0442\u0438 \u0443\u0440\u043e\u043d \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a\u0443\u044e \u043a\u0430\u0440\u0442\u0443 \u044f \u0441\u0431\u0440\u043e\u0441\u0438\u043b \u0441\u043e \u0441\u0432\u043e\u0435\u0439 \u0440\u0443\u043a\u0438. \u0420\u0430\u043d\u044c\u0448\u0435 \u044f \u0431\u044b \u043d\u0435 \u0437\u043d\u0430\u043b, \u043a\u0430\u043a \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c. \u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u0443 \u043c\u0435\u043d\u044f \u0435\u0441\u0442\u044c \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0438\u0432\u0435\u043d\u0442\u043e\u0432, \u043f\u0440\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u043a\u043e\u0442\u043e\u0440\u043e\u0439 <a href=\"https:\/\/habr.com\/en\/articles\/767436\/\" rel=\"noopener noreferrer nofollow\">\u044f \u043f\u0438\u0441\u0430\u043b \u043d\u0430 \u043f\u0440\u043e\u0448\u043b\u043e\u0439 \u043d\u0435\u0434\u0435\u043b\u0435<\/a>. \u042f \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u044e \u0442\u0438\u043f \u043a\u0430\u0440\u0442\u044b \u0438\u0437 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0433\u043e \u0438\u0432\u0435\u043d\u0442\u0430 \u0432 \u0441\u0442\u0430\u043a\u0435 \u0438 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043d\u0435\u0433\u043e \u0440\u0435\u0448\u0430\u044e, \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u043b\u0438 \u043d\u0430\u043d\u0435\u0441\u0435\u043d\u0438\u0435 \u0443\u0440\u043e\u043d\u0430:<\/p>\n<pre><code class=\"cs\">if (cardManager.eventStack.Peek().Card.GetComponent&lt;CardScript>().cardType == CardScript.CardType.Attack)                 {                     cardScript.otherSide.DealDamage(cardScript.finalDamage);                 }                 cardScript.playerActionCompleted = true;                 break; <\/code><\/pre>\n<p>\u0418\u0437 \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433\u0430: \u0442\u0435\u043f\u0435\u0440\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u043e \u043a\u0430\u0436\u0434\u043e\u0439 \u043a\u0430\u0440\u0442\u0435 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0441\u043a\u0440\u0438\u043f\u0442:<\/p>\n<pre><code class=\"cs\">public class CardData : MonoBehaviour {     public Dictionary&lt;string, Card> cardDictionary = new Dictionary&lt;string, Card>();      void Awake()     {         cardDictionary[\"BlueAttack1\"] = new Card {Damage = 5 };         cardDictionary[\"BlueAttack2\"] = new Card { Mana = 1, Damage = 4, DrawCards = 2 };         cardDictionary[\"BlueDefend1\"] = new Card { Block = 6 };         cardDictionary[\"RedAttack1\"] = new Card { Damage = 6 };         cardDictionary[\"RedAttack2\"] = new Card { Damage = 12, Mana = 2 };         cardDictionary[\"RedDefend1\"] = new Card { Block = 5 };         cardDictionary[\"RedPower1\"] = new Card { GainStrength = 1, Mana = 1 };         cardDictionary[\"GraySkill1\"] = new Card { IsSpecial = true, DrawCards = 2 };         cardDictionary[\"GraySkill2\"] = new Card { AddCardBuff = 1 };         cardDictionary[\"BlueAttack3\"] = new Card { IsSpecial = true, Damage = 9, Mana = 1 };         cardDictionary[\"BlueSkill1\"] = new Card { IsSpecial = true, Mana = 1 };     } }  public class Card {     public int Mana = 0;     public bool IsSpecial = false;     public int Damage = 0;     public int Block = 0;     public int GainStrength = 0;     public int GainDexterity = 0;     public int DrawCards = 0;     public int AddCardBuff = 0; }<\/code><\/pre>\n<p>\u0417\u043d\u0430\u044e, \u0447\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043a\u043e\u043b\u0445\u043e\u0437\u043d\u043e \u0438 \u0442\u0443\u0442 \u0432\u0440\u043e\u0434\u0435 \u043a\u0430\u043a \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431. \u041d\u043e \u0440\u0430\u043d\u044c\u0448\u0435 \u0443 \u043c\u0435\u043d\u044f \u0432\u043e\u043e\u0431\u0449\u0435 \u0432\u0441\u0435 \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0441\u0442\u0438\u043a\u0438 \u0432\u044b\u0442\u0430\u0441\u043a\u0438\u0432\u0430\u043b\u0438\u0441\u044c \u0438\u0437 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043a\u0430\u0440\u0442\u044b, \u0445\u0440\u0430\u043d\u044f\u0449\u0435\u0433\u043e\u0441\u044f \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 \u043b\u043e\u043a\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438, \u0432\u043e\u0442 \u0442\u0430\u043a\u0438\u043c \u0432\u043e\u0442 \u043a\u0440\u0438\u0432\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c. \u041c\u043d\u0435 \u044d\u0442\u043e \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u043e\u0441\u0442\u044b\u043c, \u0447\u0442\u043e\u0431\u044b \u0440\u0430\u0437\u043c\u0435\u0447\u0430\u0442\u044c \u0432 \u043a\u0430\u0440\u0442\u0430\u0445, \u0433\u0434\u0435 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0431\u043b\u043e\u043a, \u0433\u0434\u0435 \u0443\u0440\u043e\u043d \u0438 \u0442.\u0434. :))<\/p>\n<pre><code class=\"cs\">     if (cardDescriptionDynamic.Contains(\"[\"))             {                 int firstSym = cardDescriptionDynamic.IndexOf('[');                 int secondSym = cardDescriptionDynamic.IndexOf(']');                 string damage = \"\";                 for (int i = firstSym + 1; i &lt; secondSym; i++)                 {                     damage += cardDescriptionDynamic[i];                 }                 cardDamage = Int32.Parse(damage);                 cardDescriptionDynamic = cardDescriptionDynamic.Replace(\"[\", \"\");                 cardDescriptionDynamic = cardDescriptionDynamic.Replace(\"]\", \"\");                 finalDamage = cardDamage + cardSide.Strength;                 cardDescriptionDynamic = cardDescriptionDynamic.Replace(damage, finalDamage.ToString());                 if (cardSide.Strength != 0)                 {                     string coloredDamage = \"&lt;color=\" + (cardSide.Strength > 0 ? \"green\" : \"red\") + \">\" + finalDamage.ToString() + \"&lt;\/color>\";                     cardDescriptionDynamic = cardDescriptionDynamic.Replace(finalDamage.ToString(), coloredDamage);                 }             }<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u044d\u0442\u043e \u0432\u0441\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0437\u0430\u0431\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 \u043b\u043e\u043a\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0438 \u043f\u043e\u0434\u0441\u0432\u0435\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438:<\/p>\n<figure class=\"full-width\"><\/figure>\n<hr\/>\n<p>\u042d\u0442\u043e\u0442 \u043f\u043e\u0441\u0442 \u0432\u0445\u043e\u0434\u0438\u0442 \u0432 \u0446\u0438\u043a\u043b \u043f\u043e\u0441\u0442\u043e\u0432 \u043f\u0440\u043e \u0438\u0433\u0440\u0443, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u044f \u043f\u043e\u0442\u0438\u0445\u043e\u043d\u044c\u043a\u0443 \u0434\u0435\u043b\u0430\u044e \u0443\u0436\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043c\u0435\u0441\u044f\u0446\u0435\u0432. \u042f \u0434\u0435\u043b\u044e\u0441\u044c \u0432\u0441\u0435\u043c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u043c: \u043a\u0430\u043a\u0438\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u044f \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044e \u0432 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435, \u0433\u0435\u0439\u043c\u0434\u0438\u0437\u0430\u0439\u043d\u0435, \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0435, \u0430\u0440\u0442\u0435 \u0438 \u0434\u0440\u0443\u0433\u0438\u0445 \u0441\u0444\u0435\u0440\u0430\u0445. \u041f\u043e\u0434\u043f\u0438\u0441\u044b\u0432\u0430\u0439\u0442\u0435\u0441\u044c \u0442\u0443\u0442 \u0438\u043b\u0438 \u0432 \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c-\u043a\u0430\u043d\u0430\u043b\u0435: <a href=\"https:\/\/t.me\/+SNA0S4OFHIJmODNi\" rel=\"noopener noreferrer nofollow\">@nigylam_blog<\/a>.<\/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\/articles\/768958\/\"> https:\/\/habr.com\/ru\/articles\/768958\/<\/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-358117","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/358117","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=358117"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/358117\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=358117"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=358117"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=358117"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}