Example #1
0
    public static void Load()
    {
        ResetData();

        sSelectedCharacter = (SelectedCharacter)PlayerPrefs.GetInt("PlayerCharacter", (int)sSelectedCharacter);

        sNumBankedHearts = PlayerPrefs.GetInt("NumBankedHearts", sNumBankedHearts);
        sNumHearts       = PlayerPrefs.GetInt("NumHearts", sNumHearts);
        sCurrentFloor    = PlayerPrefs.GetInt("CurrentFloor", sCurrentFloor);
        sNumAmmo         = PlayerPrefs.GetInt("NumAmmo", sNumAmmo);
        sMaxAmmo         = PlayerPrefs.GetInt("MaxAmmo", sMaxAmmo);

        for (int i = 0, n = (int)ItemId.NumItems; i < n; ++i)
        {
            ItemId itemId = (ItemId)i;
            if (PlayerPrefs.GetInt(string.Format("Item_{0}", itemId.ToString()), 0) > 0)
            {
                sCollectedItems.Add(itemId);
            }
        }

        for (int i = 0, n = (int)BossId.NumBosses; i < n; ++i)
        {
            BossId bossId = (BossId)i;
            if (PlayerPrefs.GetInt(string.Format("Boss_{0}", bossId.ToString()), 0) > 0)
            {
                sBossesDefeated.Add(bossId);
            }
        }

        sActiveBoss = (BossId)PlayerPrefs.GetInt("ActiveBoss", (int)sActiveBoss);

        sGameLoaded = true;
    }
Example #2
0
    public static void SetBossDefeated(BossId id)
    {
        if (id != BossId.None)
        {
            sBossesDefeated.Add(id);
            Analytics.CustomEvent(string.Format("BossDefeated-{0}", id.ToString()), new Dictionary <string, object> {
                { "CurrentFloor", sCurrentFloor },
                { "NumHearts", TotalHearts }
            });
        }

        ActiveBoss = BossId.None;
    }
Example #3
0
    public static void SetBossDefeated(BossId id)
    {
        if(id != BossId.None)
        {
            sBossesDefeated.Add(id);
            Analytics.CustomEvent(string.Format("BossDefeated-{0}", id.ToString()), new Dictionary<string, object> {
            { "CurrentFloor", sCurrentFloor},
            { "NumHearts", TotalHearts }});
        }

        ActiveBoss = BossId.None;
    }