void OnNextTurn() { //落子成功,更换下棋顺序 chessTurn = (chessTurn == turn.red) ? turn.blue : turn.red; int iChessType = Random.Range(0, 3); nextChessType = (chessTurn == turn.red) ? (ChessType)iChessType : (ChessType)iChessType + 3; Debug.Log("iChessType = " + nextChessType.ToString()); for (int x = 0; x < x_len_chessboard_next; x++) { for (int y = 0; y < y_len_chessboard_next; y++) { chessState_next[x, y] = 0; } } PlacedChess(1, 1, nextChessType, ref chessState_next); }
public static ChessCharacterAttribute GetChessProperties(ChessType chessType) { return((ChessCharacterAttribute)typeof(ChessType) .GetField(chessType.ToString(), BindingFlags.Public | BindingFlags.Static) .GetCustomAttributes(false)[0]); }