public bool OnReceiveDiceChangeDeckAck(ERandomwarsDiceErrorCode errorCode, int index, int[] arrayDiceId) { UI_Main.Get().obj_IndicatorPopup.SetActive(false); //RefreshDeck(); foreach (var deckInfo in listDeckInfo) { deckInfo.RefreshDiceIcon(true); } UI_Main.Get().panel_Dice.ui_MainStage.Set(); RefreshEquipedMarkObject(); return(true); }
public bool OnRecieveEmotionChange(ERandomwarsItemErrorCode errorCode, List <int> listItemId) { UI_Main.Get().obj_IndicatorPopup.SetActive(false); if (errorCode == ERandomwarsItemErrorCode.Success) { UserInfoManager.Get().GetUserInfo().emotionDeck = listItemId; RefreshEmotionDeck(); return(true); } return(false); }
public void Click_Upgrade() { if (UserInfoManager.Get().GetUserInfo().gold >= needGold) { NetworkManager.session.DiceTemplate.DiceUpgradeReq(NetworkManager.session.HttpClient, data.id, OnReceiveDiceUpgradeAck); UI_Main.Get().obj_IndicatorPopup.SetActive(true); } else { FindObjectOfType <UI_Popup_MoveShop>().Initialize(UI_BoxOpenPopup.COST_TYPE.GOLD); } }
public void Click_Deck(int deckSlotNum) { int active = UserInfoManager.Get().GetActiveDeckIndex(); var intDeck = UserInfoManager.Get().GetSelectDeck(active); if (_isSelectMode) { var isChanged = false; for (var i = 0; i < intDeck.Length; i++) { if (i == deckSlotNum) { continue; } if (intDeck[i] == _selectedDiceId) { var temp = intDeck[deckSlotNum]; intDeck[deckSlotNum] = _selectedDiceId; intDeck[i] = temp; isChanged = true; break; } } if (!isChanged) { intDeck[deckSlotNum] = _selectedDiceId; } NetworkManager.session.DiceTemplate.DiceChangeDeckReq(NetworkManager.session.HttpClient, active, intDeck, OnReceiveDiceChangeDeckAck); UI_Main.Get().obj_IndicatorPopup.SetActive(true); obj_Ciritical.SetActive(true); objSelectBlind.SetActive(false); _isSelectMode = false; Click_CancelSelectMode(); } else { Click_Dice_Info(intDeck[deckSlotNum]); } }
public void Click_EmotionDeck(int deckSlotNum) { if (_isSelectMode) { var isChanged = false; for (var i = 0; i < UserInfoManager.Get().GetUserInfo().emotionDeck.Count; i++) { if (i == deckSlotNum) { continue; } if (UserInfoManager.Get().GetUserInfo().emotionDeck[i] == _selectedEmotionId) { var temp = UserInfoManager.Get().GetUserInfo().emotionDeck[deckSlotNum]; UserInfoManager.Get().GetUserInfo().emotionDeck[deckSlotNum] = _selectedEmotionId; UserInfoManager.Get().GetUserInfo().emotionDeck[i] = temp; isChanged = true; break; } } if (!isChanged) { UserInfoManager.Get().GetUserInfo().emotionDeck[deckSlotNum] = _selectedEmotionId; } NetworkManager.session.ItemTemplate.EmotionEquipReq(NetworkManager.session.HttpClient, UserInfoManager.Get().GetUserInfo().emotionDeck, OnRecieveEmotionChange); UI_Main.Get().obj_IndicatorPopup.SetActive(true); objSelectBlind.SetActive(false); _isSelectMode = false; Click_CancelSelectMode(); } }
public bool OnReceiveDiceUpgradeAck(ERandomwarsDiceErrorCode errorCode, MsgDiceInfo diceInfo, QuestData[] arrayQuestData, int updateGold) { UI_Main.Get().obj_IndicatorPopup.SetActive(false); if (errorCode == ERandomwarsDiceErrorCode.Success) { var info = UserInfoManager.Get().GetUserInfo(); if (info.dicGettedDice.ContainsKey(data.id)) { info.gold -= needGold; diceLevel++; info.dicGettedDice[data.id][0]++; info.dicGettedDice[data.id][1] -= needDiceCount; obj_Result.SetActive(true); StartCoroutine(SetDiceLevelUpResultCoroutine()); } // Quest UI_Popup_Quest.QuestUpdate(arrayQuestData); } return(true); }
private IEnumerator SetDiceLevelUpResultCoroutine() { SoundManager.instance.Play(Global.E_SOUND.SFX_UI_DICE_LVUP_EFX); isDiceLevelUpCompleted = false; image_ResultDiceIcon.transform.localScale = Vector3.zero; text_ResultDiceName.transform.localScale = Vector3.zero; text_ResultDiceLevel.transform.localScale = Vector3.zero; //rts_ResultStatParent.localScale = Vector3.zero; // Data set image_ResultDiceIcon.sprite = FileHelper.GetIcon(data.iconName); text_ResultDiceName.text = LocalizationManager.GetLangDesc((int)LANG_ENUM.DICE_NAME + data.id); text_ResultDiceLevel.text = $"LEVEL {diceLevel - 1}"; text_ResultDiceLevel.color = Color.white; image_ResultBG.DOFade(0f, 0f); image_ResubtBGPattern.DOFade(0f, 0f); image_ResultBG.DOFade(1f, 0.2f); image_ResubtBGPattern.DOFade(0.007843f, 0.2f); for (int i = rts_ResultStatParent.childCount - 1; i >= 0; --i) { DestroyImmediate(rts_ResultStatParent.GetChild(i).gameObject); } yield return(new WaitForSeconds(0.2f)); image_Character.rectTransform.DOScale(1.2f, 0.1f).SetEase(Ease.OutBack).OnComplete(() => { image_Character.rectTransform.DOScale(1f, 0.1f); }); image_ResultDiceIcon.rectTransform.DOScale(1.4f, 0.2f).SetEase(Ease.OutBack).SetDelay(0.2f); text_ResultDiceName.rectTransform.DOScale(1f, 0.2f).SetEase(Ease.OutBack).SetDelay(0.3f); text_ResultDiceLevel.rectTransform.DOScale(1f, 0.2f).SetEase(Ease.OutBack).SetDelay(0.4f); //rts_ResultStatParent.DOScale(1f, 0.2f).SetEase(Ease.OutBack).SetDelay(0.8f); var arrAdd = new float[3] { data.maxHpUpgrade, data.powerUpgrade, data.effectUpgrade }; for (int i = 0; i < 3; i++) { float current = 0f; if (arrAdd[i] == 0) { continue; } var obj = Instantiate(pref_ResultStatSlot, rts_ResultStatParent); var ui = obj.GetComponent <UI_DiceLevelUpResultSlot>(); switch (i) { case 0: current = data.maxHealth + data.maxHpUpgrade * diceLevel; ui.Initialize(Global.E_DICEINFOSLOT.Info_Hp, current, arrAdd[i], 1.2f + 0.1f * i); break; case 1: current = data.power + data.powerUpgrade * diceLevel; ui.Initialize(Global.E_DICEINFOSLOT.Info_AtkPower, current, arrAdd[i], 1.2f + 0.1f * i); break; case 2: current = data.effect + data.effectUpgrade + diceLevel; ui.Initialize(Global.E_DICEINFOSLOT.Info_Skill, current, arrAdd[i], 1.2f + 0.1f * i); break; } obj.transform.localScale = Vector3.zero; obj.transform.DOScale(1f, 0.2f).SetEase(Ease.OutBack).SetDelay(0.5f + 0.1f * i); } image_ResultDiceIcon.transform.DOScale(1.6f, 0.15f).SetDelay(1.7f).OnComplete(() => { text_ResultDiceLevel.text = $"CLASS {diceLevel}"; text_ResultDiceLevel.color = UnityUtil.HexToColor("71FA4A"); image_ResultDiceIcon.transform.DOScale(1.4f, 0.15f); ps_ResultIconBackground.Play(); SoundManager.instance.Play(Global.E_SOUND.SFX_UI_LVUP_RESULT); }); text_ResultDiceLevel.transform.DOScale(1.2f, 0.15f).SetDelay(1.7f).OnComplete(() => { text_ResultDiceLevel.transform.DOScale(1f, 0.15f); }); yield return(new WaitForSeconds(1f)); UI_Main.Get().panel_Dice.RefreshGettedDice(); UI_Main.Get().RefreshUserInfoUI(); Initialize(); yield return(new WaitForSeconds(1f)); isDiceLevelUpCompleted = true; }