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(); }; }
public void GameStart() { level = GameDataMgr.G.level; availableColors = level.availableColors; gameUI.progressBar.Init(level.score1, level.score2, level.score3); gameUI.SetBG(level.id); Reset(); uiSettingBtn.btn.enabled = true; PopupGoal.Open("Goal Popup", level.goals); }
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(); }; }
private void Start() { //if (Screen.sleepTimeout != SleepTimeout.NeverSleep) //{ // Screen.sleepTimeout = SleepTimeout.NeverSleep; // Screen.SetResolution(720, 1280, true); //} level = GameDataMgr.G.level; availableColors = level.availableColors; gameUI.progressBar.Init(level.score1, level.score2, level.score3); Reset(); PopupGoal.Open("Goal Popup", level.goals); }