/// <summary> /// Resets game data. /// </summary> public void ResetGameData() { // Take the first launch reward (so it can be given again) m_firstLaunchReward.Take(); // Reset coin balance to 0 SetCoinBalance(0); // Unequip equipped character EquippableVG vg = StoreInventory.GetEquippedVirtualGood(CRCAssets.GetCharactersCategory()); if (vg != null) { StoreInventory.UnEquipVirtualGood(vg.ItemId); } // Remove all characters from inventory for (int index = 0; index < CRCAssets.CharactersLTVGArray.Length; ++index) { VirtualGood charVG = CRCAssets.CharactersLTVGArray[index]; if (charVG != null) { charVG.ResetBalance(0); } } // Reset other data SoomlaDataSystem dataSystem = (SoomlaDataSystem)Locator.GetDataSystem(); dataSystem.ResetGameData(); // Reset all characters to unused for (int index = 0; index < CRCAssets.CharactersLTVGArray.Length; ++index) { dataSystem.SetCharacterUsed((CharacterType)index, false); } }
/// <summary> /// Gets the currently equipped character. /// </summary> /// <returns>The equipped character</returns> public CharacterType GetEquippedCharacter() { EquippableVG evg = StoreInventory.GetEquippedVirtualGood(CRCAssets.GetCharactersCategory()); if (evg != null) { return(m_charItemIDDictionary[evg.ItemId]); } // Give first character and equip CharacterType firstCharacter = CharacterType.Chicken; if (!IsOwned(firstCharacter)) { GiveCharacter(firstCharacter); } EquipCharacter(firstCharacter); return(firstCharacter); }