{"id":357481,"date":"2024-05-20T23:51:50","date_gmt":"2024-05-20T23:51:50","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=357481"},"modified":"-0001-11-30T00:00:00","modified_gmt":"2024-05-20T23:51:50","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=357481","title":{"rendered":"<span>One-on-one. \u0414\u0435\u0432\u043b\u043e\u0433.\u00a0\u041e\u0442\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043b\u043e\u0433\u0438\u043a\u0438 \u043e\u0442 \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0439 \u0438 \u043f\u0435\u0440\u0435\u0445\u043e\u0434 \u043d\u0430 \u0438\u0432\u0435\u043d\u0442\u044b<\/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 \u043d\u0435 \u0434\u0435\u043b\u0430\u043b \u043d\u043e\u0432\u044b\u0435 \u0444\u0438\u0447\u0438, \u0437\u0430\u0442\u043e \u043d\u0430\u043a\u043e\u043d\u0435\u0446 \u0441\u0434\u0435\u043b\u0430\u043b \u0431\u043e\u043b\u0435\u0435 \u0443\u0434\u043e\u0431\u043d\u0443\u044e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443. \u042d\u0442\u043e \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0432 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c.<\/p>\n<div class=\"tm-iframe_temp\" data-src=\"https:\/\/embedd.srv.habr.com\/iframe\/652a41de2fbe8876a61d732f\" data-style=\"\" id=\"652a41de2fbe8876a61d732f\" width=\"\"><\/div>\n<h2>\u0412\u0432\u043e\u0434\u043d\u0430\u044f \u0438\u043d\u0444\u0430<\/h2>\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#. <a href=\"https:\/\/github.com\/nigylam\/One-on-one\" rel=\"noopener noreferrer nofollow\">\u0413\u0438\u0442\u0445\u0430\u0431<\/a>.<\/p>\n<h2>\u0427\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u043b<\/h2>\n<p>\u0420\u0430\u043d\u044c\u0448\u0435 \u0443 \u043c\u0435\u043d\u044f \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0438 \u0431\u044b\u043b\u0438 \u043d\u0430\u043c\u0435\u0440\u0442\u0432\u043e \u043f\u0440\u0438\u0431\u0438\u0442\u044b \u043a \u043b\u043e\u0433\u0438\u043a\u0435. \u042f \u043f\u043e\u043b\u0443\u0447\u0430\u043b \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438, \u0447\u0442\u043e \u044d\u0442\u043e \u0432\u043e\u043e\u0431\u0449\u0435-\u0442\u043e \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u0445\u043e\u0440\u043e\u0448\u043e, \u043d\u043e \u0441\u0430\u043c \u043c\u0438\u043d\u0443\u0441\u043e\u0432 \u043d\u0435 \u043d\u0430\u0445\u043e\u0434\u0438\u043b. \u041f\u043e\u043a\u0430 \u043d\u0435 \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0441\u044f \u0441 \u0437\u0430\u0434\u0430\u0447\u0435\u0439, \u0433\u0434\u0435 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043b\u043e\u0441\u044c \u043c\u043e\u043c\u0435\u043d\u0442\u0430\u043b\u044c\u043d\u0430\u044f \u0440\u0430\u0431\u043e\u0442\u0430 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0447\u0430\u0441\u0442\u0438, \u0430 \u043e\u043d\u0430 \u0443 \u043c\u0435\u043d\u044f \u043f\u0440\u0438\u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u043b\u0430\u0441\u044c, \u043f\u043e\u0434\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u044f\u0441\u044c \u043f\u043e\u0434 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0439.<\/p>\n<p>\u0420\u0430\u043d\u044c\u0448\u0435 \u0431\u044b\u043b\u043e \u0432\u043e\u0442 \u0442\u0430\u043a. \u0427\u0442\u043e\u0431\u044b \u0443 \u043c\u0435\u043d\u044f \u043a\u0430\u0440\u0442\u044b \u0432\u044b\u0441\u043a\u0430\u043a\u0438\u0432\u0430\u043b\u0438 \u043f\u043e \u043e\u0434\u043d\u043e\u0439 \u0438\u0437 \u043a\u043e\u043b\u043e\u0434\u044b, \u044f \u043f\u0440\u0438\u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u043b \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439:<\/p>\n<pre><code class=\"cs\">   public IEnumerator DrawingCard(Side side, int amountOfCards = 5, float pauseTime = 0)     {         yield return new WaitForSeconds(pauseTime);         int i = side.TableCards.Count;         while (side.TableCards.Count &lt; amountOfCards + i)         {             if (side.Cards.Count == 0)             {                 shuffledComplete = false;                 StartCoroutine(ShufflingDeck(side));                 yield return new WaitUntil(() => shuffledComplete == true);             }             GameObject card = side.Cards[0];             \/\/card.transform.localPosition = side.StartPosition;             side.TableCards.Add(card);             side.Cards.RemoveAt(0);             yield return new WaitForSecondsRealtime(.3f);         }     }<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0443 \u043c\u0435\u043d\u044f DrawCard &#8212; \u044d\u0442\u043e \u043c\u0435\u0442\u043e\u0434 \u0432 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u043a\u043e\u0434\u0430 \u0438 \u0442\u0430\u043c \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u043a\u0430\u0440\u0442\u044b \u0438\u0437 \u043e\u0434\u043d\u043e\u0433\u043e \u0441\u043f\u0438\u0441\u043a\u0430 \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0432 \u0434\u0440\u0443\u0433\u043e\u0439. \u041d\u0443, \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0430 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0433\u043e \u0438\u0432\u0435\u043d\u0442\u0430:<\/p>\n<pre><code class=\"cs\">    public void DrawCard(GameObject card)     {         TableCards.Add(card);         Cards.Remove(card);         CardAction?.Invoke(card, this, CardActionType.Draw);     }       public void DrawCards()     {         DrawCards(StartDrawCards);     }      public void DrawCards(int numberOfCards)     {         int i = TableCards.Count;         while (TableCards.Count &lt; numberOfCards + i)         {             if (Cards.Count == 0)             {                 ShufflingDrawDeck();                 CardAction?.Invoke(null, this, CardActionType.Shuffle);             }             GameObject card = Cards[0];             DrawCard(card);         }     }<\/code><\/pre>\n<p>\u0412\u0441\u0435 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0435 \u0432 \u0441\u043a\u0440\u0438\u043f\u0442\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0438. \u0422\u0430\u043c \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u0438\u0437 \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u043e\u0438\u0433\u0440\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0434\u0440\u0443\u0433 \u0437\u0430 \u0434\u0440\u0443\u0433\u043e\u043c. \u0414\u0430, \u0437\u043d\u0430\u044e, else if \u0442\u0443\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043f\u043e-\u043a\u043e\u043b\u0445\u043e\u0437\u043d\u043e\u043c\u0443, \u043d\u043e \u043f\u043e\u043a\u0430 \u043d\u0435 \u0437\u043d\u0430\u044e \u0440\u0435\u0448\u0435\u043d\u0438\u044f, \u043a\u0430\u043a \u044d\u0442\u043e \u0441\u043e\u043a\u0440\u0430\u0442\u0438\u0442\u044c, \u0430 \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c\u0441\u044f \u0431\u044b\u043b\u043e \u043b\u0435\u043d\u044c:<\/p>\n<pre><code class=\"cs\">    void Update()     {         if (!isProcessingQueue &amp;&amp; eventQueue.Count > 0)         {             StartCoroutine(ProcessEventQueue());         }     }      IEnumerator ProcessEventQueue()     {         isProcessingQueue = true;         CardEvent cardEvent = eventQueue.Dequeue();                  if (cardEvent.ActionType == CardActionType.Draw)         {             PlayDrawAnimation(cardEvent.Card, cardEvent.TriggeringSide);         }         else if (cardEvent.ActionType == CardActionType.Discard)         {             PlayDiscardAnimation(cardEvent.Card, cardEvent.TriggeringSide);         }         else if (cardEvent.ActionType == CardActionType.Shuffle)         {             PlayShuffleAnimation(cardEvent.TriggeringSide);         }         else if (cardEvent.ActionType == CardActionType.Burn)         {             PlayBurnAnimation(cardEvent.Card, cardEvent.TriggeringSide);         }         yield return new WaitForSeconds(0.3f);         isProcessingQueue = false;     }      void PlayDrawAnimation(GameObject card, Side side)     {         side.DoubleTableCards.Add(card);         card.transform.localPosition = side.StartPosition;         CalculateTableCardsPosition(side);         side.DrawCounter--;     }      void OnCardAction(GameObject card, Side side, CardActionType cardActionType)     {         eventQueue.Enqueue(new CardEvent(card, cardActionType, side));     }<\/code><\/pre>\n<p>\u0414\u043e\u043b\u0433\u043e \u0431\u043e\u0440\u043e\u043b\u0441\u044f \u0441 \u044d\u0442\u0438\u043c \u0431\u0430\u0433\u043e\u043c: \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u0442\u0430\u0441\u043e\u0432\u043a\u0435 \u043a\u043e\u043b\u043e\u0434\u044b \u043a\u0430\u0440\u0442\u044b \u0432\u044b\u043b\u0435\u0442\u0430\u044e\u0442 \u0438\u0437 \u0441\u0442\u043e\u043f\u043a\u0438 \u0441\u0431\u0440\u043e\u0441\u0430, \u0445\u043e\u0442\u044f \u0434\u043e\u043b\u0436\u043d\u044b \u043a\u0430\u043a \u0431\u044b \u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0432 \u0441\u0442\u043e\u043f\u043a\u0435 \u0432\u044b\u0434\u0430\u0447\u0438:<\/p>\n<div class=\"tm-iframe_temp\" data-src=\"https:\/\/embedd.srv.habr.com\/iframe\/652a41417f26cf30b3f3e892\" data-style=\"\" id=\"652a41417f26cf30b3f3e892\" width=\"\"><\/div>\n<p>\u0420\u0435\u0448\u0435\u043d\u0438\u0435 \u043d\u0430\u0448\u0435\u043b \u0441\u0443\u043f\u0435\u0440 \u043f\u0440\u043e\u0441\u0442\u043e\u0435. \u041a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437, \u043a\u043e\u0433\u0434\u0430 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u044f \u0432\u044b\u0442\u0430\u0441\u043a\u0438\u0432\u0430\u043d\u0438\u044f \u043a\u0430\u0440\u0442\u044b, \u044f \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043a\u0430\u0440\u0442\u0443 \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0430\u044e \u0432 \u043d\u0443\u0436\u043d\u043e\u0435 \u043c\u0435\u0441\u0442\u043e:<\/p>\n<pre><code class=\"cs\">    void PlayDrawAnimation(GameObject card, Side side)     {         side.DoubleTableCards.Add(card);         card.transform.localPosition = side.StartPosition; \/\/ \u0432\u043e\u0442 \u044d\u0442\u0430 \u0441\u0442\u0440\u043e\u0447\u043a\u0430         CalculateTableCardsPosition(side);         side.DrawCounter--;     } <\/code><\/pre>\n<p>\u041a\u0430\u043a \u043c\u043e\u0436\u0435\u0442\u0435 \u0432\u0438\u0434\u0435\u0442\u044c, \u0432\u0441\u0435 \u0440\u0430\u0432\u043d\u043e \u0443 \u043c\u0435\u043d\u044f \u043b\u043e\u0433\u0438\u043a\u0430 \u0438 \u0432\u0438\u0437\u0443\u0430\u043b \u0435\u0449\u0435 \u0441\u043c\u0435\u0448\u0430\u043d\u044b. \u0412 \u043a\u043b\u0430\u0441\u0441\u0435 Side \u043f\u043e\u043c\u0438\u043c\u043e \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u044f \u0445\u0440\u0430\u043d\u044e \u0435\u0449\u0435 \u043f\u043e\u0437\u0438\u0446\u0438\u0438 \u043a\u0430\u0440\u0442 (\u0434\u043b\u044f \u0441\u0442\u043e\u043f\u043a\u0438 \u0432\u044b\u0434\u0430\u0447\u0438 \u0438 \u0441\u0442\u043e\u043f\u043a\u0438 \u0441\u0431\u0440\u043e\u0441\u0430) \u0438 \u0434\u0443\u0431\u043b\u044c \u0441\u043f\u0438\u0441\u043a\u0430 TableCards. \u041e\u0442 DoubleTableCards \u043f\u043e\u043a\u0430 \u043d\u0435 \u0437\u043d\u0430\u044e, \u043a\u0430\u043a \u0438\u0437\u0431\u0430\u0432\u0438\u0442\u044c\u0441\u044f: \u043e\u043d \u043d\u0443\u0436\u0435\u043d, \u0447\u0442\u043e\u0431\u044b \u0441\u043e\u0431\u0438\u0440\u0430\u0442\u044c \u0432 \u043d\u0435\u0433\u043e \u043a\u0430\u0440\u0442\u044b \u0441 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043a\u043e\u043c \u0438 \u043a\u0440\u0430\u0441\u0438\u0432\u043e \u0432\u044b\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c \u043d\u0430 \u044d\u043a\u0440\u0430\u043d\u0435. \u0420\u0430\u043d\u044c\u0448\u0435 \u0443 \u043c\u0435\u043d\u044f \u044d\u0442\u043e\u0442 \u043c\u0435\u0442\u043e\u0434 \u0440\u0430\u0431\u043e\u0442\u0430\u043b \u0441 TableCards, \u043d\u043e \u043f\u0440\u0438 \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u043b\u043e\u0433\u0438\u043a\u0435 \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u0435 \u0432\u0441\u0435\u0445 \u043a\u0430\u0440\u0442 \u043d\u0430 \u044d\u043a\u0440\u0430\u043d\u0435 \u043f\u0440\u0438 \u0432\u044b\u0434\u0430\u0447\u0435 \u0431\u0443\u0434\u0435\u0442 \u043c\u043e\u043c\u0435\u043d\u0442\u0430\u043b\u044c\u043d\u044b\u043c:<\/p>\n<pre><code class=\"cs\">    public void CalculateTableCardsPosition(Side side)     {         int offset = 105;         int width = (side.DoubleTableCards.Count - 1) * offset;         int halfWidth = width \/ 2;         for (int cardIndex = 0; cardIndex &lt; side.DoubleTableCards.Count; cardIndex++)         {             GameObject Card = side.DoubleTableCards[cardIndex];             CardScript grid = Card.GetComponent&lt;CardScript>();             sprite = Card.GetComponent&lt;SpriteRenderer>();             sprite.sortingOrder = cardIndex;             float desiredX = -halfWidth + (offset * cardIndex);             grid.desiredPosition = new Vector2(desiredX, side.HandPosition);             grid.timestamp = Time.time + grid.timeBetweenMoves;             grid.startPosition = grid.desiredPosition;         }     }<\/code><\/pre>\n<p>\u0412 \u043b\u044e\u0431\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u044d\u0442\u0438 \u0448\u0442\u0443\u043a\u0438 \u043f\u043e\u043a\u0430 \u0441\u0438\u043b\u044c\u043d\u043e \u043d\u0435 \u043c\u0435\u0448\u0430\u044e\u0442. \u0410 \u0432 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0432\u0438\u0436\u0443 \u0432 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0438 \u0435\u0449\u0435 \u043e\u0434\u043d\u043e\u0439 \u043f\u0440\u043e\u0441\u043b\u043e\u0439\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u043e\u0435\u0434\u0438\u043d\u044f\u0435\u0442 \u0447\u0438\u0441\u0442\u043e \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0441 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u043d\u0430 \u044d\u043a\u0440\u0430\u043d\u0435.<\/p>\n<h2>\u0427\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u044e \u043a \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0441\u0443\u0431\u0431\u043e\u0442\u0435<\/h2>\n<p>\u041e\u0442 \u043f\u0440\u0435\u0436\u043d\u0435\u0433\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0430 \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043e\u0434\u043d\u043e\u0439 \u0444\u0438\u0447\u0438 \u043d\u0430 \u043a\u0430\u0436\u0434\u0443\u044e \u043d\u0435\u0434\u0435\u043b\u044e \u044f \u043e\u0442\u043e\u0448\u0435\u043b. \u0421\u0435\u0439\u0447\u0430\u0441 \u0445\u043e\u0447\u0443 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u044c \u043c\u0435\u043d\u044f\u0442\u044c \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443, \u0447\u0442\u043e\u0431\u044b \u0434\u0430\u043b\u044c\u0448\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043a\u0443\u0447\u0443 \u043d\u043e\u0432\u044b\u0445 \u043a\u0430\u0440\u0442 \u043b\u0435\u0433\u043a\u043e \u0438 \u0431\u044b\u0441\u0442\u0440\u043e. \u0412\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435, \u043a\u0430\u043a\u043e\u0439 \u0442\u0440\u0435\u0448 \u0432 \u043c\u0435\u0442\u043e\u0434\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u044d\u0444\u0444\u0435\u043a\u0442\u044b \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u043a\u0430\u0440\u0442\u044b. \u0417\u0430\u0439\u043c\u0443\u0441\u044c \u0432 \u043f\u0435\u0440\u0432\u0443\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u044d\u0442\u043e\u0439 \u0447\u0430\u0441\u0442\u044c\u044e:<\/p>\n<pre><code class=\"cs\">    public void DescriptionTranscription()     {         if (cardSide.Strength != lastStrength)         {             lastStrength = cardSide.Strength;             finalDamage = 0;             cardDescriptionDynamic = LocalizationSettings.StringDatabase.GetLocalizedString(cardId + \"_Description\");             \/\/string cardDescriptionDynamicWithoutTags;             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);                 }              }             if (cardDescriptionDynamic.Contains(\";\"))             {                 int firstSym = cardDescriptionDynamic.IndexOf(';');                 int secondSym = cardDescriptionDynamic.IndexOf('?');                 string block = \"\";                 for (int i = firstSym + 1; i &lt; secondSym; i++)                 {                     block += cardDescriptionDynamic[i];                 }                 cardBlock = Int32.Parse(block);                 cardDescriptionDynamic = cardDescriptionDynamic.Replace(\";\", \"\");                 cardDescriptionDynamic = cardDescriptionDynamic.Replace(\"?\", \"\");                 cardDescriptionDynamic = cardDescriptionDynamic.Replace(block, cardBlock.ToString());             }             if (cardDescriptionDynamic.Contains(\"{\"))             {                 int firstSym = cardDescriptionDynamic.IndexOf('{');                 int secondSym = cardDescriptionDynamic.IndexOf('}');                 string draw = \"\";                 for (int i = firstSym + 1; i &lt; secondSym; i++)                 {                     draw += cardDescriptionDynamic[i];                 }                 cardDraw = Int32.Parse(draw);                 cardDescriptionDynamic = cardDescriptionDynamic.Replace(\"{\", \"\");                 cardDescriptionDynamic = cardDescriptionDynamic.Replace(\"}\", \"\");                 cardDescriptionDynamic = cardDescriptionDynamic.Replace(draw, cardDraw.ToString());             }             if (cardDescriptionDynamic.Contains(\"(\"))             {                 int firstSym = cardDescriptionDynamic.IndexOf('(');                 int secondSym = cardDescriptionDynamic.IndexOf(')');                 string strength = \"\";                 for (int i = firstSym + 1; i &lt; secondSym; i++)                 {                     strength += cardDescriptionDynamic[i];                 }                 cardStrength = Int32.Parse(strength);                 cardDescriptionDynamic = cardDescriptionDynamic.Replace(\"(\", \"\");                 cardDescriptionDynamic = cardDescriptionDynamic.Replace(\")\", \"\");                 cardDescriptionDynamic = cardDescriptionDynamic.Replace(strength, cardStrength.ToString());             }         }      }<\/code><\/pre>\n<p>\u0427\u0435\u043c \u044f \u0434\u0435\u043b\u0438\u043b\u0441\u044f \u0432 \u043f\u0440\u043e\u0448\u043b\u044b\u0445 \u0434\u0435\u0432\u043b\u043e\u0433\u0430\u0445:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/dtf.ru\/indie\/2179036-one-on-one-devlog-karta-kotoraya-aktiviruet-novyy-baff\" rel=\"noopener noreferrer nofollow\">\u0414\u043e\u0431\u0430\u0432\u0438\u043b \u043d\u043e\u0432\u044b\u0439 \u0431\u0430\u0444\u0444<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/dtf.ru\/indie\/2157540-one-on-one-devlog-karta-s-kastomnym-effektom\" rel=\"noopener noreferrer nofollow\">\u0414\u043e\u0431\u0430\u0432\u0438\u043b \u043a\u0430\u0440\u0442\u0443 \u0441 \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u043c \u044d\u0444\u0444\u0435\u043a\u0442\u043e\u043c<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/dtf.ru\/indie\/2117291-one-on-one-devlog-pop-apy-dlya-kolod-i-novyy-fon\" rel=\"noopener noreferrer nofollow\">\u0414\u043e\u0431\u0430\u0432\u0438\u043b \u043f\u043e\u043f-\u0430\u043f\u044b \u0434\u043b\u044f \u043a\u043e\u043b\u043e\u0434<\/a><\/p>\n<\/li>\n<\/ul>\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\/767436\/\"> https:\/\/habr.com\/ru\/articles\/767436\/<\/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 \u043d\u0435 \u0434\u0435\u043b\u0430\u043b \u043d\u043e\u0432\u044b\u0435 \u0444\u0438\u0447\u0438, \u0437\u0430\u0442\u043e \u043d\u0430\u043a\u043e\u043d\u0435\u0446 \u0441\u0434\u0435\u043b\u0430\u043b \u0431\u043e\u043b\u0435\u0435 \u0443\u0434\u043e\u0431\u043d\u0443\u044e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443. \u042d\u0442\u043e \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0432 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c.<\/p>\n<div class=\"tm-iframe_temp\" data-src=\"https:\/\/embedd.srv.habr.com\/iframe\/652a41de2fbe8876a61d732f\" data-style=\"\" id=\"652a41de2fbe8876a61d732f\" width=\"\"><\/div>\n<h2>\u0412\u0432\u043e\u0434\u043d\u0430\u044f \u0438\u043d\u0444\u0430<\/h2>\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#. <a href=\"https:\/\/github.com\/nigylam\/One-on-one\" rel=\"noopener noreferrer nofollow\">\u0413\u0438\u0442\u0445\u0430\u0431<\/a>.<\/p>\n<h2>\u0427\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u043b<\/h2>\n<p>\u0420\u0430\u043d\u044c\u0448\u0435 \u0443 \u043c\u0435\u043d\u044f \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0438 \u0431\u044b\u043b\u0438 \u043d\u0430\u043c\u0435\u0440\u0442\u0432\u043e \u043f\u0440\u0438\u0431\u0438\u0442\u044b \u043a \u043b\u043e\u0433\u0438\u043a\u0435. \u042f \u043f\u043e\u043b\u0443\u0447\u0430\u043b \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438, \u0447\u0442\u043e \u044d\u0442\u043e \u0432\u043e\u043e\u0431\u0449\u0435-\u0442\u043e \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u0445\u043e\u0440\u043e\u0448\u043e, \u043d\u043e \u0441\u0430\u043c \u043c\u0438\u043d\u0443\u0441\u043e\u0432 \u043d\u0435 \u043d\u0430\u0445\u043e\u0434\u0438\u043b. \u041f\u043e\u043a\u0430 \u043d\u0435 \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0441\u044f \u0441 \u0437\u0430\u0434\u0430\u0447\u0435\u0439, \u0433\u0434\u0435 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043b\u043e\u0441\u044c \u043c\u043e\u043c\u0435\u043d\u0442\u0430\u043b\u044c\u043d\u0430\u044f \u0440\u0430\u0431\u043e\u0442\u0430 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0447\u0430\u0441\u0442\u0438, \u0430 \u043e\u043d\u0430 \u0443 \u043c\u0435\u043d\u044f \u043f\u0440\u0438\u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u043b\u0430\u0441\u044c, \u043f\u043e\u0434\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u044f\u0441\u044c \u043f\u043e\u0434 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0439.<\/p>\n<p>\u0420\u0430\u043d\u044c\u0448\u0435 \u0431\u044b\u043b\u043e \u0432\u043e\u0442 \u0442\u0430\u043a. \u0427\u0442\u043e\u0431\u044b \u0443 \u043c\u0435\u043d\u044f \u043a\u0430\u0440\u0442\u044b \u0432\u044b\u0441\u043a\u0430\u043a\u0438\u0432\u0430\u043b\u0438 \u043f\u043e \u043e\u0434\u043d\u043e\u0439 \u0438\u0437 \u043a\u043e\u043b\u043e\u0434\u044b, \u044f \u043f\u0440\u0438\u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u043b \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439:<\/p>\n<pre><code class=\"cs\">   public IEnumerator DrawingCard(Side side, int amountOfCards = 5, float pauseTime = 0)     {         yield return new WaitForSeconds(pauseTime);         int i = side.TableCards.Count;         while (side.TableCards.Count &lt; amountOfCards + i)         {             if (side.Cards.Count == 0)             {                 shuffledComplete = false;                 StartCoroutine(ShufflingDeck(side));                 yield return new WaitUntil(() => shuffledComplete == true);             }             GameObject card = side.Cards[0];             \/\/card.transform.localPosition = side.StartPosition;             side.TableCards.Add(card);             side.Cards.RemoveAt(0);             yield return new WaitForSecondsRealtime(.3f);         }     }<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0443 \u043c\u0435\u043d\u044f DrawCard &#8212; \u044d\u0442\u043e \u043c\u0435\u0442\u043e\u0434 \u0432 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u043a\u043e\u0434\u0430 \u0438 \u0442\u0430\u043c \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u043a\u0430\u0440\u0442\u044b \u0438\u0437 \u043e\u0434\u043d\u043e\u0433\u043e \u0441\u043f\u0438\u0441\u043a\u0430 \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0432 \u0434\u0440\u0443\u0433\u043e\u0439. \u041d\u0443, \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0430 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0433\u043e \u0438\u0432\u0435\u043d\u0442\u0430:<\/p>\n<pre><code class=\"cs\">    public void DrawCard(GameObject card)     {         TableCards.Add(card);         Cards.Remove(card);         CardAction?.Invoke(card, this, CardActionType.Draw);     }       public void DrawCards()     {         DrawCards(StartDrawCards);     }      public void DrawCards(int numberOfCards)     {         int i = TableCards.Count;         while (TableCards.Count &lt; numberOfCards + i)         {             if (Cards.Count == 0)             {                 ShufflingDrawDeck();                 CardAction?.Invoke(null, this, CardActionType.Shuffle);             }             GameObject card = Cards[0];             DrawCard(card);         }     }<\/code><\/pre>\n<p>\u0412\u0441\u0435 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0435 \u0432 \u0441\u043a\u0440\u0438\u043f\u0442\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0438. \u0422\u0430\u043c \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u0438\u0437 \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u043e\u0438\u0433\u0440\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0434\u0440\u0443\u0433 \u0437\u0430 \u0434\u0440\u0443\u0433\u043e\u043c. \u0414\u0430, \u0437\u043d\u0430\u044e, else if \u0442\u0443\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043f\u043e-\u043a\u043e\u043b\u0445\u043e\u0437\u043d\u043e\u043c\u0443, \u043d\u043e \u043f\u043e\u043a\u0430 \u043d\u0435 \u0437\u043d\u0430\u044e \u0440\u0435\u0448\u0435\u043d\u0438\u044f, \u043a\u0430\u043a \u044d\u0442\u043e \u0441\u043e\u043a\u0440\u0430\u0442\u0438\u0442\u044c, \u0430 \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c\u0441\u044f \u0431\u044b\u043b\u043e \u043b\u0435\u043d\u044c:<\/p>\n<pre><code class=\"cs\">    void Update()     {         if (!isProcessingQueue &amp;&amp; eventQueue.Count > 0)         {             StartCoroutine(ProcessEventQueue());         }     }      IEnumerator ProcessEventQueue()     {         isProcessingQueue = true;         CardEvent cardEvent = eventQueue.Dequeue();                  if (cardEvent.ActionType == CardActionType.Draw)         {             PlayDrawAnimation(cardEvent.Card, cardEvent.TriggeringSide);         }         else if (cardEvent.ActionType == CardActionType.Discard)         {             PlayDiscardAnimation(cardEvent.Card, cardEvent.TriggeringSide);         }         else if (cardEvent.ActionType == CardActionType.Shuffle)         {             PlayShuffleAnimation(cardEvent.TriggeringSide);         }         else if (cardEvent.ActionType == CardActionType.Burn)         {             PlayBurnAnimation(cardEvent.Card, cardEvent.TriggeringSide);         }         yield return new WaitForSeconds(0.3f);         isProcessingQueue = false;     }      void PlayDrawAnimation(GameObject card, Side side)     {         side.DoubleTableCards.Add(card);         card.transform.localPosition = side.StartPosition;         CalculateTableCardsPosition(side);         side.DrawCounter--;     }      void OnCardAction(GameObject card, Side side, CardActionType cardActionType)     {         eventQueue.Enqueue(new CardEvent(card, cardActionType, side));     }<\/code><\/pre>\n<p>\u0414\u043e\u043b\u0433\u043e \u0431\u043e\u0440\u043e\u043b\u0441\u044f \u0441 \u044d\u0442\u0438\u043c \u0431\u0430\u0433\u043e\u043c: \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u0442\u0430\u0441\u043e\u0432\u043a\u0435 \u043a\u043e\u043b\u043e\u0434\u044b \u043a\u0430\u0440\u0442\u044b \u0432\u044b\u043b\u0435\u0442\u0430\u044e\u0442 \u0438\u0437 \u0441\u0442\u043e\u043f\u043a\u0438 \u0441\u0431\u0440\u043e\u0441\u0430, \u0445\u043e\u0442\u044f \u0434\u043e\u043b\u0436\u043d\u044b \u043a\u0430\u043a \u0431\u044b \u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0432 \u0441\u0442\u043e\u043f\u043a\u0435 \u0432\u044b\u0434\u0430\u0447\u0438:<\/p>\n<div class=\"tm-iframe_temp\" data-src=\"https:\/\/embedd.srv.habr.com\/iframe\/652a41417f26cf30b3f3e892\" data-style=\"\" id=\"652a41417f26cf30b3f3e892\" width=\"\"><\/div>\n<p>\u0420\u0435\u0448\u0435\u043d\u0438\u0435 \u043d\u0430\u0448\u0435\u043b \u0441\u0443\u043f\u0435\u0440 \u043f\u0440\u043e\u0441\u0442\u043e\u0435. \u041a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437, \u043a\u043e\u0433\u0434\u0430 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u044f \u0432\u044b\u0442\u0430\u0441\u043a\u0438\u0432\u0430\u043d\u0438\u044f \u043a\u0430\u0440\u0442\u044b, \u044f \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043a\u0430\u0440\u0442\u0443 \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0430\u044e \u0432 \u043d\u0443\u0436\u043d\u043e\u0435 \u043c\u0435\u0441\u0442\u043e:<\/p>\n<pre><code class=\"cs\">    void PlayDrawAnimation(GameObject card, Side side)     {         side.DoubleTableCards.Add(card);         card.transform.localPosition = side.StartPosition; \/\/ \u0432\u043e\u0442 \u044d\u0442\u0430 \u0441\u0442\u0440\u043e\u0447\u043a\u0430         CalculateTableCardsPosition(side);         side.DrawCounter--;     } <\/code><\/pre>\n<p>\u041a\u0430\u043a \u043c\u043e\u0436\u0435\u0442\u0435 \u0432\u0438\u0434\u0435\u0442\u044c, \u0432\u0441\u0435 \u0440\u0430\u0432\u043d\u043e \u0443 \u043c\u0435\u043d\u044f \u043b\u043e\u0433\u0438\u043a\u0430 \u0438 \u0432\u0438\u0437\u0443\u0430\u043b \u0435\u0449\u0435 \u0441\u043c\u0435\u0448\u0430\u043d\u044b. \u0412 \u043a\u043b\u0430\u0441\u0441\u0435 Side \u043f\u043e\u043c\u0438\u043c\u043e \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u044f \u0445\u0440\u0430\u043d\u044e \u0435\u0449\u0435 \u043f\u043e\u0437\u0438\u0446\u0438\u0438 \u043a\u0430\u0440\u0442 (\u0434\u043b\u044f \u0441\u0442\u043e\u043f\u043a\u0438 \u0432\u044b\u0434\u0430\u0447\u0438 \u0438 \u0441\u0442\u043e\u043f\u043a\u0438 \u0441\u0431\u0440\u043e\u0441\u0430) \u0438 \u0434\u0443\u0431\u043b\u044c \u0441\u043f\u0438\u0441\u043a\u0430 TableCards. \u041e\u0442 DoubleTableCards \u043f\u043e\u043a\u0430 \u043d\u0435 \u0437\u043d\u0430\u044e, \u043a\u0430\u043a \u0438\u0437\u0431\u0430\u0432\u0438\u0442\u044c\u0441\u044f: \u043e\u043d \u043d\u0443\u0436\u0435\u043d, \u0447\u0442\u043e\u0431\u044b \u0441\u043e\u0431\u0438\u0440\u0430\u0442\u044c \u0432 \u043d\u0435\u0433\u043e \u043a\u0430\u0440\u0442\u044b \u0441 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043a\u043e\u043c \u0438 \u043a\u0440\u0430\u0441\u0438\u0432\u043e \u0432\u044b\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c \u043d\u0430 \u044d\u043a\u0440\u0430\u043d\u0435. \u0420\u0430\u043d\u044c\u0448\u0435 \u0443 \u043c\u0435\u043d\u044f \u044d\u0442\u043e\u0442 \u043c\u0435\u0442\u043e\u0434 \u0440\u0430\u0431\u043e\u0442\u0430\u043b \u0441 TableCards, \u043d\u043e \u043f\u0440\u0438 \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u043b\u043e\u0433\u0438\u043a\u0435 \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u0435 \u0432\u0441\u0435\u0445 \u043a\u0430\u0440\u0442 \u043d\u0430 \u044d\u043a\u0440\u0430\u043d\u0435 \u043f\u0440\u0438 \u0432\u044b\u0434\u0430\u0447\u0435 \u0431\u0443\u0434\u0435\u0442 \u043c\u043e\u043c\u0435\u043d\u0442\u0430\u043b\u044c\u043d\u044b\u043c:<\/p>\n<pre><code class=\"cs\">    public void CalculateTableCardsPosition(Side side)     {         int offset = 105;         int width = (side.DoubleTableCards.Count - 1) * offset;         int halfWidth = width \/ 2;         for (int cardIndex = 0; cardIndex &lt; side.DoubleTableCards.Count; cardIndex++)         {             GameObject Card = side.DoubleTableCards[cardIndex];             CardScript grid = Card.GetComponent&lt;CardScript>();             sprite = Card.GetComponent&lt;SpriteRenderer>();             sprite.sortingOrder = cardIndex;             float desiredX = -halfWidth + (offset * cardIndex);             grid.desiredPosition = new Vector2(desiredX, side.HandPosition);             grid.timestamp = Time.time + grid.timeBetweenMoves;             grid.startPosition = grid.desiredPosition;         }     }<\/code><\/pre>\n<p>\u0412 \u043b\u044e\u0431\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u044d\u0442\u0438 \u0448\u0442\u0443\u043a\u0438 \u043f\u043e\u043a\u0430 \u0441\u0438\u043b\u044c\u043d\u043e \u043d\u0435 \u043c\u0435\u0448\u0430\u044e\u0442. \u0410 \u0432 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0432\u0438\u0436\u0443 \u0432 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0438 \u0435\u0449\u0435 \u043e\u0434\u043d\u043e\u0439 \u043f\u0440\u043e\u0441\u043b\u043e\u0439\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u043e\u0435\u0434\u0438\u043d\u044f\u0435\u0442 \u0447\u0438\u0441\u0442\u043e \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0441 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u043d\u0430 \u044d\u043a\u0440\u0430\u043d\u0435.<\/p>\n<h2>\u0427\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u044e \u043a \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0441\u0443\u0431\u0431\u043e\u0442\u0435<\/h2>\n<p>\u041e\u0442 \u043f\u0440\u0435\u0436\u043d\u0435\u0433\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0430 \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043e\u0434\u043d\u043e\u0439 \u0444\u0438\u0447\u0438 \u043d\u0430 \u043a\u0430\u0436\u0434\u0443\u044e \u043d\u0435\u0434\u0435\u043b\u044e \u044f \u043e\u0442\u043e\u0448\u0435\u043b. \u0421\u0435\u0439\u0447\u0430\u0441 \u0445\u043e\u0447\u0443 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u044c \u043c\u0435\u043d\u044f\u0442\u044c \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443, \u0447\u0442\u043e\u0431\u044b \u0434\u0430\u043b\u044c\u0448\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043a\u0443\u0447\u0443 \u043d\u043e\u0432\u044b\u0445 \u043a\u0430\u0440\u0442 \u043b\u0435\u0433\u043a\u043e \u0438 \u0431\u044b\u0441\u0442\u0440\u043e. \u0412\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435, \u043a\u0430\u043a\u043e\u0439 \u0442\u0440\u0435\u0448 \u0432 \u043c\u0435\u0442\u043e\u0434\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u044d\u0444\u0444\u0435\u043a\u0442\u044b \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u043a\u0430\u0440\u0442\u044b. \u0417\u0430\u0439\u043c\u0443\u0441\u044c \u0432 \u043f\u0435\u0440\u0432\u0443\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u044d\u0442\u043e\u0439 \u0447\u0430\u0441\u0442\u044c\u044e:<\/p>\n<pre><code class=\"cs\">    public void DescriptionTranscription()     {         if (cardSide.Strength != lastStrength)         {             lastStrength = cardSide.Strength;             finalDamage = 0;             cardDescriptionDynamic = LocalizationSettings.StringDatabase.GetLocalizedString(cardId + \"_Description\");             \/\/string cardDescriptionDynamicWithoutTags;             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);                 }              }             if (cardDescriptionDynamic.Contains(\";\"))             {                 int firstSym = cardDescriptionDynamic.IndexOf(';');                 int secondSym = cardDescriptionDynamic.IndexOf('?');                 string block = \"\";                 for (int i = firstSym + 1; i &lt; secondSym; i++)                 {                     block += cardDescriptionDynamic[i];                 }                 cardBlock = Int32.Parse(block);                 cardDescriptionDynamic = cardDescriptionDynamic.Replace(\";\", \"\");                 cardDescriptionDynamic = cardDescriptionDynamic.Replace(\"?\", \"\");                 cardDescriptionDynamic = cardDescriptionDynamic.Replace(block, cardBlock.ToString());             }             if (cardDescriptionDynamic.Contains(\"{\"))             {                 int firstSym = cardDescriptionDynamic.IndexOf('{');                 int secondSym = cardDescriptionDynamic.IndexOf('}');                 string draw = \"\";                 for (int i = firstSym + 1; i &lt; secondSym; i++)                 {                     draw += cardDescriptionDynamic[i];                 }                 cardDraw = Int32.Parse(draw);                 cardDescriptionDynamic = cardDescriptionDynamic.Replace(\"{\", \"\");                 cardDescriptionDynamic = cardDescriptionDynamic.Replace(\"}\", \"\");                 cardDescriptionDynamic = cardDescriptionDynamic.Replace(draw, cardDraw.ToString());             }             if (cardDescriptionDynamic.Contains(\"(\"))             {                 int firstSym = cardDescriptionDynamic.IndexOf('(');                 int secondSym = cardDescriptionDynamic.IndexOf(')');                 string strength = \"\";                 for (int i = firstSym + 1; i &lt; secondSym; i++)                 {                     strength += cardDescriptionDynamic[i];                 }                 cardStrength = Int32.Parse(strength);                 cardDescriptionDynamic = cardDescriptionDynamic.Replace(\"(\", \"\");                 cardDescriptionDynamic = cardDescriptionDynamic.Replace(\")\", \"\");                 cardDescriptionDynamic = cardDescriptionDynamic.Replace(strength, cardStrength.ToString());             }         }      }<\/code><\/pre>\n<p>\u0427\u0435\u043c \u044f \u0434\u0435\u043b\u0438\u043b\u0441\u044f \u0432 \u043f\u0440\u043e\u0448\u043b\u044b\u0445 \u0434\u0435\u0432\u043b\u043e\u0433\u0430\u0445:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/dtf.ru\/indie\/2179036-one-on-one-devlog-karta-kotoraya-aktiviruet-novyy-baff\" rel=\"noopener noreferrer nofollow\">\u0414\u043e\u0431\u0430\u0432\u0438\u043b \u043d\u043e\u0432\u044b\u0439 \u0431\u0430\u0444\u0444<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/dtf.ru\/indie\/2157540-one-on-one-devlog-karta-s-kastomnym-effektom\" rel=\"noopener noreferrer nofollow\">\u0414\u043e\u0431\u0430\u0432\u0438\u043b \u043a\u0430\u0440\u0442\u0443 \u0441 \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u043c \u044d\u0444\u0444\u0435\u043a\u0442\u043e\u043c<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/dtf.ru\/indie\/2117291-one-on-one-devlog-pop-apy-dlya-kolod-i-novyy-fon\" rel=\"noopener noreferrer nofollow\">\u0414\u043e\u0431\u0430\u0432\u0438\u043b \u043f\u043e\u043f-\u0430\u043f\u044b \u0434\u043b\u044f \u043a\u043e\u043b\u043e\u0434<\/a><\/p>\n<\/li>\n<\/ul>\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<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\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-357481","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/357481","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=357481"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/357481\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=357481"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=357481"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=357481"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}