public void GenerateRandomCharacter() { if (GameData.instance.playerData.gold < model.rollCost) { Debug.LogError("Not enough gold."); return; } FighterData gachaCharacter = FighterGenerator.GenerateFighter(); bool isSuccessfullyAdded = GameData.instance.AddFighter(gachaCharacter); if (isSuccessfullyAdded) { // TODO: Build/Randomize sprite here, then save to playerData. view.DisplayGachaCharacter(gachaCharacter); GameData.instance.playerData.gold -= model.rollCost; app.view.headerView.UpdateGoldValue(); GameData.instance.playerData.Save(); CheckGold(); } else { //TODO Popup something here Debug.LogError("Failed to add, team already full!"); } }
public void InitFirstFighter() { // Create default character FighterData fd = FighterGenerator.GenerateFighter(); AddFighter(fd); SetFighterOnActiveParty(fd, 0); playerData.Save(); }