Ejemplo n.º 1
0
    private IEnumerator Move(Coord dest)
    {
        // Remove branches entering the stages not chosen in the next column and grey them out
        for (int i = 0; i < _currMap[dest.col].Length; i++)
        {
            StageNode stage = _currMap[dest.col][i];
            // Ignore null stages and the current stage
            if (stage == null || i == dest.row)
            {
                continue;
            }
            stage.SetInaccessible();
            stage.DestroyEntryBranch();
        }

        // Readjust length of vertical path leading to next column
        PositionVerticalPath(GetCurrStage().GetVerticalPath(), GetCurrStage(), _currMap[dest.col][dest.row]);

        SetPlayerCoord(dest);
        _canMove = false;

        // TODO: move animation?
        yield return(new WaitForSeconds(1f));

        GetCurrStage().EnterStage();
        _mapDisplay.SetActive(false);
    }