// Update is called once per frame
    void Update()
    {
// Bounds bounds = boxCollider.bounds;
//     float extraHeightText = 0.5f;

//     RaycastHit2D raycastHit= Physics2D.BoxCast(bounds.center,new Vector2(0.75f,0.5f),0f,Vector2.down,extraHeightText,groundLayerMask);
//      Color rayColor;

//      if(raycastHit.collider != null){

//        rayColor = Color.green;


//    if(raycastHit.collider.gameObject == Mario){

//      if(!gastada){
//    StartCoroutine (Rebote());
//     GenerarPremio();

        //       }
//       }

//      Debug.DrawRay(bounds.center + new Vector3(bounds.extents.x,0),Vector2.down*(bounds.extents.y+extraHeightText),rayColor);
//      Debug.DrawRay(bounds.center - new Vector3(bounds.extents.x,0),Vector2.down*(bounds.extents.y+extraHeightText),rayColor);
//      Debug.DrawRay(bounds.center - new Vector3(bounds.extents.x,bounds.extents.y),Vector2.right*(bounds.extents.y),rayColor);



//      }else{

//        rayColor = Color.red;
//      }

//boxcasf


        Action();


//fin boxcast
//cast



//cast



        if (rebote == 1)
        {
            transform.Translate(Vector3.up * 2 * Time.deltaTime);

            sueltaPremio = true;
        }

        if (rebote == -1)
        {
            transform.Translate(Vector3.down * 2.92f * Time.deltaTime);



            switch (tipopremio)
            {
            case 0:

                moneda.Monedasalto();

                break;

            case 1:

                if (hongo != null)
                {
                    hongo.Accion();
                }

                break;
            }
        }
    }