Example #1
0
    /// <summary>
    /// 点击检测方法
    /// </summary>
    /// <param name="paramName">param description</param>
    /// <returns></retruns>
    public void ClickCheck()
    {
        if (gameManager.gameOver)
        {
            return;
        }
        int itemColorId; // 定义颜色ID, 0:为格子 1.黑色 2.红色

        if (isGrid)
        {
            itemColorId = 0;
        }
        else
        {
            // itemColorId
            // 得到父对象
            gridGeObj = transform.parent.gameObject;
            // 提取当前棋子所在格子索引
            ChessOrGrid chessOrGrid = gridGeObj.GetComponent <ChessOrGrid>();
            xIndex = chessOrGrid.xIndex;
            yIndex = chessOrGrid.yIndex;
            if (isRed)
            {
                itemColorId = 2;
            }
            else
            {
                itemColorId = 1;
            }
        }
        Debug.Log("itemColorId:" + itemColorId + "--xIndex:" + xIndex + "==yIndex:" + yIndex);
        // 行为处理
        GridOrChessBehavior(itemColorId, xIndex, yIndex);
    }
Example #2
0
    public void ClickCheck()
    {
        if (gameManager.gameOver)
        {
            return;
        }
        int itemColorId;

        if (isGrid)
        {
            itemColorId = 0;
        }
        else
        {
            gridGo = transform.parent.gameObject;
            ChessOrGrid chessOrGrid = gridGo.GetComponent <ChessOrGrid>();
            xIndex = chessOrGrid.xIndex;
            yIndex = chessOrGrid.yIndex;
            if (isRed)
            {
                itemColorId = 2;
            }
            else
            {
                itemColorId = 1;
            }
        }
        GridOrChessBehavior(itemColorId, xIndex, yIndex);
    }
Example #3
0
 /// <summary>
 /// 单机重玩方法
 /// </summary>
 public void Replay()
 {
     HideLastPositionUI();
     HideClickUI();
     HideCanEatUI();
     ClearCurrentCanMoveUIStack();
     lastChessOrGrid = null;
     for (int i = chessRegreting.regretCount; i > 0; i--)
     {
         chessRegreting.RegretChess();
     }
 }
Example #4
0
 public void Replay()
 {
     HideLastPositionUI();
     HideClickUI();
     HideCanEatUI();
     ClearCurrentCanMoveUIStack();
     lastChessOrGrid = null;
     UiManager.Instance.ShowTip("赤の番");
     for (int i = chessReseting.resetCount; i > 0; i--)
     {
         chessReseting.ResetChess();
     }
 }