Пример #1
0
    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)));
    }
Пример #2
0
    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)));
    }
Пример #3
0
    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)));
    }