private void LoadStickers(bool loadRecent = false) { ReturnStickerViewToPool(); if (!loadRecent && selectedTab == null) { return; } List <string> stickers = loadRecent ? dataProvider.GetRecentStickers() : dataProvider.GetAllStickers(selectedTab.Tag); if (stickers.Count == 0) { return; } foreach (string id in stickers) { FizzHypercasualDataItem stickerItem = dataProvider.GetSticker(id); if (stickerItem == null) { continue; } FizzHypercasualStickerView stickerView = GetStickerViewFromPool(); stickerView.gameObject.SetActive(true); stickerView.transform.SetParent(StickersContainer, false); stickerView.transform.localScale = Vector3.one; stickerView.SetStickerData(stickerItem); stickerView.OnStickerClick = OnStickerClicked; } }
private void LoadPhrases(bool loadRecent = false) { ReturnPhraseViewToPool(); if (!loadRecent && selectedTab == null) { return; } List <string> phrases = loadRecent ? dataProvider.GetRecentPhrases() : dataProvider.GetAllPhrases(selectedTab.Tag); if (phrases.Count == 0) { return; } foreach (string id in phrases) { FizzHypercasualDataItem phraseItem = dataProvider.GetPhrase(id); if (phraseItem == null) { continue; } FizzHypercasualPhraseView phraseView = GetPhraseViewFromPool(); phraseView.gameObject.SetActive(true); phraseView.transform.SetParent(PhrasesContainer, false); phraseView.transform.localScale = Vector3.one; phraseView.SetPhraseData(phraseItem); phraseView.OnPhraseClick = OnPhraseClicked; } }
public void SetStickerData(FizzHypercasualDataItem dataItem) { data = (FizzHypercasualStickerDataItem)dataItem; StickerImage.sprite = data.Content; }
public void SetPhraseData(FizzHypercasualDataItem dataItem) { data = (FizzHypercasualPhraseDataItem)dataItem; phraseLabel.text = data.GetLocalizedContent(Application.systemLanguage); }