Exemplo n.º 1
0
 public void Close()
 {
     if (MenuInject.activeInHierarchy)
     {
         ItemInject.GetComponent <SpriteRenderer> ().sprite = null;
         ItemSelect = null;
         MenuInject.SetActive(false);
         CollidersEnable(btnInjection);
         CollidersEnable(btnStatus);
         EnableGameObjects(Monstros);
         if (LastMonster == "Aguia")
         {
             EnableGameObjects(Aguia);
         }
         else if (LastMonster == "Peixe")
         {
             EnableGameObjects(Fish);
         }
         else if (LastMonster == "Mamute")
         {
             EnableGameObjects(Mamute);
         }
     }
     else if (MenuStatus.activeInHierarchy)
     {
         ItemInject.GetComponent <SpriteRenderer> ().sprite = null;
         MenuStatus.GetComponent <StatsBehaviour>().Cancelar();
         ItemSelect = null;
         DisableGameObjects(MenuStatus);
         EnableGameObjects(btnStatus);
         EnableGameObjects(btnInjection);
         CollidersEnable(rightArrow);
         CollidersEnable(leftArrow);
     }
 }
Exemplo n.º 2
0
 public void ativaInje()
 {
     itensbehaviour.UpdateItens();
     MenuInject.SetActive(true);
     CollidersDisable(BtnInject);
     CollidersDisable(btnInjection);
     CollidersDisable(btnStatus);
     DisableGameObjects(Monstros);
     if (LastMonster == "Aguia")
     {
         DisableGameObjects(Aguia);
     }
     else if (LastMonster == "Peixe")
     {
         DisableGameObjects(Fish);
     }
     else if (LastMonster == "Mamute")
     {
         DisableGameObjects(Mamute);
     }
 }
Exemplo n.º 3
0
    public void Inject()
    {
        if (LastMonster == "Aguia")
        {
            MenuStatus.GetComponent <StatsBehaviour> ().AguiaValues();
        }
        else if (LastMonster == "Mamute")
        {
            MenuStatus.GetComponent <StatsBehaviour> ().MamuteValues();
        }
        else if (LastMonster == "Peixe")
        {
            MenuStatus.GetComponent <StatsBehaviour>().PeixeValues();
        }

        if (ItemSelect == "item1")
        {
            itensbehaviour.item1 -= 1;
            tmpEner  = 50;
            tmpForca = 0;
            tmpResis = 0;
            tmpConst = 0;
            tmpTox   = 5;
            tmpVida  = 0;
        }
        else if (ItemSelect == "item2")
        {
            itensbehaviour.item2 -= 1;
            tmpEner  = 50;
            tmpForca = 1;
            tmpResis = 3;
            tmpConst = 0;
            tmpTox   = 40;
            tmpVida  = 0;
        }
        else if (ItemSelect == "item3")
        {
            itensbehaviour.item3 -= 1;
            tmpEner  = 0;
            tmpForca = 1;
            tmpResis = 3;
            tmpConst = 0;
            tmpTox   = 0;
            tmpVida  = 5;
        }
        else if (ItemSelect == "item4")
        {
            itensbehaviour.item4 -= 1;
            tmpEner  = 0;
            tmpForca = 0;
            tmpResis = 0;
            tmpConst = 0;
            tmpTox   = -20;
            tmpVida  = 0;
        }
        else if (ItemSelect == "item5")
        {
            itensbehaviour.item5 -= 1;
            tmpEner  = 0;
            tmpForca = 0;
            tmpResis = 0;
            tmpConst = 0;
            tmpTox   = 10;
            tmpVida  = 20;
        }
        else if (ItemSelect == "item6")
        {
            itensbehaviour.item6 -= 1;
            tmpEner  = 0;
            tmpForca = 5;
            tmpResis = 0;
            tmpConst = 1;
            tmpTox   = 70;
            tmpVida  = 0;
        }

        int damage           = MenuStatus.GetComponent <StatsBehaviour>().forc + tmpForca;
        int health           = MenuStatus.GetComponent <StatsBehaviour>().cons + tmpConst;
        int resistance       = MenuStatus.GetComponent <StatsBehaviour>().resis + tmpResis;;
        int energy           = MenuStatus.GetComponent <StatsBehaviour>().ener + tmpEner;
        int toxi             = MenuStatus.GetComponent <StatsBehaviour>().tox + tmpTox;
        int level            = MenuStatus.GetComponent <StatsBehaviour> ().level;
        int total_damage     = damage;
        int total_health     = MenuStatus.GetComponent <StatsBehaviour>().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, toxi);
        playerJson  = JsonMapper.ToJson(savechanges);

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


        itenssave  = new Itens(itensbehaviour.item1, itensbehaviour.item2, itensbehaviour.item3, itensbehaviour.item4, itensbehaviour.item5, itensbehaviour.item6);
        playerJson = JsonMapper.ToJson(itenssave);
        File.WriteAllText((Application.persistentDataPath + "/Itens.json"), playerJson.ToString());

        CollidersEnable(btnInjection);
        CollidersEnable(btnStatus);;
        EnableGameObjects(Monstros);
        if (LastMonster == "Aguia")
        {
            EnableGameObjects(Aguia);
        }
        else if (LastMonster == "Peixe")
        {
            EnableGameObjects(Fish);
        }
        else if (LastMonster == "Mamute")
        {
            EnableGameObjects(Mamute);
        }
        ItemInject.GetComponent <SpriteRenderer> ().sprite = null;
        ItemSelect = null;
        MenuInject.SetActive(false);
    }