IEnumerator Co_Success() { uiSettingBtn.btn.enabled = false; yield return(new WaitForSeconds(0.5f)); SoundMgr.G.GameEffectPlay(EffectSound.win); textAnim.SetTrigger("ClearOn"); yield return(new WaitForSeconds(0.8f)); stage.FinalFinale(currentLimit); while (stage.isFinale) { yield return(null); } yield return(new WaitForSeconds(0.5f)); string level = string.Format("LEVEL {0}", (GameDataMgr.G.endLevel).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 += () => { GoLooby(); }; temp.onExit += () => { GoLooby(); }; ++GameDataMgr.G.endLevel; GameDataMgr.G.UpdateLevel(); }
public void Failed() { string levelNumber = string.Format("Level {0}", GameDataMgr.G.endLevel.ToString()); PopupConfirm temp = PopupConfirm.Open("Prefabs/Popup/GamePopup", "FailedPopup", levelNumber, null, "Try Again"); temp.GetComponent <GamePopup>().OnPopup(GamePopupState.failed); GamePopupItemGroup item = temp.GetComponentInChildren <GamePopupItemGroup>(); if (item != null) { item.BoosterItemSetting(); item.gameObject.GetComponent <UIWidget>().bottomAnchor.absolute = -4; } temp.onConfirm += () => { temp.Close(); Reset(); PopupGoal.Open("Goal Popup", level.goals); }; temp.onEixt += () => { sceneFade.delayTime = 0.15f; sceneFade.fadeTime = 0.3f; sceneFade.OnPressed(); }; }
IEnumerator Co_Failed() { while (stage.isWait) { yield return(null); } while (stage.IsMoving(State.move)) { yield return(null); } yield return(new WaitForSecondsRealtime(.5f)); textAnim.SetTrigger("FailedOn"); yield return(new WaitForSecondsRealtime(0.8f)); PopupConfirm noMoves = PopupConfirm.Open("Prefabs/Popup/NoMovesPopup", "Failed Moves Popup", null, null, "Play On"); noMoves.onConfirm += () => { currentLimit = 5; UpdateLimitCount(); isGameEnd = false; }; noMoves.onEixt += () => { noMoves.Close(); Failed(); }; }
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() { if (isLock) { return; } if (!IsWhetherOrNotToUse()) { return; } int index = (type == MittType.horizon) ? (int)ItemType.horizon : (int)ItemType.vertical; if (UserDataMgr.G.availableInGameItemCount[index] > 0) { GameDataMgr.G.isUseInGameItem[index] = !GameDataMgr.G.isUseInGameItem[index]; bool isUseItem = GameDataMgr.G.isUseInGameItem[index]; itemClicked.SetInfo(isUseItem, (ItemType)index); if (isUseItem) { DepthSetting(12); } else { ResetInfo(); } } else { //샵 팝업. string title = null; string msg = null; bool isTemp = true; if (type == MittType.horizon) { title = "Row Glove"; msg = string.Format("Removes everything in a row!"); } else { isTemp = false; title = "Column Glove"; msg = string.Format("Removes everything in a column!"); } PopupConfirm temp = PopupConfirm.Open("Prefabs/Popup/ItemPopup", "Item Popup", title, msg, "Buy"); temp.GetComponent <PopupItem>().ItemSetting("item_arrow", 400, isTemp); temp.onConfirm += () => { }; } }
public void Failed() { UserDataMgr.G.UpdateLife(); string levelNumber = string.Format("LEVEL {0}", GameDataMgr.G.endLevel.ToString()); PopupConfirm temp = PopupConfirm.Open("Prefabs/Popup/GamePopup", "FailedPopup", levelNumber, null, "TRY AGAIN", false); temp.GetComponent <GamePopup>().OnPopup(GamePopupState.failed); GamePopupItemGroup item = temp.GetComponentInChildren <GamePopupItemGroup>(); if (item != null) { item.BoosterItemSetting(); item.gameObject.GetComponent <UIWidget>().bottomAnchor.absolute = -4; } temp.onConfirm += () => { if (UserDataMgr.G.life > 0) { temp.Close(); Reset(); PopupGoal.Open("Goal Popup", level.goals); } else { 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(); }, true); } else { PopupMgr.G.ShowAdsPopup(null, "Watch ads and get rewarded.", "OK"); } } }; temp.onExit += () => { GoLooby(); }; }
public void OnPressed() { if (isLock) { return; } if (!IsWhetherOrNotToUse()) { return; } int index = (int)ItemType.mix; if (UserDataMgr.G.availableInGameItemCount[index] > 0) { GameDataMgr.G.isUseInGameItem[index] = !GameDataMgr.G.isUseInGameItem[index]; bool isUseItem = GameDataMgr.G.isUseInGameItem[index]; itemClicked.SetInfo(isUseItem, (ItemType)index); if (isUseItem) { DepthSetting(12); } else { ResetInfo(); } } else { //아이템 샵 팝업. string msg = string.Format("Shuffles all of the cubes!"); PopupConfirm temp = PopupConfirm.Open("Prefabs/Popup/ItemPopup", "Item Popup", "Tornado", msg, "Buy"); temp.GetComponent <PopupItem>().ItemSetting("item_shuffle", 100); temp.onConfirm += () => { }; } }
IEnumerator Co_Failed() { uiSettingBtn.btn.enabled = false; while (stage.isWait) { yield return(null); } while (stage.IsMoving(State.move)) { yield return(null); } yield return(new WaitForSeconds(.5f)); SoundMgr.G.GameEffectPlay(EffectSound.lose); textAnim.SetTrigger("FailedOn"); yield return(new WaitForSeconds(0.8f)); PopupConfirm noMoves = PopupConfirm.Open("Prefabs/Popup/NoMovesPopup", "Failed Moves Popup", null, null, "PLAY ON", false); PopupNoMoves popupNoMoves = noMoves.GetComponent <PopupNoMoves>(); if (popupNoMoves != null) { popupNoMoves.SetCoin(); } noMoves.onConfirm += () => { int useCoin = 100; if (UserDataMgr.G.IsCoins(useCoin)) { currentLimit = 5; UpdateLimitCount(); stage.BlockIconSetting(); isGameEnd = false; uiSettingBtn.btn.enabled = true; UserDataMgr.G.CoinsUsed(useCoin); if (popupNoMoves != null) { popupNoMoves.SetCoin(); } noMoves.Close(); } else { PopupMgr.G.ShowAdsPopup(null, "Watch ads and get rewarded.", "OK", () => { AdsMgr.G.fncSuccess = () => { if (popupNoMoves != null) { popupNoMoves.SetCoin(); } }; }); } }; noMoves.onExit += () => { noMoves.Close(); Failed(); }; }
private void DoSomeSkippedAction() { PopupConfirm.Open("Prefabs/Popup/QuitPopup", "QuitPopup", "Ad skip!", "It is skipped and cannot be rewarded.", "OK"); }
private void DoSomeSkippedFailed() { PopupConfirm.Open("Prefabs/Popup/QuitPopup", "QuitPopup", "Sorry", "The ad failed to be shown. \n Please try again.", "OK"); }