private IEnumerator TryDepositPartyPokemon(byte pokemonIndex) { PokemonInstance pokemon = PlayerData.singleton.partyPokemon[pokemonIndex]; if (PlayerData.singleton.GetNumberOfPartyPokemon() == 1) //Player shouldn't be allowed to deposit their last party pokemon { yield return(StartCoroutine( textBoxController.RevealText("You can't deposit your last party pokemon", true) )); } else if (PlayerData.singleton.boxPokemon.boxes[currentBoxIndex].IsFull) { yield return(StartCoroutine( textBoxController.RevealText("Box is already full", true) )); } else { //Pokemon should be fully restored when they are put in the storage system pokemon.RestoreFully(); PlayerData.singleton.boxPokemon.boxes[currentBoxIndex].AddPokemon(pokemon); PlayerData.singleton.partyPokemon[pokemonIndex] = null; } }