public void PickCharacter(string slotName) { CharacterBlob blob = null; if (!_playerBlob.CharacterBlobSlots.TryGetValue(slotName, out blob)) { Debug.LogError("Tried to pick character in slot: " + slotName + " and it does not exist in the blob"); } _characterBlob = blob; }
public void Initialize(string slotName, CharacterBlob blob, Action <string> createCharacterCallback, Action <string> deleteCharacterCallback, Action <string> chooseCharacterCallback) { _slotName = slotName; _blob = blob; _createCharacterCallback = createCharacterCallback; _deleteCharacterCallback = deleteCharacterCallback; _chooseCharacterCallback = chooseCharacterCallback; if (_blob != null) { InitializeFullView(); } else { InitializeEmptyView(); } }
public void CreateNewCharacter(string slotName) { CharacterBlob blob; if (_playerBlob.CharacterBlobSlots.TryGetValue(slotName, out blob)) { if (blob != null) { Debug.Log("Can't create new character on existing slot, Delete the character first"); } else { CharacterBlob newChar = CharacterBlob.NewCharacterBlob("testName"); _playerBlob.CharacterBlobSlots[slotName] = newChar; } } SavePlayerData(); }
// these values should come from somewhere else, revisit public static CharacterBlob NewCharacterBlob(string name) { CharacterBlob blob = new CharacterBlob() { Name = name, MaxLives = 3, CurrentLives = 3, MapBlob = null, OwnedTiles = new Dictionary <string, int>() { { "T0_Sword_01", 1 }, { "T0_Bow_01", 1 }, { "T0_Tome_01", 1 }, { "T0_Mace_01", 1 } }, }; return(blob); }