| | |
| | | /// </summary> |
| | | protected void Victory() |
| | | { |
| | | ++GameConfig.GameCompletedCount; |
| | | EventCenter.Ins.BroadCast((int)KTGMGemClient.EventType.EndlessLevelCompleted); |
| | | EndlessUIStart.instance.Pause(); |
| | | |
| | | int showFavorite = PlayerPrefs.GetInt("GemBattleFavorite"); |
| | | ShowPanel(); |
| | | |
| | | if (showFavorite == 0) |
| | | { |
| | | GameObject go = Instantiate(Resources.Load<GameObject>("UI/Favorite/FavoritePanel"), this.transform.parent.parent); |
| | | FavoritePanelUI panelUI = go.GetComponent<FavoritePanelUI>(); |
| | | panelUI.SetAC(ShowPanel); |
| | | // int showFavorite = PlayerPrefs.GetInt("GemBattleFavorite"); |
| | | |
| | | } |
| | | else |
| | | { |
| | | ShowPanel(); |
| | | } |
| | | // if (showFavorite == 0) |
| | | // { |
| | | // GameObject go = Instantiate(Resources.Load<GameObject>("UI/Favorite/FavoritePanel"), this.transform.parent.parent); |
| | | // FavoritePanelUI panelUI = go.GetComponent<FavoritePanelUI>(); |
| | | // panelUI.SetAC(ShowPanel); |
| | | |
| | | // } |
| | | // else |
| | | // { |
| | | // ShowPanel(); |
| | | // } |
| | | } |
| | | |
| | | private void ShowPanel() |
| | |
| | | protected void SafelyUnsubscribe() |
| | | { |
| | | LazyLoad(); |
| | | levelManager.LevelCompleted -= Victory; |
| | | if (levelManager != null) |
| | | levelManager.LevelCompleted -= Victory; |
| | | } |
| | | |
| | | /// <summary> |