Ejemplo n.º 1
0
    public void AdicionaPres()
    {
        if (playerPoints > 0)
        {
            tmpResis     += 1;
            playerPoints -= 1;
            Mresis.GetComponent <TextMesh>().text = (tmpResis + resis).ToString();
        }

        Ppontos.GetComponent <TextMesh>().text = playerPoints.ToString();
    }
Ejemplo n.º 2
0
    public void AdicionaPfor()
    {
        if (playerPoints > 0)
        {
            tmpFor       += 1;
            playerPoints -= 1;
            Mfor.GetComponent <TextMesh>().text = (tmpFor + forc).ToString();
        }

        Ppontos.GetComponent <TextMesh>().text = playerPoints.ToString();
    }
Ejemplo n.º 3
0
    public void AdicionaPcons()
    {
        if (playerPoints > 0)
        {
            tmpCons      += 1;
            playerPoints -= 1;
            Mcons.GetComponent <TextMesh>().text = (tmpCons + cons).ToString();
        }

        Ppontos.GetComponent <TextMesh>().text = playerPoints.ToString();
    }
Ejemplo n.º 4
0
 public void ShowValues()
 {
     Mname.GetComponent <TextMesh> ().text   = nome.ToString();
     Mlevel.GetComponent <TextMesh> ().text  = level.ToString();
     Mvida.GetComponent <TextMesh> ().text   = vida.ToString();
     Mener.GetComponent <TextMesh> ().text   = ener.ToString();
     Mtox.GetComponent <TextMesh> ().text    = tox.ToString();
     Mcons.GetComponent <TextMesh> ().text   = cons.ToString();
     Mresis.GetComponent <TextMesh> ().text  = resis.ToString();
     Mfor.GetComponent <TextMesh> ().text    = forc.ToString();
     Ppontos.GetComponent <TextMesh> ().text = playerPoints.ToString();
 }
Ejemplo n.º 5
0
    public void Cancelar()
    {
        playerPoints += tmpCons;
        playerPoints += tmpFor;
        playerPoints += tmpResis;

        Ppontos.GetComponent <TextMesh> ().text = playerPoints.ToString();

        Mresis.GetComponent <TextMesh>().text = resis.ToString();
        Mcons.GetComponent <TextMesh>().text  = cons.ToString();
        Mfor.GetComponent <TextMesh>().text   = forc.ToString();

        tmpCons  = 0;
        tmpFor   = 0;
        tmpResis = 0;
    }
Ejemplo n.º 6
0
 public void RemovePres()
 {
     if (tmpResis > 0)
     {
         tmpResis     -= 1;
         playerPoints += 1;
         if (tmpResis == 0)
         {
             Mresis.GetComponent <TextMesh>().text = resis.ToString();
         }
         else
         {
             Mresis.GetComponent <TextMesh>().text = (tmpResis + resis).ToString();
         }
         Ppontos.GetComponent <TextMesh>().text = playerPoints.ToString();
     }
 }
Ejemplo n.º 7
0
 public void RemovePfor()
 {
     if (tmpFor > 0)
     {
         tmpFor       -= 1;
         playerPoints += 1;
         if (tmpFor == 0)
         {
             Mfor.GetComponent <TextMesh>().text = forc.ToString();
         }
         else
         {
             Mfor.GetComponent <TextMesh>().text = (tmpFor + forc).ToString();
         }
         Ppontos.GetComponent <TextMesh>().text = playerPoints.ToString();
     }
 }
Ejemplo n.º 8
0
 public void RemovePcons()
 {
     if (tmpCons > 0)
     {
         tmpCons      -= 1;
         playerPoints += 1;
         if (tmpCons == 0)
         {
             Mcons.GetComponent <TextMesh>().text = cons.ToString();
         }
         else
         {
             Mcons.GetComponent <TextMesh>().text = (tmpCons + cons).ToString();
         }
         Ppontos.GetComponent <TextMesh>().text = playerPoints.ToString();
     }
 }
Ejemplo n.º 9
0
    public void Aplicar()
    {
        Ppontos.GetComponent <TextMesh> ().text = playerPoints.ToString();

        int damage     = tmpFor;
        int health     = tmpCons;
        int resistance = tmpResis;
        int energy     = ener;

        int total_damage     = damage;
        int total_health     = vida;
        int total_resistance = resistance;
        int total_energy     = energy;

        savechanges = new Monster_Create(total_damage, total_health, total_resistance, total_energy, damage, health, resistance, level, energy, tox);
        playerJson  = JsonMapper.ToJson(savechanges);

        if (MonstersCon.GetComponent <MonstersController> ().LastMonster == "Aguia")
        {
            File.WriteAllText((Application.persistentDataPath + "/Aguia.json"), playerJson.ToString());
        }
        else if (MonstersCon.GetComponent <MonstersController> ().LastMonster == "Mamute")
        {
            File.WriteAllText((Application.persistentDataPath + "/Mamute.json"), playerJson.ToString());
        }
        else if (MonstersCon.GetComponent <MonstersController> ().LastMonster == "Peixe")
        {
            File.WriteAllText((Application.persistentDataPath + "/Peixe.json"), playerJson.ToString());
        }

        saveExp    = new PlayerP(TTpoints, moneyP);
        playerJson = JsonMapper.ToJson(saveExp);
        File.WriteAllText((Application.persistentDataPath + "/Player.json"), playerJson.ToString());


        resis += tmpResis;
        forc  += tmpFor;
        cons  += tmpCons;

        tmpCons  = 0;
        tmpFor   = 0;
        tmpResis = 0;
    }