Ejemplo n.º 1
0
    public void OnClicked(GoBoardIntersection intersection)
    {
        GoStone stone = new GoStone(intersection.X, intersection.Y);

        if (!m_whiteStones.Contains(stone) && !m_blackStones.Contains(stone))
        {
            if (m_currentPlayerColor == StoneColor.White)
            {
                m_whiteStones.Add(stone);
            }
            else
            {
                m_blackStones.Add(stone);
            }
            m_boardVisual.PlaceStone(intersection, m_currentPlayerColor);
            m_currentPlayerColor = m_currentPlayerColor == StoneColor.White ? StoneColor.Black : StoneColor.White;
        }
    }
Ejemplo n.º 2
0
    public void PlaceStone(GoBoardIntersection intersection, GoGame.StoneColor playerColor)
    {
        GameObject stonePrefab = playerColor == GoGame.StoneColor.White ? m_whitePlayerStonePrefab : m_blackPlayerStonePrefab;

        Instantiate(stonePrefab, intersection.transform.position, intersection.transform.rotation, m_stonesContainer.transform);
    }