public static bool priceCheck(ShopItem.Type type, int price, bool openShop = true) { switch (type) { case ShopItem.Type.gold: if (GameDataManager.instance.gold < price) { if (openShop) { UISystemPopup.open(UISystemPopup.PopupType.GoToGoldShop); } return(false); } break; case ShopItem.Type.ruby: if (GameDataManager.instance.ruby < price) { if (openShop) { UISystemPopup.open(UISystemPopup.PopupType.GoToRubyShop); } return(false); } break; } return(true); }
public static void showEndPopup() { if (_initEndPopupData == false) { initEndPopupData(); _initEndPopupData = true; } if (_endPoupData != null && _endPoupData.Count > 0) { int chance = UnityEngine.Random.Range(0, _totalChance) + 1; int nowChance = 0; for (int i = 0; i < _endPoupData.Count; ++i) { nowChance += _endPoupData[i].chance; if (nowChance >= chance) { UISystemPopup.open(UISystemPopup.PopupType.EndGame, _endPoupData[i].imgUrl, null, null, _endPoupData[i].packageName); return; } } } UISystemPopup.open(UISystemPopup.PopupType.YesNo, Util.getUIText("END_GAME"), GameManager.me.OnApplicationQuit, null); }
void onClickGuestId(GameObject go) { if (GameManager.me.isGuest) { UISystemPopup.open(UISystemPopup.PopupType.Default, "[ " + Util.getUIText("GUIEST_ID") + " ]\n" + PandoraManager.instance.guestUserId + ".device\n" + PandoraManager.instance.localUser.userID); } }
int onClick(int slotIndex, GameIDData slotData) { if (sourceListIndex.Contains(slotIndex) == false) { if (sourceList.Count > 0 && _enoughSelection) { UISystemPopup.open(UISystemPopup.PopupType.Default, Util.getUIText("REINFORCE_UNNECESSARRY")); return(0); } if (sourceListIndex.Count < 5) { sourceListIndex.Add(slotIndex); sourceList.Add(slotData); return(1); } else { UISystemPopup.open(UISystemPopup.PopupType.Default, Util.getUIText("REINFORCE_SELECT_LIMIT")); } } else { int tempI = sourceListIndex.IndexOf(slotIndex); sourceListIndex.RemoveAt(tempI); sourceList.RemoveAt(tempI); return(-1); } return(0); }
void onClickPVP(GameObject go) { if (GameManager.me.uiManager.uiMenu.uiFriend.slotMachine.isReady == false) { return; } int leftNum = GameDataManager.instance.friendlyPVPMax; if (GameDataManager.instance.friendlyPVPIds != null) { leftNum = GameDataManager.instance.friendlyPVPMax - GameDataManager.instance.friendlyPVPIds.Length; if (leftNum <= 0) { UISystemPopup.open("오늘의 친선경기 횟수를 초과했습니다."); return; } else { foreach (string id in GameDataManager.instance.friendlyPVPIds) { if (id == data.userId) { UISystemPopup.open("오늘 이미 대전한 친구입니다."); return; } } } } GameManager.me.uiManager.popupFriendlyPVPAttack.show(); GameManager.me.uiManager.popupFriendlyPVPAttack.setData(data.userId, leftNum, data.pvpReward); }
public void onClickChampionship(GameObject go) { #if UNITY_EDITOR if (DebugManager.instance.useDebug) { return; } #endif if (GameManager.me.uiManager.uiLoading.gameObject.activeSelf) { return; } if (nowPlayingWalkAnimation) { return; } if (stageClearRewardPopup.gameObject.activeSelf) { return; } if (GameDataManager.instance.roundClearStatusCheck(1, 4, 5) == false) { // UISystemPopup.open(UISystemPopup.PopupType.Default, "4스테이지를 클리어하면 입장하실 수 있습니다."); UISystemPopup.open(UISystemPopup.PopupType.Default, Util.getUIText("CHAMP_JOIN_CNDT")); return; } if (GameManager.me.uiManager.popupSummonDetail.gameObject.activeSelf) { return; } if ((GameDataManager.instance.championshipStatus != WSDefine.CHAMPIONSHIP_OPEN)) { DateTime checkTime = System.DateTime.Now; if (checkTime.DayOfWeek == DayOfWeek.Monday && (checkTime.Hour >= 12)) { } else { // UISystemPopup.open("준비 중입니다."); UISystemPopup.open(UISystemPopup.PopupType.Default, Util.getUIText("CHAMP_WAITING")); return; } } GameManager.me.uiManager.popupChampionship.show(); }
void onClickPVP(GameObject go) { int leftNum = GameDataManager.instance.friendlyPVPMax; if (GameDataManager.instance.friendlyPVPIds != null) { leftNum = GameDataManager.instance.friendlyPVPMax - GameDataManager.instance.friendlyPVPIds.Length; if (leftNum <= 0) { UISystemPopup.open(Util.getUIText("FRIENDLY_OVERLIMIT")); return; } else { foreach (string id in GameDataManager.instance.friendlyPVPIds) { if (id == data.userId) { UISystemPopup.open(Util.getUIText("FRIENDLY_ALREADY")); return; } } } } GameManager.me.uiManager.popupFriendlyPVPAttack.show(); GameManager.me.uiManager.popupFriendlyPVPAttack.setData(data.userId, leftNum, data.pvpReward); }
public void onStartRound(GameObject go) { if (GameManager.me.uiManager.uiLoading.gameObject.activeSelf) { return; } #if UNITY_EDITOR if (DebugManager.instance.useDebug) { GameManager.me.startGame(0.5f); } else #endif { if (GameDataManager.instance.energy > 0) { EpiServer.instance.sendPlayEpic(_selectedAct, _selectedStage, _selectedRound); if (GameDataManager.instance.roundClearStatusCheck(_selectedAct, _selectedStage, _selectedRound) == false) { PlayerPrefs.SetInt("CS" + _selectedAct + _selectedStage + _selectedRound, WSDefine.YES); } } else { UISystemPopup.open(UISystemPopup.PopupType.YesNo, Util.getUIText("GO_TO_ENERGYSHOP"), goToEnergyShop); } } }
void onStart(GameObject go) { #if UNITY_EDITOR if (DebugManager.instance.useDebug) { hide(); startHell(); } else #endif { if (GameDataManager.instance.hellTicket > 0) { // if(Time.realtimeSinceStartup - _lastTouchTime > 1.0f) { EpiServer.instance.sendPlayHell(); _lastTouchTime = Time.realtimeSinceStartup; } } else { if (GameDataManager.instance.serviceMode == GameDataManager.ServiceMode.CBT) { UISystemPopup.open(UISystemPopup.PopupType.Default, Util.getUIText("NO_HELLTICKET", "10")); } else { UISystemPopup.open(UISystemPopup.PopupType.Default, Util.getUIText("NO_HELLTICKET", "3")); } //UISystemPopup.open( UISystemPopup.PopupType.YesNoPrice, Util.getUIText("CHALLENGE_BY_RUBY",GameDataManager.instance.challengeRoundInfo.playNeedRuby.ToString()), onConfirnRubyChallenge, null, GameDataManager.instance.challengeRoundInfo.playNeedRuby.ToString()); } } }
void onClickEvolution(GameObject go) { if (btnClose.gameObject.activeSelf == false) { return; } if (popupType == RuneInfoPopup.Type.Reinforce && RuneStudioMain.instance.step != RuneStudioMain.Step.Finish) { Debug.Log("wait..."); return; } if (data.rare >= RareType.SS) { UISystemPopup.open(UISystemPopup.PopupType.Default, Util.getUIText("EVOLVE_NOMORE")); return; } else if (data.rare != RareType.S || data.reinforceLevel < 20) { UISystemPopup.open(UISystemPopup.PopupType.Default, Util.getUIText("EVOLVE_LEVELLIMIT")); return; } GameManager.me.uiManager.popupEvolution.show(Rune.Type.Unit, data.serverId, (isFromInventorySlot)?WSDefine.NO:WSDefine.YES); }
protected override void onClickClose(GameObject go) { inputField.label.text = inputField.label.text.Trim(); if (Encoding.UTF8.GetByteCount(inputField.label.text) > 24) { UISystemPopup.open(UISystemPopup.PopupType.Default, Util.getUIText("NICKNAME_OVER")); } else { if (checkNickNameCharacter(inputField.label.text) == false) { UISystemPopup.open(UISystemPopup.PopupType.Default, Util.getUIText("NICK_SPACE_ERORR")); return; } if (inputField.label.text.Contains(" ")) { UISystemPopup.open(UISystemPopup.PopupType.Default, Util.getUIText("NICK_CHAR_ERROR")); return; } EpiServer.instance.sendSetNickName(inputField.label.text); } }
public static void checkLevelupPopupWithoutCallback(PopupData.PopupAction popupAction = null) { if (needLevelupPopup) { needLevelupPopup = false; UISystemPopup.open(UISystemPopup.PopupType.LevelUp, GameDataManager.instance.level + "", popupAction, popupAction); } }
void onSelect(GameObject go) { P_Product p = GameManager.me.uiManager.popupShop.popupGift.selectedGiftItem; UISystemPopup.open(UISystemPopup.PopupType.YesNoPrice, Util.getUIText("CONFIRM_SENDGIFT", p.count.ToString(), epi.GAME_DATA.appFriendDic[data.userId].f_Nick), onConfirmToSendGift, null, p.price.ToString(), p.priceType); }
void onClickCompose(GameObject go) { if (btnClose.gameObject.activeSelf == false) { return; } if (popupType == RuneInfoPopup.Type.Reinforce && RuneStudioMain.instance.step != RuneStudioMain.Step.Finish) { Debug.Log("wait..."); return; } if (data.rare >= RareType.S) { UISystemPopup.open(UISystemPopup.PopupType.Default, Util.getUIText("COMPOSE_NOMORE")); return; } else if (data.reinforceLevel < GameIDData.MAX_LEVEL) { UISystemPopup.open(UISystemPopup.PopupType.Default, Util.getUIText("COMPOSE_LEVELLIMIT")); return; } else { int composeSourceNumber = 0; for (int i = 0; i < GameDataManager.instance.partsInventoryList.Count; ++i) { if (GameDataManager.instance.partsInventoryList[i].rare == data.rare && GameDataManager.instance.partsInventoryList[i].reinforceLevel == GameIDData.MAX_LEVEL) { ++composeSourceNumber; if (composeSourceNumber > 2) { break; } } } if (isFromInventorySlot) { --composeSourceNumber; } if (composeSourceNumber <= 0) { UISystemPopup.open(UISystemPopup.PopupType.Default, Util.getUIText("NO_COMPOSE_EQUIP", RareType.CHARACTER[data.rare])); return; } } hide(); GameManager.me.uiManager.uiMenu.uiHero.startComposeMode(GameIDData.getClone(data), isFromInventorySlot); }
public void onClickBreak(GameObject go) { if (btnClose.gameObject.activeSelf == false) { return; } UISystemPopup.open(UISystemPopup.PopupType.Sell, Util.getUIText("MSG_SELL_UNITRUNE", RareType.WORD[data.rare], data.unitData.name, data.getSellPrice().ToString()), onConfirmBreak, null, data.serverId); }
public static bool checkRubyPopup(int ruby) { if (GameDataManager.instance.ruby < ruby) { UISystemPopup.open(UISystemPopup.PopupType.GoToRubyShop); return(false); } return(true); }
void onBuyChloe() { if (GameDataManager.instance.ruby < GameDataManager.instance.heroPrices[Character.CHLOE]) { UISystemPopup.open(UISystemPopup.PopupType.GoToRubyShop); } else { EpiServer.instance.sendBuyHero(Character.CHLOE, GameIDData.Type.None); } }
public void onCompleteReceiveCouponUrl(string url) { if (string.IsNullOrEmpty(url) == false) { PandoraManager.instance.showWebView(url, onCloseCouponPage); } else { UISystemPopup.open(Util.getUIText("COUPON_URL_ERR")); } }
public void checkReplayResult(bool replayResultIsMyWinning) { if (GameManager.me.uiManager.uiPlay.btnReplayClose.gameObject.activeSelf == false && GameManager.me.isStartGame == false) { return; } if (isPVPReplayIsSurrenderGame) { if (replayResultIsMyWinning) { UISystemPopup.open(UISystemPopup.PopupType.Default, Util.getUIText("REPLAY_SURREND"), playReplayResultAsWin); } else { UISystemPopup.open(UISystemPopup.PopupType.Default, Util.getUIText("REPLAY_SURREND"), playReplayResultAsLose); } return; } if (needReplayResultCheck) { // 공격게임. if (isPVPReplayIsAttackGame) { // 공격자가 이기면 나도 이겨야함. if (isPVPReplayIsAttackerWinGame == true && replayResultIsMyWinning == false) { UISystemPopup.open(UISystemPopup.PopupType.Default, Util.getUIText("REPLAY_ERROR", Util.getUIText("WIN")), playReplayResultAsWin); } // 공격자가 지면 나도 져야함. else if (isPVPReplayIsAttackerWinGame == false && replayResultIsMyWinning == true) { UISystemPopup.open(UISystemPopup.PopupType.Default, Util.getUIText("REPLAY_ERROR", Util.getUIText("LOSE")), playReplayResultAsLose); } } else // 방어게임 { // 공격자가 이기면 나는 저야함. if (isPVPReplayIsAttackerWinGame == true && replayResultIsMyWinning == true) { UISystemPopup.open(UISystemPopup.PopupType.Default, Util.getUIText("REPLAY_ERROR", Util.getUIText("WIN")), playReplayResultAsLose); } // 공격자가 지면 나는 이겨야함. else if (isPVPReplayIsAttackerWinGame == false && replayResultIsMyWinning == false) { UISystemPopup.open(UISystemPopup.PopupType.Default, Util.getUIText("REPLAY_ERROR", Util.getUIText("LOSE")), playReplayResultAsWin); } } } GameManager.me.playReplayResult(replayResultIsMyWinning); }
void onBuyChloe() { if (GameDataManager.instance.ruby < GameDataManager.instance.heroPrices[Character.CHLOE]) { UISystemPopup.open(UISystemPopup.PopupType.GoToRubyShop); } else { _buyHero = Character.CHLOE; EpiServer.instance.sendBuyHero(_buyHero, tabType); } }
void checkAdvice() { UISystemPopup.open(UISystemPopup.PopupType.Advice, "", checkAdvice, checkAdvice, _tempIndex); if (_tempIndex == 0) { _tempIndex = 1; } else { _tempIndex = 0; } }
public void showGiftShop() { #if UNITY_IOS if (GameManager.me.isGuest && GameDataManager.instance.serviceMode != GameDataManager.ServiceMode.IOS_SUMMIT) { UISystemPopup.open("게스트 모드일 때는 루비구매를 하실 수 없습니다."); return; } #endif show(); onClickGift(null); }
void onClickChloe(GameObject go) { if (GameDataManager.instance.heroes.ContainsKey(Character.CHLOE)) { SoundData.play("uihe_changehero"); setCharacter(Character.CHLOE); //EpiServer.instance.sendChangeHero(Character.CHLOE, true) ; } else { UISystemPopup.open(UISystemPopup.PopupType.YesNoPrice, Util.getUIText("BUY_HERO", Util.getUIText("CHLOE")), onBuyChloe, null, GameDataManager.instance.heroPrices[Character.CHLOE].ToString()); } }
void onClickNotice(GameObject go) { if (PandoraManager.instance.localUser.messageBlock && cbPushNotice.value == true) { UISystemPopup.open(UISystemPopup.PopupType.Default, Util.getUIText("CHECK_MSG_ALLOW")); setMessageBlock(true); return; } Debug.LogError(cbPushNotice.value); GameDataManager.instance.messageBlock = (cbPushNotice.value?WSDefine.NO:WSDefine.YES); EpiServer.instance.sendSetSetting(); }
public void onStartRound(GameObject go) { if (GameManager.me.uiManager.uiLoading.gameObject.activeSelf) { return; } #if UNITY_EDITOR if (DebugManager.instance.useDebug) { GameManager.me.startGame(0.5f); } else #endif { if (selectSigongData.priceType == WSDefine.ENERGY) { if (GameDataManager.instance.energy < selectSigongData.price) { UISystemPopup.open(UISystemPopup.PopupType.YesNo, Util.getUIText("GO_TO_ENERGYSHOP"), GameManager.me.uiManager.popupShop.showEnergyShop); return; } } else if (selectSigongData.priceType == WSDefine.GOLD) { if (GameDataManager.instance.gold < selectSigongData.price) { UISystemPopup.open(UISystemPopup.PopupType.YesNo, Util.getUIText("GOTO_GOLD_SHOP"), GameManager.me.uiManager.popupShop.showGoldShop); return; } } else if (selectSigongData.priceType == WSDefine.RUBY) { if (GameDataManager.instance.ruby < selectSigongData.price) { UISystemPopup.open(UISystemPopup.PopupType.YesNo, Util.getUIText("GOTO_RUBY_SHOP"), GameManager.me.uiManager.popupShop.showRubyShop); return; } } if (selectSigongData.forcedDeck != null && selectSigongData.forcedDeck == "HERO_SELECT") { popupSelectHero.show(); } else { EpiServer.instance.sendPlaySigong(selectSigongData.id); } } }
public void onClickEvent(GameObject go) { if (GameManager.me.uiManager.popupSummonDetail.gameObject.activeSelf) { return; } if (string.IsNullOrEmpty(GameDataManager.instance.eventUrl)) { UISystemPopup.open("현재 준비된 이벤트가 없습니다."); } PandoraManager.instance.showWebView(GameDataManager.instance.eventUrl, onCloseEventPage); }
void onClickReplay(GameObject go) { #if UNITY_IPHONE UISystemPopup.open(UISystemPopup.PopupType.Default, Util.getUIText("REPLAY_TEMPPOPUP"), onClickReplay2); #else bool isAttackGame = true; if (GameManager.me.uiManager.popupChampionshipReplayPanel.tabKind == 1) { isAttackGame = false; } EpiServer.instance.sendGetReplay(isAttackGame, GameManager.me.uiManager.popupChampionshipReplayPanel.data.userId, "R" + index.ToString()); #endif }
void onClickDeleteData(GameObject go) { PlayerPrefs.DeleteAll(); string[] f**k = AssetBundleManager.instance.deleteTempData(); if (f**k != null && f**k.Length > 0) { UISystemPopup.open(UISystemPopup.PopupType.Default, string.Join(",", f**k) + " Delete!"); } else { UISystemPopup.open(UISystemPopup.PopupType.Default, "지울 파일이 없습니다."); } }
protected void onYes(GameObject go) { if (_openRubyShop) { UISystemPopup.open(UISystemPopup.PopupType.YesNo, Util.getUIText("GOTO_RUBY_SHOP"), goToRubyShop, null); } else { gameObject.SetActive(false); if (yesCallback != null) { yesCallback(); } } }
void onClickOk(GameObject go) { if (GameDataManager.instance.runeStone < GameDataManager.instance.evolvePrices["RSTONE"]) { UISystemPopup.open(UISystemPopup.PopupType.Default, Util.getUIText("LACK_RUNESTONE"), closeThis, closeThis); } else if (GameDataManager.instance.gold < GameDataManager.instance.evolvePrices["GOLD"]) { GameManager.me.uiManager.popupGoldForRuby.show(GameDataManager.instance.evolvePrices["GOLD"], onConfirmEvolution); } else { onConfirmEvolution(); } }