コード例 #1
0
    private void Awake()
    {
        if (!PlayerPrefs.HasKey("UpgradeInv"))
        {
            PlayerPrefs.SetInt("UpgradeInv", 100);
        }
        if (!PlayerPrefs.HasKey("UpgradeMag"))
        {
            PlayerPrefs.SetInt("UpgradeMag", 100);
        }
        if (!PlayerPrefs.HasKey("Upgradex2"))
        {
            PlayerPrefs.SetInt("Upgradex2", 100);
        }

        InvCooldown = PlayerPrefs.GetInt("InvCooldown");
        MagCooldown = PlayerPrefs.GetInt("MagCooldown");
        x2Cooldown  = PlayerPrefs.GetInt("x2Cooldown");

        InvenciPower    = PlayerPrefs.GetInt("IntInvencibilidad");
        coinScore       = PlayerPrefs.GetInt("Score");
        valorEstrella   = 100;
        valorUpgradeInv = PlayerPrefs.GetInt("UpgradeInv");
        valorUpgradeMag = PlayerPrefs.GetInt("UpgradeMag");
        valorUpgradex2  = PlayerPrefs.GetInt("Upgradex2");
        Instance        = this;

        InvenciText.text    = InvenciPower.ToString("0");
        coinTextTienda.text = "Tickets: " + coinScore.ToString("0");
    }
 public IHttpActionResult Get()
 {
     try
     {
         apiRes = new ApiResponse();
         var mng = new TiendaManager();
         apiRes.Data = mng.ObtenerTodasTiendas();
         return(Ok(apiRes));
     }
     catch (BussinessException error)
     {
         return(InternalServerError(new Exception(error.ExceptionId + "-" + error.AppMessage.Message)));
     }
 }
 public IHttpActionResult AsociarCategoria(string idTienda, int idCategoria)
 {
     try
     {
         apiRes = new ApiResponse();
         var mng = new TiendaManager();
         mng.AsociarCategoria(idTienda, idCategoria);
         apiRes.Message = "Se asoció la categoría a la tienda con éxito";
         return(Ok(apiRes));
     }
     catch (BussinessException error)
     {
         return(InternalServerError(new Exception(error.ExceptionId + "-" + error.AppMessage.Message)));
     }
 }
 public IHttpActionResult Delete(Tienda entity)
 {
     try
     {
         apiRes = new ApiResponse();
         var mng = new TiendaManager();
         mng.Eliminar(entity);
         apiRes.Message = "La tienda " + entity.Nombre + " se eliminó exitosamente.";
         return(Ok(apiRes));
     }
     catch (BussinessException error)
     {
         return(InternalServerError(new Exception(error.ExceptionId + "-" + error.AppMessage.Message)));
     }
 }
 public IHttpActionResult EliminarDistribuidor(string idTienda, string idDistribuidor)
 {
     try
     {
         apiRes = new ApiResponse();
         var mng = new TiendaManager();
         mng.EliminarDistribuidor(idTienda, idDistribuidor);
         apiRes.Message = "Se desasoció el distribuidor con éxito.";
         return(Ok(apiRes));
     }
     catch (BussinessException error)
     {
         return(InternalServerError(new Exception(error.ExceptionId + "-" + error.AppMessage.Message)));
     }
 }
 public IHttpActionResult Get(string id)
 {
     try
     {
         var obj = new Tienda()
         {
             Cedula = id
         };
         apiRes = new ApiResponse();
         var mng = new TiendaManager();
         apiRes.Data = mng.ObtenerPorCedula(obj);
         return(Ok(apiRes));
     }
     catch (BussinessException error)
     {
         return(InternalServerError(new Exception(error.ExceptionId + "-" + error.AppMessage.Message)));
     }
 }