public void printNewPoke() { BattleCanvasScript bcScript = battleCanvas.GetComponent <BattleCanvasScript>(); Pokemon temp = pokemon[pok2]; pokemon[pok2] = pokemon[pok1]; pokemon[pok1] = temp; bcScript.changeTitleText("Lets Go " + pokemon[0].name + "!", bcScript.time); }
public void swapPokemon() { pok1--; pok2--; int movedPoke = pok1; int desiredPoke = pok2; if (battleCanvas.activeSelf) { BattleCanvasScript bcScript = battleCanvas.GetComponent <BattleCanvasScript>(); bcScript.buttonTransparent(); if (movedPoke == 0 || desiredPoke == 0) { bcScript.changeTitleText("Good Stuff " + pokemon[0].name + "!", bcScript.time); Invoke("printNewPoke", bcScript.time); Invoke("enemyTurnFight", bcScript.time * 2); } else { Pokemon temp = pokemon[pok2]; pokemon[pok2] = pokemon[pok1]; pokemon[pok1] = temp; bcScript.changeTitleText("You swapped " + pokemon[movedPoke].name + " with " + pokemon[desiredPoke].name + "!", bcScript.time); Invoke("enemyTurnFight", bcScript.time); } } else { Pokemon temp = pokemon[pok2]; pokemon[pok2] = pokemon[pok1]; pokemon[pok1] = temp; } pokemonCanvas.SetActive(false); description.text = ""; }