Exemplo n.º 1
0
 public void ShowOrHideBars()
 {
     foreach (string StatsName in ServerNames)
     {
         DataController.DeleteValue(StatsName + "Incr");
         DataController.DeleteValue("AllPts");
     }
     WasChanged = true;
     StatsBars.SetActive(!StatsBars.activeSelf);
 }
Exemplo n.º 2
0
 private void Start()
 {
     RememberMe = DataController.GetValue <int>("RememberMe");
     if (RememberMe > 0)
     {
         username.text = DataController.GetValue <string>("username");
         password.text = DataController.GetValue <string>("password");
     }
     else
     {
         DataController.DeleteValue("username");
         DataController.DeleteValue("password");
     }
 }
Exemplo n.º 3
0
    public void MoveIn(string InOrOut)
    {
        //Debug.Log(DataController.GetValue<int>("SkillPoints") + "   " + DataController.GetValue<int>("SpentPoints") + "   " + DataController.GetValue<int>("AllPts"));
        //CharacterInfo = GameObject.FindGameObjectsWithTag("PlayerInfo")[0];
        StatsInf.SetActive(false);
        if (InOrOut == "In")
        {
            DataController.SaveValue("SpentPoints", 0);

            int temp;

            foreach (string StatsName in ServerNames)
            {
                temp = (DataController.GetValue <int>(StatsName + "Incr") + DataController.GetValue <int>(StatsName + "Mine"));

                if (temp >= 8)
                {
                    DataController.SaveValue("SpentPoints", (DataController.GetValue <int>("SpentPoints")) + 8);
                    if (temp >= 16)
                    {
                        DataController.SaveValue("SpentPoints", (DataController.GetValue <int>("SpentPoints")) + 16);
                        if (temp >= 24)
                        {
                            DataController.SaveValue("SpentPoints", (DataController.GetValue <int>("SpentPoints")) + 24);
                            if (temp >= 32)
                            {
                                DataController.SaveValue("SpentPoints", (DataController.GetValue <int>("SpentPoints")) + 32);

                                DataController.SaveValue("SpentPoints", (DataController.GetValue <int>("SpentPoints")) + (temp - 32) * 5);
                            }
                            else
                            {
                                DataController.SaveValue("SpentPoints", (DataController.GetValue <int>("SpentPoints")) + (temp - 24) * 4);
                            }
                        }
                        else
                        {
                            DataController.SaveValue("SpentPoints", (DataController.GetValue <int>("SpentPoints")) + (temp - 16) * 3);
                        }
                    }
                    else
                    {
                        DataController.SaveValue("SpentPoints", (DataController.GetValue <int>("SpentPoints")) + (temp - 8) * 2);
                    }
                }
                else
                {
                    DataController.SaveValue("SpentPoints", (DataController.GetValue <int>("SpentPoints")) + temp);
                }
            }

            foreach (string StatsName in ServerNames)
            {
                DataController.DeleteValue(StatsName + "Incr");
                DataController.DeleteValue("AllPts");
            }
            WasChanged = true;
            if (CharacterInfo.transform.position.y > 0)
            {
                CharacterInfo.transform.position = new Vector3(-1000, -1000, 0);
            }
            else
            {
                CharacterInfo.transform.position = new Vector3(1, 1.7f, -2);
            }
        }
        else
        {
            if (DataController.GetValue <int>("StatsPowerMine") < 16 && EquipmentManager.instance.currentEquipment[7] != null)
            {
                EquipmentManager.instance.currentEquipment[4] = null;
                EquipmentManager.instance.currentEquipment[5] = null;
                EquipmentManager.instance.Unequip(7);
            }
            foreach (string StatsName in ServerNames)
            {
                DataController.SaveValue(StatsName + "Mine", DataController.GetValue <int>(StatsName + "Incr") + DataController.GetValue <int>(StatsName + "Mine"));
                DataController.DeleteValue(StatsName + "Incr");
            }

            DataController.SaveValue("SpentPoints", DataController.GetValue <int>("SpentPoints") + DataController.GetValue <int>("AllPts"));

            DataController.SaveValue("SkillPoints", DataController.GetValue <int>("SkillPoints") - DataController.GetValue <int>("AllPts"));

            DataController.DeleteValue("AllPts");
        }

        //Debug.Log(DataController.GetValue<int>("SkillPoints") + "   " + DataController.GetValue<int>("SpentPoints") + "   " + DataController.GetValue<int>("AllPts"));
    }