public void Init(ScavengerHuntData scavengerHuntData, int totalItemsHidden, int totalItemsFound, bool isWinner) { this.scavengerHuntData = scavengerHuntData; this.totalItemsHidden = totalItemsHidden; this.totalItemsFound = totalItemsFound; this.isWinner = isWinner; if (isWinner) { HeaderTitle.text = Service.Get <Localizer>().GetTokenTranslation("PartyGames.ScavengerHunt.Winner"); if (WinnerFX != null) { WinnerFX.SetActive(value: true); } } else { HeaderTitle.text = Service.Get <Localizer>().GetTokenTranslation("PartyGames.ScavengerHunt.TryAgain"); } setRewards(); if (totalItemsHidden == 0) { SingleMessageText.gameObject.SetActive(value: true); if (scavengerHuntData.LocalPlayerRole == ScavengerHunt.ScavengerHuntRoles.Finder) { string tokenTranslation = Service.Get <Localizer>().GetTokenTranslation("PartyGames.ScavengerHunt.DidntHideMessage"); SingleMessageText.text = string.Format(tokenTranslation, scavengerHuntData.OtherPlayerName); } else { string tokenTranslation = Service.Get <Localizer>().GetTokenTranslation("PartyGames.ScavengerHunt.DidntHideMessage"); SingleMessageText.text = string.Format(tokenTranslation, scavengerHuntData.LocalPlayerName); } } else if (totalItemsFound == 0) { SingleMessageText.gameObject.SetActive(value: true); if (scavengerHuntData.LocalPlayerRole == ScavengerHunt.ScavengerHuntRoles.Finder) { SingleMessageText.text = Service.Get <Localizer>().GetTokenTranslation("Activity.ScavengerHunt.NoneFound"); return; } string tokenTranslation2 = Service.Get <Localizer>().GetTokenTranslation("Activity.ScavengerHunt.SeekerFailed"); SingleMessageText.text = string.Format(tokenTranslation2, scavengerHuntData.OtherPlayerName); } else { SingleMessageText.gameObject.SetActive(value: false); Content.LoadAsync(onPlayerResultsLoaded, PLAYER_RESULTS_PREFAB_KEY); } }
public void Init(long userId, int introTimeInSeconds, ScavengerHuntData scavengerHunData) { this.userId = userId; this.scavengerHunData = scavengerHunData; CoroutineRunner.Start(randomizeRoles(introTimeInSeconds), this, "randomizeRoles"); }
public void Init(ScavengerHuntData scavengerHuntData) { this.scavengerHuntData = scavengerHuntData; }