IEnumerator Co_Success() { yield return(new WaitForSecondsRealtime(.5f)); textAnim.SetTrigger("ClearOn"); yield return(new WaitForSecondsRealtime(0.8f)); stage.FinalFinale(currentLimit); while (stage.isFinale) { yield return(null); } yield return(new WaitForSecondsRealtime(.5f)); string level = string.Format("Level {0}", (GameDataMgr.G.endLevel - 1).ToString()); PopupConfirm temp = PopupConfirm.Open("Prefabs/Popup/GamePopup", "SuccessPopup", level, null, "Continue"); temp.GetComponent <GamePopup>().OnPopup(GamePopupState.success); temp.GetComponentInChildren <SuccessPopup>().SetInfo(gameState.score, gameUI.progressBar.GetStars(), gameUI.goalUI.group); temp.onConfirm += () => { sceneFade.delayTime = 0.15f; sceneFade.fadeTime = 0.3f; sceneFade.OnPressed(); }; temp.onEixt += () => { sceneFade.delayTime = 0.15f; sceneFade.fadeTime = 0.3f; sceneFade.OnPressed(); }; }
public void OnPressed() { SoundMgr.G.EffectPlay(EffectSound.btn_ok); if (UserDataMgr.G.life <= 0) { int count = 1; if (UserDataMgr.G.IsItemCoins(count)) { PopupMgr.G.ShowItemPopup("Life Item Popup", "LIFE", "You can play the game with life!", "BUY", "life_icon", count, GameDataMgr.G.itemCost, () => { UserDataMgr.G.CoinsUsed(GameDataMgr.G.itemCost * count); UserDataMgr.G.life += count; UserDataMgr.G.SetTimeToNextLife(); if (LobbyMgr.G != null && LobbyMgr.G.levelNumber != null) { LobbyMgr.G.levelNumber.UpdateLifeLabel(); LobbyMgr.G.levelNumber.UpdateCoin(); } }); } else { PopupMgr.G.ShowAdsPopup(null, "Not enough coins and life." + "\n" + "Watch ads and get rewarded.", "OK"); } return; } string level = string.Format("LEVEL {0}", GameDataMgr.G.endLevel.ToString()); PopupConfirm temp = PopupConfirm.Open("Prefabs/Popup/GamePopup", "StartPopup", level, null, "PLAY"); temp.GetComponent <GamePopup>().OnPopup(GamePopupState.start); GamePopupItemGroup item = temp.GetComponentInChildren <GamePopupItemGroup>(); if (item != null) { item.BoosterItemSetting(); item.gameObject.GetComponent <UIWidget>().bottomAnchor.absolute = 50; } temp.onConfirm += () => { SceneFadeInOut fade = gameObject.GetComponentInParent <SceneFadeInOut>(); fade.delayTime = 0.15f; fade.fadeTime = 0.3f; fade.OnPressed(); }; }
public void OnPressed() { string level = string.Format("Level {0}", GameDataMgr.G.endLevel.ToString()); PopupConfirm temp = PopupConfirm.Open("Prefabs/Popup/GamePopup", "StartPopup", level, null, "Play"); temp.GetComponent <GamePopup>().OnPopup(GamePopupState.start); GamePopupItemGroup item = temp.GetComponentInChildren <GamePopupItemGroup>(); if (item != null) { item.BoosterItemSetting(); item.gameObject.GetComponent <UIWidget>().bottomAnchor.absolute = 50; } temp.onConfirm += () => { SceneFadeInOut fade = gameObject.GetComponentInParent <SceneFadeInOut>(); fade.delayTime = 0.15f; fade.fadeTime = 0.3f; fade.OnPressed(); }; }
public void GoLooby() { sceneFade.delayTime = 0.15f; sceneFade.fadeTime = 0.3f; sceneFade.OnPressed(); }