コード例 #1
0
ファイル: BoardManager.cs プロジェクト: AdrianWennberg/ATak
    private void SpawnFirstStone()
    {
        int index = isWhiteTurn ? 1 : 0;

        GameObject go = Instantiate(Pieces[index],
                                    transform.position,
                                    Quaternion.identity, transform) as GameObject;

        activeStones[MouseController.CurrentPosition.x, MouseController.CurrentPosition.y].Add(
            Stone.AddStone(go, MouseController.CurrentPosition, !isWhiteTurn));

        players[index].TakeStone();
    }
コード例 #2
0
ファイル: BoardManager.cs プロジェクト: AdrianWennberg/ATak
    private void SpawnStone()
    {
        int index          = isWhiteTurn ? 0 : 1;
        int capstoneOffset = (currentStone == StoneType.Capstone ? 2 : 0);

        GameObject go = Instantiate(Pieces[index + capstoneOffset],
                                    transform.position,
                                    Quaternion.identity, transform) as GameObject;

        activeStones[MouseController.CurrentPosition.x, MouseController.CurrentPosition.y].Add(
            Stone.AddStone(go, MouseController.CurrentPosition, isWhiteTurn, currentStone));

        if (currentStone == StoneType.Capstone)
        {
            players[index].TakeCapstone();
        }
        else
        {
            players[index].TakeStone();
        }
    }