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; } }
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); }