public static Vital LoadVital(VitalName name) { pc.GetVital((int)name).BaseValue = PlayerPrefs.GetInt(((VitalName)name).ToString() + BASE_VALUE, 0); pc.GetVital((int)name).ExpToLevel = PlayerPrefs.GetInt(((VitalName)name).ToString() + EXP_TO_LEVEL, 0); //make sure you call this so that the AjustedBaseValue will be updated before you try to call to get the curValue pc.GetVital((int)name).Update(); //get the stored value for the curValue for each vital pc.GetVital((int)name).CurValue = PlayerPrefs.GetInt(((VitalName)name).ToString() + CUR_VALUE, 1); return(pc.GetVital((int)name)); // Vital temp = new Vital(); // temp.BaseValue = PlayerPrefs.GetInt(((VitalName)name).ToString() + BASE_VALUE, 0); // temp.ExpToLevel = PlayerPrefs.GetInt(((VitalName)name).ToString() + EXP_TO_LEVEL, 0); //make sure you call this so that the AjustedBaseValue will be updated before you try to call to get the curValue // temp.Update(); //get the stored value for the curValue for each vital // Debug.Log( "CUR: " + PlayerPrefs.GetInt(((VitalName)name).ToString() + CUR_VALUE, 1) ); // temp.CurValue = PlayerPrefs.GetInt(((VitalName)name).ToString() + CUR_VALUE, 1); // Debug.LogError( "Cur: " + temp.CurValue ); // return temp; }
public Consumable(VitalName v, int a, int tier) { _vital = v; _amountToHeal = a; _tier = tier; ItemType = ItemEquipType.Consumable; }
public static void LoadVital(VitalName name) { PC.Instance.GetVital((int)name).BaseValue = PlayerPrefs.GetInt(((VitalName)name).ToString() + BASE_VALUE, 0); PC.Instance.GetVital((int)name).ExpToLevel = PlayerPrefs.GetInt(((VitalName)name).ToString() + EXP_TO_LEVEL, 0); //make sure you call this so that the AjustedBaseValue will be updated before you try to call to get the curValue PC.Instance.GetVital((int)name).Update(); //get the stored value for the curValue for each vital PC.Instance.GetVital((int)name).CurValue = PlayerPrefs.GetInt(((VitalName)name).ToString() + CUR_VALUE, 1); }
public static Vital LoadVital(VitalName name) { PlayerCharacter.Instance.GetVitals((int)name).BaseValue = PlayerPrefs.GetInt(((VitalName)name).ToString() + BASE_VALUE, 0); PlayerCharacter.Instance.GetVitals((int)name).XptoLvL = PlayerPrefs.GetInt(((VitalName)name).ToString() + EXP_TO_LEVEL, 0); //tenha certeza de q esta chamando isso pois se n n vai ajustar os valores PlayerCharacter.Instance.GetVitals((int)name).UpDate(); //aki acontece a magica - guarda os valores para cada ponto vital :v PlayerCharacter.Instance.GetVitals((int)name).CurValue = PlayerPrefs.GetInt(((VitalName)name).ToString() + CUR_vALUE, 1); return(PlayerCharacter.Instance.GetVitals((int)name)); }
public void UpdateVitals(VitalName vital, float current, float max) { RectTransform vitalToUpdate = null; switch (vital) { case VitalName.HP: vitalToUpdate = HPBarTransform; UpdateHorizontal(HPBarTransform, current, max); break; case VitalName.MP: vitalToUpdate = MPBarTransform; UpdateHorizontal(MPBarTransform, current, max); break; case VitalName.SP: vitalToUpdate = SPBarTransform; UpdateVerticalPercentage(SPBarTransform, SPBackgroundBarTransform, current, max); break; } }
public static void SaveVital( VitalName name, Vital vital ) { PlayerPrefs.SetInt(((VitalName)name).ToString() + BASE_VALUE, vital.BaseValue); PlayerPrefs.SetInt(((VitalName)name).ToString() + EXP_TO_LEVEL, vital.ExpToLevel); PlayerPrefs.SetInt(((VitalName)name).ToString() + CUR_VALUE, vital.CurValue); }
public static void LoadVital( VitalName name ) { PC.Instance.GetVital( (int)name ).BaseValue = PlayerPrefs.GetInt(((VitalName)name).ToString() + BASE_VALUE, 0); PC.Instance.GetVital( (int)name ).ExpToLevel = PlayerPrefs.GetInt(((VitalName)name).ToString() + EXP_TO_LEVEL, 0); //make sure you call this so that the AjustedBaseValue will be updated before you try to call to get the curValue PC.Instance.GetVital( (int)name ).Update(); //get the stored value for the curValue for each vital PC.Instance.GetVital( (int)name ).CurValue = PlayerPrefs.GetInt(((VitalName)name).ToString() + CUR_VALUE, 1); }
public Vital GetVital(VitalName vitalName) { return(GetVital((int)vitalName)); }
public Vital GetVital(VitalName index) { return GetVital((int)index); }
public Vital(int i) { _type = (VitalName)i; _curValue = 0; }
void AddVitalModifier(VitalName vital, float ratio, params AttributeName[] attributes) { AddModifier(vital, v => GetVital((int)v), .33f, attributes); }
public Vital GetVital(VitalName vitalName) { return GetVital((int)vitalName); }
public static void SaveVital(VitalName name, Vital vital) { PlayerPrefs.SetInt(((VitalName)name).ToString() + BASE_VALUE, vital.BaseValue); PlayerPrefs.SetInt(((VitalName)name).ToString() + EXP_TO_LEVEL, vital.ExpToLevel); PlayerPrefs.SetInt(((VitalName)name).ToString() + CUR_VALUE, vital.CurValue); }
public static Vital LoadVital( VitalName name ) { pc.GetVital( (int)name ).BaseValue = PlayerPrefs.GetInt(((VitalName)name).ToString() + BASE_VALUE, 0); pc.GetVital( (int)name ).ExpToLevel = PlayerPrefs.GetInt(((VitalName)name).ToString() + EXP_TO_LEVEL, 0); //make sure you call this so that the AjustedBaseValue will be updated before you try to call to get the curValue pc.GetVital( (int)name ).Update(); //get the stored value for the curValue for each vital pc.GetVital( (int)name ).CurValue = PlayerPrefs.GetInt(((VitalName)name).ToString() + CUR_VALUE, 1); return pc.GetVital( (int)name ); // Vital temp = new Vital(); // temp.BaseValue = PlayerPrefs.GetInt(((VitalName)name).ToString() + BASE_VALUE, 0); // temp.ExpToLevel = PlayerPrefs.GetInt(((VitalName)name).ToString() + EXP_TO_LEVEL, 0); //make sure you call this so that the AjustedBaseValue will be updated before you try to call to get the curValue // temp.Update(); //get the stored value for the curValue for each vital // Debug.Log( "CUR: " + PlayerPrefs.GetInt(((VitalName)name).ToString() + CUR_VALUE, 1) ); // temp.CurValue = PlayerPrefs.GetInt(((VitalName)name).ToString() + CUR_VALUE, 1); // Debug.LogError( "Cur: " + temp.CurValue ); // return temp; }
public static void SaveVital(VitalName name, Vital vital) { PlayerPrefs.SetInt(((VitalName)name).ToString() + BASE_VALUE, vital.AdjustedBaseValue); PlayerPrefs.SetInt(((VitalName)name).ToString() + EXP_TO_LEVEL, vital.XptoLvL); PlayerPrefs.SetInt(((VitalName)name).ToString() + CUR_vALUE, vital.CurValue); }
private void AddVitalModifier(VitalName vital, AttributeName mod, float ratio) { GetSkill((int)vital).AddModifier(new ModifyingAttribute{attribute = GetPrimaryAttribute((int)mod), ratio = ratio}); }
private void AddVitalModifier(VitalName vital, AttributeName mod, float ratio) { GetSkill((int)vital).AddModifier(new ModifyingAttribute { attribute = GetPrimaryAttribute((int)mod), ratio = ratio }); }