public IEnumerator OnMovePiece(object obj, MovePieceEventArgs e) { PieceUI pieceUi = activePlayer.piecesParent.GetChild(e.piece.index).GetComponent <PieceUI>(); Transform[] transforms = GetStepsTransform(e.steps.positions, e.steps.inGoalIndex); yield return(StartCoroutine(pieceUi.StepMove(transforms))); }
public IEnumerator OnGetInPiece(object obj, GetInPieceEventArgs e) { PieceUI pieceUi = activePlayer.piecesParent.GetChild(e.piece.index).GetComponent <PieceUI>(); Transform[] transforms = new Transform[] { blocksParent.GetChild(e.piece.position) }; yield return(StartCoroutine(pieceUi.StepMove(transforms))); }
public IEnumerator OnGetOutPiece(object obj, GetOutPieceEventArgs e) { PieceUI pieceUi = playersData[e.piece.player.index].piecesParent.GetChild(e.piece.index).GetComponent <PieceUI>(); Transform[] transforms = new Transform[] { playersData[e.piece.player.index].outsParent.GetChild(e.piece.position) }; SFX.instance.PlayPieceHitSound(); yield return(StartCoroutine(pieceUi.StepMove(transforms, 2))); }