public async void OnEnable() { userId = UserManager.Get.getCurrentUserId(); token = UserManager.Get.getCurrentSessionToken(); tournamentJson = await TournamentManager.Get.getTournament(TournamentController.getCurrentTournamentID(), token); setTournamentData(); initUI(challenges, participants); if (!isAvailable() || !isNextChallengeAvailable()) { Play.interactable = false; } else { Play.interactable = true; } }
public async void setResult(float score) { if (EventsController.ChallengeType == ChallengeManager.CHALLENGE_TYPE_1V1) { SeembaAnalyticsManager.Get.SendUserDuelEvent("Duel Finished", ChallengeManager.CurrentChallengeId, score); LoaderManager.Get.LoaderController.ShowLoader(null); var resAddScore = await ChallengeManager.Get.addScore(ChallengeManager.CurrentChallengeId, score); ChallengeManager.Get.ShowResult(); LoaderManager.Get.LoaderController.HideLoader(); } else if (EventsController.ChallengeType == ChallengeManager.CHALLENGE_TYPE_BRACKET) { SeembaAnalyticsManager.Get.SendTournamentEvent("Tournament Challenge done", TournamentController.getCurrentTournamentID(), score); LoaderManager.Get.LoaderController.ShowLoader(null); await TournamentManager.Get.addScore(TournamentController.getCurrentTournamentID(), score); ViewsEvents.Get.GoToMenu(ViewsEvents.Get.Brackets.gameObject); SeembaAnalyticsManager.Get.SendTournamentEvent("Return to tournament", TournamentController.getCurrentTournamentID(), score); ViewsEvents.Get.Brackets.OnEnable(); } SceneManager.UnloadSceneAsync(GamesManager.GAME_SCENE_NAME); LoaderManager.Get.LoaderController.HideLoader(); }