public void StartBattle(PokemonParty playerParty, Pokemon wildPokemon) { this.playerParty = playerParty; this.wildPokemon = wildPokemon; player = playerParty.GetComponent <PlayerController>(); isTrainerBattle = false; StartCoroutine(SetupBattle()); }
//We want to setup everything at the very first frame of the battle public void StartBattle(PokemonParty playerParty, Pokemon wildPokemon) { isTrainerBattle = false; this.playerParty = playerParty; //this. is to use our variable and not the parameter this.wildPokemon = wildPokemon; player = playerParty.GetComponent <PlayerController>(); //Set a reference the player party StartCoroutine(SetupBattle()); //We call our SetupBattle function }
public void StartTrainerBattle(PokemonParty playerParty, PokemonParty trainerParty) { this.playerParty = playerParty; this.trainerParty = trainerParty; isTrainerBattle = true; player = playerParty.GetComponent <PlayerController>(); trainer = trainerParty.GetComponent <TrainerController>(); StartCoroutine(SetupBattle()); }
public void StartTrainerBattle(PokemonParty playerParty, PokemonParty trainerParty) //Beggin the trainer battle { this.playerParty = playerParty; //this. is to use the variable and not the parameter this.trainerParty = trainerParty; spriteRenderer = GetComponent <SpriteRenderer>(); isTrainerBattle = true; player = playerParty.GetComponent <PlayerController>(); //Set a reference the player party trainer = trainerParty.GetComponent <TrainerController>(); //Same with trainer StartCoroutine(SetupBattle()); //We call our SetupBattle function }