示例#1
0
    public void OnMouseDown()
    {
        if (DidClickOnTriangle())
        {
            // if we don't have Trapped stones
            if (NoTrappedTypePlayerStones())
            {
                if (!NeedToPopMessageRules())
                {
                    UpdateMoventDiceNormalSituation();
                }
                else
                {
                    // show message must to do the highest dice
                    gameManager.WarnPanel.transform.GetChild(1).transform.GetChild(0).GetComponent <TextMeshProUGUI>().text = "לפי חוק שש-בש, אם ניתן להזיז שחקן לפי הקובייה הגדולה במקום אחד, אזי חובה לשחק את הקוביה הגדולה מבין השניים";
                    gameManager.WarnPanel.gameObject.SetActive(true);
                }
            }
            else // there is something in OnPlayerBlack / onPlayerWhite array (Trapped stones)
            {
                JumpOnOppositeStone(); // check if the participent jump on oppoise stone on the board

                List <Player> currentList = gameManager.GetCurrentListAccordingToTurn(); // get current trapped stones Array according to turn's current player
                OnSelected.SelectedPlayer.indexTriangle = TriangleIndex;
                UpdateOnBoardRemoveFromTrapped(currentList);
                // after remove the current trapped stone - check if there is more trapped stones from the current TypePlayer
                if (currentList.Count == 0)
                {
                    UpdateMoventOnlyOneTrapped();
                }
                else
                {
                    UpdateMovementMoreThanOneTrapped();
                }
            }
        }
    }