Ejemplo n.º 1
0
    //
    private void autoSaveNurture()
    {
        Nurture.Calendar calendar = NurtureMode.Calendar;
        CustomPlayerPrefs.SetInt(PlayerPrefsKey.YEAR, calendar.Year);
        CustomPlayerPrefs.SetInt(PlayerPrefsKey.MONTH, calendar.Month);

        Nurture.Character nurtureCharacter = NurtureMode.Character;
        int condition = (int)nurtureCharacter.Condition;

        CustomPlayerPrefs.SetInt(PlayerPrefsKey.CONDITION, condition);

        int actionCount = Manager.Instance.DT.Action.Count;

        for (int id = 0; id < actionCount; ++id)
        {
            string key = PlayerPrefsKey.GetKey(PlayerPrefsKey.ACTION_COUNT, id);
            CustomPlayerPrefs.SetInt(key, nurtureCharacter.GetActionCount(id));
        }

        CustomPlayerPrefs.SetInt(PlayerPrefsKey.MONEY, nurtureCharacter.Money);

        CustomPlayerPrefs.SetInt(PlayerPrefsKey.STRESS, nurtureCharacter.Stress);
        CustomPlayerPrefs.SetInt(PlayerPrefsKey.STAMINA, nurtureCharacter.Stamina);
        CustomPlayerPrefs.SetInt(PlayerPrefsKey.INTELLECT, nurtureCharacter.Intellect);
        CustomPlayerPrefs.SetInt(PlayerPrefsKey.GRACE, nurtureCharacter.Grace);
        CustomPlayerPrefs.SetInt(PlayerPrefsKey.CHARM, nurtureCharacter.Charm);
        CustomPlayerPrefs.SetInt(PlayerPrefsKey.ATTACK, nurtureCharacter.Attack);
        CustomPlayerPrefs.SetInt(PlayerPrefsKey.DEFENSE, nurtureCharacter.Defense);
        CustomPlayerPrefs.SetInt(PlayerPrefsKey.LEADERSHIP, nurtureCharacter.Leadership);
        CustomPlayerPrefs.SetInt(PlayerPrefsKey.TACTIC, nurtureCharacter.Tactic);
        CustomPlayerPrefs.SetInt(PlayerPrefsKey.MORALITY, nurtureCharacter.Morality);
        CustomPlayerPrefs.SetInt(PlayerPrefsKey.GOODNESS, nurtureCharacter.Goodness);
        CustomPlayerPrefs.SetInt(PlayerPrefsKey.SENSIBILITY, nurtureCharacter.Sensibility);
        CustomPlayerPrefs.SetInt(PlayerPrefsKey.ARTS, nurtureCharacter.Arts);
    }
Ejemplo n.º 2
0
    private void loadAllStat(Nurture.Character character)
    {
        if (null == character)
        {
            Log.Error("not found Nurture.Character");
            return;
        }

        int stress      = CustomPlayerPrefs.GetInt(PlayerPrefsKey.STRESS, -1);
        int stamina     = CustomPlayerPrefs.GetInt(PlayerPrefsKey.STAMINA, -1);
        int intellect   = CustomPlayerPrefs.GetInt(PlayerPrefsKey.INTELLECT, -1);
        int grace       = CustomPlayerPrefs.GetInt(PlayerPrefsKey.GRACE, -1);
        int charm       = CustomPlayerPrefs.GetInt(PlayerPrefsKey.CHARM, -1);
        int attack      = CustomPlayerPrefs.GetInt(PlayerPrefsKey.ATTACK, -1);
        int defense     = CustomPlayerPrefs.GetInt(PlayerPrefsKey.DEFENSE, -1);
        int leadership  = CustomPlayerPrefs.GetInt(PlayerPrefsKey.LEADERSHIP, -1);
        int tactic      = CustomPlayerPrefs.GetInt(PlayerPrefsKey.TACTIC, -1);
        int morality    = CustomPlayerPrefs.GetInt(PlayerPrefsKey.MORALITY, -1);
        int goodness    = CustomPlayerPrefs.GetInt(PlayerPrefsKey.GOODNESS, -1);
        int sensibility = CustomPlayerPrefs.GetInt(PlayerPrefsKey.SENSIBILITY, -1);
        int arts        = CustomPlayerPrefs.GetInt(PlayerPrefsKey.ARTS, -1);

        character.Stress      = stress;
        character.Stamina     = stamina;
        character.Intellect   = intellect;
        character.Grace       = grace;
        character.Charm       = charm;
        character.Attack      = attack;
        character.Defense     = defense;
        character.Leadership  = leadership;
        character.Tactic      = tactic;
        character.Morality    = morality;
        character.Goodness    = goodness;
        character.Sensibility = sensibility;
        character.Arts        = arts;
    }