Exemple #1
0
    public void SaveCardLibrary(CardLibray library)
    {
        string key = "CARD_";

        for (int i = 0; i < library.LibraryCount(); i++)
        {
            PlayerPrefs.SetInt(key + i, library.GetCardLevel(i));
        }
    }
Exemple #2
0
    public void LoadCardLibrary(CardLibray library)
    {
        string key = "CARD_";

        for (int i = 0; i < library.LibraryCount(); i++)
        {
            int level = PlayerPrefs.GetInt(key + i, 0);
            library.SetCardLevel(i, level);
        }

        //Can be moved to a game init file
        if (library.GetCardLevel((int)CardType.MONSTER) == 0)
        {
            library.SetCardLevel((int)CardType.MONSTER, 1);
        }
        if (library.GetCardLevel((int)CardType.ITEM) == 0)
        {
            library.SetCardLevel((int)CardType.ITEM, 1);
        }
    }