Exemplo n.º 1
0
    public void ReAttach(ShelfGenerator sg = null)
    {
        ShelfGenerator target_shelf = sg == null ? floatingProdOrigShelf : sg;

        floatingProduct.deattached = false;

        if (target_shelf == floatingProdOrigShelf)
        {
            target_shelf.AttachProduct(floatingProduct.box, floatingProduct.gameObject);
        }
        else
        {
            target_shelf.AttachProduct2(floatingProduct.box, floatingProduct.gameObject);
        }

        if (sg != null)
        {
            floatingProduct.ReturnToLastValidPosition();
        }

        floatingProduct = null;
    }