public void StartTrainerBattle(TrainerController trainer) { state = GameState.Battle; battleSystem.gameObject.SetActive(true); worldCamera.gameObject.SetActive(false); this.trainer = trainer; var playerParty = playerController.GetComponent <PokemonParty>(); var trainerParty = trainer.GetComponent <PokemonParty>(); battleSystem.StartTrainerBattle(playerParty, trainerParty); }
TrainerController trainer; //Reference the trainer public void StartTrainerBattle(TrainerController trainer) { state = GameState.Battle; battleSystem.gameObject.SetActive(true); worldCamera.gameObject.SetActive(false); this.trainer = trainer; //Set THIS specific trainer as our reference var playerParty = playerController.GetComponent <PokemonParty>(); //Store our party in a var var trainerParty = trainer.GetComponent <PokemonParty>(); //Store the trainer party in a var battleSystem.StartTrainerBattle(playerParty, trainerParty); //Call our StartBattle, so every fight are not the same }
public void StartTrainerBattle(TrainerController trainer) { if (state != GameState.Battle) //Preventing from entering a battle when already in one. { //Player.SetActive(false); state = GameState.Battle; battleSystem.gameObject.SetActive(true); freeroamCam.gameObject.SetActive(false); //used to return the player creatures //var playerTeam = playerController3D.GetComponent<CreatureTeam>(); var playerTeam = playerController360.GetComponent <CreatureTeam>(); var trainerTeam = trainer.GetComponent <CreatureTeam>(); battleSystem.StartTrainerBattle(playerTeam, trainerTeam); } }