예제 #1
0
파일: GameMgr.cs 프로젝트: luoshujie/DX
    private void SpawnSkill(ChessData chessData, int count)
    {
        ChessTypeEnum chessTypeEnum = ChessTypeEnum.None;

        if (count >= 7)
        {
            //同色消除
            chessTypeEnum = ChessTypeEnum.Color;
        }
        else if (count >= 5)
        {
            chessData.ChessColorTypeEnum = ChessColorTypeEnum.None;
            //行消除或列消除
            if (Random.Range(0, 2) == 0)
            {
                chessTypeEnum = ChessTypeEnum.Column;
            }
            else
            {
                chessTypeEnum = ChessTypeEnum.Line;
            }
        }
        else if (count >= 3)
        {
            chessData.ChessColorTypeEnum = ChessColorTypeEnum.None;
            chessTypeEnum = ChessTypeEnum.Nine;
            //三宫格消除
        }

        chessData.ChessTypeEnum = chessTypeEnum;
        Chess chess = SpawnSkillChess(chessData);

        chess.transform.position = new Vector3(chessData.XPos + GameConfig.Xlen, chessData.YPos + GameConfig.Ylen, 0);
    }
예제 #2
0
 public Sprite GetChessSpriteAtChessType(ChessTypeEnum chessTypeEnum)
 {
     return(chessTypeSpriteList[(int)chessTypeEnum]);
 }