diff --git a/Assets/Scripts/Data/PieceData.cs b/Assets/Scripts/Data/PieceData.cs
index 67847fc..ecf6c98 100644
--- a/Assets/Scripts/Data/PieceData.cs
+++ b/Assets/Scripts/Data/PieceData.cs
@@ -106,34 +106,34 @@ public static string PieceTypeToStr(PieceType pieceType)
///
///
///
- public static string PieceTypeToPromoteStr(PieceType pieceType)
+ public static string PieceTypeToPromoteStr(PieceType pieceType, bool isAIFirst)
{
switch (pieceType)
{
case PieceType.WhitePawn:
- return "white_prom_pawn";
+ return isAIFirst? "black_prom_pawn" : "white_prom_pawn";
case PieceType.WhiteLance:
- return "white_prom_lance";
+ return isAIFirst ? "black_prom_lance" : "white_prom_lance";
case PieceType.WhiteKnight:
- return "white_prom_knight";
+ return isAIFirst ? "black_prom_knight" : "white_prom_knight";
case PieceType.WhiteSilver:
- return "white_prom_silver";
+ return isAIFirst ? "black_prom_silver" : "white_prom_silver";
case PieceType.WhiteBishop:
- return "white_horse";
+ return isAIFirst ? "black_horse" : "white_horse";
case PieceType.WhiteRook:
- return "white_dragon";
+ return isAIFirst ? "black_dragon" : "white_dragon";
case PieceType.BlackPawn:
- return "black_prom_pawn";
+ return isAIFirst ? "white_prom_pawn" : "black_prom_pawn";
case PieceType.BlackLance:
- return "black_prom_lance";
+ return isAIFirst ? "white_prom_lance" : "black_prom_lance";
case PieceType.BlackKnight:
- return "black_prom_knight";
+ return isAIFirst ? "white_prom_knight" : "black_prom_knight";
case PieceType.BlackSilver:
- return "black_prom_silver";
+ return isAIFirst ? "white_prom_silver" : "black_prom_silver";
case PieceType.BlackBishop:
- return "black_horse";
+ return isAIFirst ? "white_horse" : "black_horse";
case PieceType.BlackRook:
- return "black_dragon";
+ return isAIFirst ? "white_dragon" : "black_dragon";
default:
throw new Exception("成れない駒です。");
}
diff --git a/Assets/Scripts/GameSceneScreen/GameSceneController.cs b/Assets/Scripts/GameSceneScreen/GameSceneController.cs
index 4a50055..920eddf 100644
--- a/Assets/Scripts/GameSceneScreen/GameSceneController.cs
+++ b/Assets/Scripts/GameSceneScreen/GameSceneController.cs
@@ -227,7 +227,7 @@ private async UniTask SelectPiece(Piece piece)
{
// この場合は強制的に成る
decidedMove = movePromote;
- PromotePiece(selectedPiece);
+ PromotePiece(selectedPiece, isAIFirst);
}
else
{
@@ -253,7 +253,7 @@ private async UniTask SelectPiece(Piece piece)
if (shouldPromote)
{
decidedMove = movePromote;
- PromotePiece(selectedPiece);
+ PromotePiece(selectedPiece, isAIFirst);
}
// 変数を初期化
@@ -334,7 +334,7 @@ private async UniTask MovePiece(Cell cell, bool isBlack)
{
// この場合は強制的に成る
decidedMove = movePromote;
- PromotePiece(selectedPiece);
+ PromotePiece(selectedPiece, isAIFirst);
}
else
{
@@ -358,7 +358,7 @@ private async UniTask MovePiece(Cell cell, bool isBlack)
if (shouldPromote)
{
decidedMove = movePromote;
- PromotePiece(selectedPiece);
+ PromotePiece(selectedPiece, isAIFirst);
}
// 変数を初期化
@@ -496,10 +496,10 @@ private void CapturePiece(Piece piece, bool isBlack)
Destroy(piece.gameObject);
}
- private void PromotePiece(Piece piece)
+ private void PromotePiece(Piece piece, bool isAIFirst)
{
piece.isPromoted = true;
- piece.GetComponent().sprite = Resources.Load("ShogiUI/Piece/" + PieceData.PieceTypeToPromoteStr(piece.pieceType));
+ piece.GetComponent().sprite = Resources.Load("ShogiUI/Piece/" + PieceData.PieceTypeToPromoteStr(piece.pieceType, isAIFirst));
}
///