Example #1
0
        public async Task <IActionResult> PutMedalla(int id, Medalla medalla)
        {
            if (id != medalla.MedallaId)
            {
                return(BadRequest());
            }

            _context.Entry(medalla).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!MedallaExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
Example #2
0
        public async Task <ActionResult <Medalla> > PostMedalla(Medalla medalla)
        {
            _context.Medalla.Add(medalla);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetMedalla", new { id = medalla.MedallaId }, medalla));
        }
Example #3
0
    void DesbloquearMedalla(int i)
    {
        if (PlayerPrefs.GetInt("EstadoMedalla" + i, 0) == 1)
        {
            return;
        }
        Medalla aux = medallas[i];

        aux.desbloqueada = true;
        StartCoroutine(GUIController.Instance.MostrarMedalla(aux));
        medallas[i] = aux;
        PlayerPrefs.SetInt("EstadoMedalla" + i, 1);
    }