void OnRandomChallengePanelClose() { _stage.HideLoader(); _sendingRandomChallengeSubPanel.OnCloseEvent -= OnRandomChallengePanelClose; _sendingRandomChallengeSubPanel.Dispose(); DestroyImmediate(_sendingRandomChallengeSubPanel.gameObject); _sendingRandomChallengeSubPanel = null; Transform subPanelContent = _challengeSubPanel.GetComponent <ScrollRect>().content.GetComponent <Transform>(); subPanelContent.GetComponent <FadeMe> ().startFadeIn(0.5f); // LeanTween.delayedCall (0.25f, ShowSendingChallengeSubScreen); }
IEnumerator LoadRandomChallengeSubScreen() { GameItemData dataCategoryItems = loadedData.allRoundData[_selectedCatIndex]; GameDataItems gameDataItem = dataCategoryItems.items[_selectedItemIndex]; GameObject subScreen = (GameObject)Instantiate(Resources.Load("HomeScreen/screens/SendingRandomChallengeSubScreen")); _sendingRandomChallengeSubPanel = subScreen.GetComponent <SendingRandomChallengeSubPanel>(); _sendingRandomChallengeSubPanel.gameObject.transform.SetParent(_stage.transform, false); _sendingRandomChallengeSubPanel.Show(gameDataItem, homeScreenIconPath + dataCategoryItems.imagePath); _sendingRandomChallengeSubPanel.OnCloseEvent += OnRandomChallengePanelClose; yield return(subScreen); Transform sendingSubPanelContent = _sendingRandomChallengeSubPanel.GetComponent <ScrollRect>().content.GetComponent <Transform>(); sendingSubPanelContent.GetComponent <FadeMe> ().startFadeIn(0.5f); yield return(_waitLoadAnimation); _stage.ShowLoader(); }