private void InitTeam() { var team = teamService.Team(TEAM_TYPE); Vehicle vehicle = null; if (team != null) { vehicle = vehicleService.AvailableVehicle(team.vehicleId); hero1 = heroService.AvailableHero(team.hero1Id); hero2 = heroService.AvailableHero(team.hero2Id); hero3 = heroService.AvailableHero(team.hero3Id); hero4 = heroService.AvailableHero(team.hero4Id); } SelectHero1(hero1); SelectHero2(hero2); SelectHero3(hero3); SelectHero4(hero4); if (vehicle == null) { vehicle = vehicleService.AvailableVehicle(); } vehicleAvatarPrefab = Instantiate(vehicleAvatarPrefab, vehicleCanvas); vehicleAvatarPrefab.SetVehicle(vehicle); vehicleAvatarPrefab.ActivateNextAvailableOnClick(); CheckButton(); }
private void InitTeam() { var team = teamService.Team(missionRequest.type); var vehicle = vehicleService.AvailableVehicle(team?.vehicleId) ?? vehicleService.AvailableVehicle(); vehicleAvatar.SetVehicle(vehicle); vehicleAvatar.ActivateNextAvailableOnClick(UpdateXpAndAsc); hero1.SetHero(heroService.AvailableHero(team?.hero1Id)); hero2.SetHero(heroService.AvailableHero(team?.hero2Id)); hero3.SetHero(heroService.AvailableHero(team?.hero3Id)); hero4.SetHero(heroService.AvailableHero(team?.hero4Id)); CheckButton(); }