Exemplo n.º 1
0
    void ghostTetromino()
    {
        if (instantiated != null)
        {
            Destroy(instantiated);
        }
        //GameObject clone = FindObjectOfType<spawn>().getCurrentPiece();
        instantiated = (GameObject)Instantiate(gameObject);
        TetrisBlock ghostPiece = instantiated.GetComponent(typeof(TetrisBlock)) as TetrisBlock;

        ghostPiece.canMove = false;
        if (ghostPiece.ValidMove())
        {
            ghostPiece.goDown();
            ghostPiece.ghostify();
        }
        else
        {
            Destroy(instantiated);
        }
    }