You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
2477 lines
87 KiB
2477 lines
87 KiB
using DG.Tweening;
|
|
using DG.Tweening.Core;
|
|
using DG.Tweening.Plugins.Options;
|
|
using IVDataFormat;
|
|
using Spine.Unity;
|
|
using System.Collections.Generic;
|
|
using System.Collections;
|
|
using System.Numerics;
|
|
using TMPro;
|
|
using UnityEngine;
|
|
using UnityEngine.AddressableAssets;
|
|
using UnityEngine.ResourceManagement.AsyncOperations;
|
|
using UnityEngine.UI;
|
|
using Vector2 = UnityEngine.Vector2;
|
|
using Vector3 = UnityEngine.Vector3;
|
|
|
|
public class GameUIMgr : MonoBehaviour
|
|
{
|
|
[SerializeField] Camera UICamera;
|
|
|
|
#region Const
|
|
private static GameUIMgr curMgr = null;
|
|
#endregion Const
|
|
|
|
#region Main UI
|
|
[Header("Main UI")]
|
|
[SerializeField]
|
|
private Canvas canvasRight;
|
|
[SerializeField]
|
|
private Canvas canvasLeft;
|
|
|
|
[SerializeField]
|
|
private TextMeshProUGUI txtMainName;
|
|
[SerializeField]
|
|
private TextMeshProUGUI txtMainTitle;
|
|
[SerializeField]
|
|
private TextMeshProUGUI txtMainLv;
|
|
[SerializeField]
|
|
private TextMeshProUGUI txtMainBgmT;
|
|
[SerializeField]
|
|
private TextMeshProUGUI txtMainGold;
|
|
[SerializeField]
|
|
private TextMeshProUGUI txtMainDia;
|
|
[SerializeField]
|
|
private Image imgMainIcon;
|
|
|
|
[SerializeField]
|
|
private CanvasGroup cvBgmName;
|
|
private TextMeshProUGUI txtBgmName;
|
|
[SerializeField]
|
|
private Button btnZoom;
|
|
private RectTransform[] trfZooms;
|
|
private RectTransform trfZoomSelect;
|
|
|
|
[SerializeField]
|
|
private Canvas canvasFullBlack;
|
|
private Image imgFullBlack;
|
|
#endregion Main UI
|
|
|
|
#region Main Wrapper
|
|
private GameObject mainLeftTopSet;
|
|
|
|
private GameObject mainGroupPvp;
|
|
private GameObject mainRightTopSet;
|
|
private GameObject stageInfo;
|
|
private GameObject btnRetry;
|
|
private GameObject btnMenu;
|
|
private GameObject btnShop;
|
|
private GameObject btnPass;
|
|
private GameObject btnEvent;
|
|
private GameObject imgMenuPanel;
|
|
private TextMeshProUGUI txtEventButton;
|
|
private GameObject btnOpenOpenRewardEvent;
|
|
private TextMeshProUGUI txtRewardEvent;
|
|
|
|
private GameObject mainLeftBottomSet;
|
|
private GameObject hotTimePanel;
|
|
private GameObject hotTimeActive;
|
|
private TextMeshProUGUI txtTimer;
|
|
|
|
private GameObject mainRightBottomSet;
|
|
|
|
private GameObject mainBottomSet;
|
|
private Button dungeonButton;
|
|
|
|
[SerializeField]
|
|
private Canvas canvasMenu;
|
|
Image imgPvp;
|
|
GameObject imgPvpLock;
|
|
#endregion
|
|
|
|
private float fBackTick = 1f;
|
|
private int iPopup = 0;
|
|
private bool bChangingBgm = false;
|
|
private TweenerCore<float, float, FloatOptions> twcBgmName = null;
|
|
|
|
#region RightBottom
|
|
GameObject[] skillPreset = new GameObject[6];
|
|
#endregion
|
|
|
|
#region Up Goods
|
|
[SerializeField]
|
|
private Canvas canvasUpUI;
|
|
private GameObject groupUpGood;
|
|
|
|
private GameObject goUpMail;
|
|
private GameObject goUpGold;
|
|
private GameObject goUpLvPoint;
|
|
private GameObject goUpReinStone;
|
|
private GameObject goUpSkillStone;
|
|
private GameObject goUpAwakenStone;
|
|
private GameObject goUpAwakenSkillStone;
|
|
private GameObject goUpGachaToken;
|
|
private GameObject goUpDia;
|
|
private GameObject goUpMileage;
|
|
private GameObject goUpPvpTicket;
|
|
|
|
private TextMeshProUGUI txtUpGold;
|
|
private TextMeshProUGUI txtUpLvPoint;
|
|
private TextMeshProUGUI txtUpReinStone;
|
|
private TextMeshProUGUI txtUpSkillStone;
|
|
private TextMeshProUGUI txtUpAwakenStone;
|
|
private TextMeshProUGUI txtUpAwakenSkillStone;
|
|
private TextMeshProUGUI txtUpGachaToken;
|
|
private TextMeshProUGUI txtUpDia;
|
|
private TextMeshProUGUI txtUpMileage;
|
|
private TextMeshProUGUI txtUpPvpTicket;
|
|
|
|
private Image imgUpGachaTicket;
|
|
#endregion Up Goods
|
|
|
|
#region Left Goods
|
|
[Header("Left Goods")]
|
|
private GameObject groupLeftGood;
|
|
|
|
struct LeftGoodsInfo
|
|
{
|
|
public GameObject go;
|
|
public TextMeshProUGUI txt;
|
|
}
|
|
|
|
private LeftGoodsInfo leftGold;
|
|
private LeftGoodsInfo leftLvPoint;
|
|
private LeftGoodsInfo leftReinStone;
|
|
private LeftGoodsInfo leftSkillStone;
|
|
private LeftGoodsInfo leftAwakenStone;
|
|
private LeftGoodsInfo leftAwakenSkillStone;
|
|
private LeftGoodsInfo leftChangeStone;
|
|
private LeftGoodsInfo leftPudding;
|
|
private LeftGoodsInfo leftDia;
|
|
private LeftGoodsInfo leftDeepCaveDgTicket;
|
|
private LeftGoodsInfo leftAtlantisDgTicket;
|
|
private LeftGoodsInfo leftProtectTheMerchantDgTicket;
|
|
private LeftGoodsInfo leftDevelopTheJungleDgTicket;
|
|
private LeftGoodsInfo leftHuntEagleDgKey;
|
|
private LeftGoodsInfo leftMaskEnhance;
|
|
private LeftGoodsInfo leftFantasyWorldRing;
|
|
private LeftGoodsInfo leftMemoryPiece;
|
|
#endregion
|
|
|
|
#region Popup
|
|
[Header("Popup")]
|
|
[SerializeField]
|
|
private Canvas canvasPopup;
|
|
private IVPp1Button checkNet;
|
|
private IVPp1Button[] pp1Buttons;
|
|
private IVPp2Button[] pp2Buttons;
|
|
private IVPpGoods ppGoods;
|
|
private ParticleSystem ppGoodsEffect;
|
|
private ParticleSystem ppGoodsEffectLineS;
|
|
private ParticleSystem ppGoodsEffectLineM;
|
|
private ParticleSystem ppGoodsEffectLineL;
|
|
private IVPpPreset ppPreset;
|
|
private IVPpItemUse ppItemUse;
|
|
private IVPpItemUseTo ppItemUseTo;
|
|
private IVPpItemsUseTo ppItemsUseTo;
|
|
private IVPpItemBuy ppItemBuy;
|
|
private IVPpItemBuyCount ppItemBuyCount;
|
|
private IVPpRarityCheck ppRarityCheck;
|
|
private IVPpHelp ppHelp;
|
|
private IVPpToast toastTop;
|
|
private IVPpToast toastMiddle;
|
|
private IVPpToast toastBottom;
|
|
private IVPpNoticeToast toastNotice;
|
|
|
|
// 희귀도별 효과 팝업.
|
|
[SerializeField]
|
|
private GameObject goPopupRate;
|
|
[SerializeField]
|
|
private GameObject prfRarityRate;
|
|
private TextMeshProUGUI[] txtRarityTitles, txtRarityRates;
|
|
private bool bReLocalizeRarity;
|
|
|
|
// 전체 보유효과 팝업.
|
|
[SerializeField]
|
|
private GameObject goPopupHaveEfc;
|
|
[SerializeField]
|
|
private GameObject prfHaveEfc;
|
|
private TextMeshProUGUI txtHaveEfcT;
|
|
private TextMeshProUGUI[] txtHaveEfcTitles, txtHaveEfcValues;
|
|
|
|
// 게임 종료 팝업.
|
|
[SerializeField]
|
|
private IVPp2Button popupExit;
|
|
private bool bInitNeedExit = true;
|
|
// 오프라인 팝업.
|
|
[SerializeField]
|
|
private GameObject goPopupOffline;
|
|
private AsyncOperationHandle<SkeletonDataAsset> handleSkAnim;
|
|
#endregion Popup
|
|
|
|
#region Effect
|
|
private SkeletonAnimation skClrCompose;
|
|
private ParticleSystem ptcLeftEnhance;
|
|
#endregion Effect
|
|
|
|
#region Temp
|
|
[Header("Temp")]
|
|
[SerializeField]
|
|
private TextMeshProUGUI txtMainMenu;
|
|
[SerializeField]
|
|
private TextMeshProUGUI txtMainTShop;
|
|
#endregion Temp
|
|
|
|
#region Base
|
|
public static void SLocalize(bool bmain)
|
|
{
|
|
if (curMgr != null)
|
|
curMgr.Localize(bmain);
|
|
}
|
|
|
|
private void Localize(bool bmain)
|
|
{
|
|
if (bmain)
|
|
{
|
|
txtMainBgmT.text = LocalizationText.GetText("bgm_title");
|
|
txtMainTShop.text = LocalizationText.GetText("shop_title");
|
|
txtMainMenu.text = LocalizationText.GetText("menu_title");
|
|
txtRewardEvent.text = LocalizationText.GetText("event_open");
|
|
}
|
|
else
|
|
{
|
|
txtEventButton.text = LocalizationText.GetText("event_title");
|
|
|
|
ppPreset.Localize();
|
|
}
|
|
}
|
|
|
|
// 설정에서 언어 변경 시 처리.
|
|
public static void SReLocalize()
|
|
{
|
|
curMgr.Localize(true);
|
|
curMgr.Localize(false);
|
|
curMgr.bReLocalizeRarity = true;
|
|
}
|
|
|
|
private void Awake()
|
|
{
|
|
curMgr = this;
|
|
|
|
TouchViewer.Instance.UICamera = UICamera;
|
|
VirtualPad.setCamera(UICamera);
|
|
}
|
|
|
|
private void Start()
|
|
{
|
|
imgFullBlack = canvasFullBlack.transform.GetChild(0).GetComponent<Image>();
|
|
txtBgmName = cvBgmName.transform.Find("txtBgmName").GetComponent<TextMeshProUGUI>();
|
|
|
|
mainGroupPvp = canvasRight.transform.Find("groupPvp").gameObject;
|
|
mainRightTopSet = canvasRight.transform.Find("RT").gameObject;
|
|
mainRightBottomSet = canvasRight.transform.Find("RB").gameObject;
|
|
mainLeftTopSet = canvasLeft.transform.Find("LT").gameObject;
|
|
mainLeftBottomSet = canvasLeft.transform.Find("LB").gameObject;
|
|
mainBottomSet = canvasLeft.transform.Find("B").gameObject;
|
|
|
|
stageInfo = mainRightTopSet.transform.Find("stageinfo").gameObject;
|
|
btnRetry = stageInfo.transform.Find("btnRetry").gameObject;
|
|
btnMenu = mainRightTopSet.transform.Find("btnMenu").gameObject;
|
|
btnShop = mainRightTopSet.transform.Find("btnShop").gameObject;
|
|
btnPass = mainRightTopSet.transform.Find("btnPass").gameObject;
|
|
btnEvent = mainRightTopSet.transform.Find("btnEvent").gameObject;
|
|
imgMenuPanel = mainRightTopSet.transform.Find("TopPanel").gameObject;
|
|
txtEventButton = btnEvent.transform.Find("txt").GetComponent<TextMeshProUGUI>();
|
|
txtEventButton.text = LocalizationText.GetText("event_title");
|
|
dungeonButton = mainLeftBottomSet.transform.Find("BtnDungeon").GetComponent<Button>();
|
|
btnOpenOpenRewardEvent = canvasRight.transform.Find("btnOpenRewardEvent").gameObject;
|
|
txtRewardEvent = btnOpenOpenRewardEvent.transform.Find("txt").GetComponent<TextMeshProUGUI>();
|
|
|
|
#if false //TODO: block open event open button
|
|
if (DataHandler.GetPlayRewardEvent().sid >= 1)
|
|
{
|
|
btnOpenOpenRewardEvent.gameObject.SetActive(false);
|
|
}
|
|
#else
|
|
btnOpenOpenRewardEvent.gameObject.SetActive(false);
|
|
#endif
|
|
trfZooms = new RectTransform[3];
|
|
for(int i = 0; i<3; i++)
|
|
{
|
|
trfZooms[i] = new RectTransform();
|
|
trfZooms[i] = btnZoom.transform.GetChild(i).GetComponent<RectTransform>();
|
|
}
|
|
trfZoomSelect = btnZoom.transform.Find("ZoomSelect").GetComponent<RectTransform>();
|
|
trfZoomSelect.position = trfZooms[IVCameraController.SGetZoom()].position;
|
|
|
|
imgPvp = canvasMenu.transform.Find("OptionPanel").transform.Find("btnPvp").GetComponent<Image>();
|
|
imgPvpLock = imgPvp.transform.Find("lock").gameObject;
|
|
|
|
#region Up Goods
|
|
Transform trfupgood = canvasUpUI.transform.Find("RT").Find("upGoods");
|
|
groupUpGood = trfupgood.gameObject;
|
|
|
|
goUpMail = trfupgood.Find("btnMail").gameObject;
|
|
goUpGold = trfupgood.Find("goodsgold").gameObject;
|
|
goUpLvPoint = trfupgood.Find("goodslvpoint").gameObject;
|
|
goUpReinStone = trfupgood.Find("goodsrein").gameObject;
|
|
goUpSkillStone = trfupgood.Find("goodsskill").gameObject;
|
|
goUpAwakenStone = trfupgood.Find("goodsawaken").gameObject;
|
|
goUpAwakenSkillStone = trfupgood.Find("goodsawakenskill").gameObject;
|
|
goUpGachaToken = trfupgood.Find("goodsgacha").gameObject;
|
|
goUpDia = trfupgood.Find("goodsdia").gameObject;
|
|
goUpMileage = trfupgood.Find("goodsmileage").gameObject;
|
|
goUpPvpTicket = trfupgood.Find("goodspvp").gameObject;
|
|
|
|
txtUpGold = goUpGold.transform.Find("txtGoods").GetComponent<TextMeshProUGUI>();
|
|
txtUpLvPoint = goUpLvPoint.transform.Find("txtGoods").GetComponent<TextMeshProUGUI>();
|
|
txtUpReinStone = goUpReinStone.transform.Find("txtGoods").GetComponent<TextMeshProUGUI>();
|
|
txtUpSkillStone = goUpSkillStone.transform.Find("txtGoods").GetComponent<TextMeshProUGUI>();
|
|
txtUpAwakenStone = goUpAwakenStone.transform.Find("txtGoods").GetComponent<TextMeshProUGUI>();
|
|
txtUpAwakenSkillStone = goUpAwakenSkillStone.transform.Find("txtGoods").GetComponent<TextMeshProUGUI>();
|
|
txtUpGachaToken = goUpGachaToken.transform.Find("txtGoods").GetComponent<TextMeshProUGUI>();
|
|
txtUpDia = goUpDia.transform.Find("txtGoods").GetComponent<TextMeshProUGUI>();
|
|
txtUpMileage = goUpMileage.transform.Find("txtGoods").GetComponent<TextMeshProUGUI>();
|
|
txtUpPvpTicket = goUpPvpTicket.transform.Find("txtGoods").GetComponent<TextMeshProUGUI>();
|
|
|
|
imgUpGachaTicket = goUpGachaToken.transform.Find("icon").GetComponent<Image>();
|
|
#endregion Up Goods
|
|
|
|
#region Left Goods
|
|
Transform trfleftgood = canvasUpUI.transform.Find("RT").Find("leftGoods");
|
|
groupLeftGood = trfleftgood.gameObject;
|
|
|
|
leftGold.go = trfleftgood.Find("goodsgold").gameObject;
|
|
leftGold.txt = leftGold.go.transform.Find("txtGoods").GetComponent<TextMeshProUGUI>();
|
|
|
|
leftLvPoint.go = trfleftgood.Find("goodslvpoint").gameObject;
|
|
leftLvPoint.txt = leftLvPoint.go.transform.Find("txtGoods").GetComponent<TextMeshProUGUI>();
|
|
|
|
leftReinStone.go = trfleftgood.Find("goodsrein").gameObject;
|
|
leftReinStone.txt = leftReinStone.go.transform.Find("txtGoods").GetComponent<TextMeshProUGUI>();
|
|
|
|
leftSkillStone.go = trfleftgood.Find("goodsskill").gameObject;
|
|
leftSkillStone.txt = leftSkillStone.go.transform.Find("txtGoods").GetComponent<TextMeshProUGUI>();
|
|
|
|
leftAwakenStone.go = trfleftgood.Find("goodsawaken").gameObject;
|
|
leftAwakenStone.txt = leftAwakenStone.go.transform.Find("txtGoods").GetComponent<TextMeshProUGUI>();
|
|
|
|
leftAwakenSkillStone.go = trfleftgood.Find("goodsawakenskill").gameObject;
|
|
leftAwakenSkillStone.txt = leftAwakenSkillStone.go.transform.Find("txtGoods").GetComponent<TextMeshProUGUI>();
|
|
|
|
leftChangeStone.go = trfleftgood.Find("goodschange").gameObject;
|
|
leftChangeStone.txt = leftChangeStone.go.transform.Find("txtGoods").GetComponent<TextMeshProUGUI>();
|
|
|
|
leftPudding.go = trfleftgood.Find("goodspudding").gameObject;
|
|
leftPudding.txt = leftPudding.go.transform.Find("txtGoods").GetComponent<TextMeshProUGUI>();
|
|
|
|
leftDia.go = trfleftgood.Find("goodsdia").gameObject;
|
|
leftDia.txt = leftDia.go.transform.Find("txtGoods").GetComponent<TextMeshProUGUI>();
|
|
|
|
leftDeepCaveDgTicket.go = trfleftgood.Find("goodsredticket").gameObject;
|
|
leftDeepCaveDgTicket.txt = leftDeepCaveDgTicket.go.transform.Find("txtGoods").GetComponent<TextMeshProUGUI>();
|
|
|
|
leftAtlantisDgTicket.go = trfleftgood.Find("goodsblueticket").gameObject;
|
|
leftAtlantisDgTicket.txt = leftAtlantisDgTicket.go.transform.Find("txtGoods").GetComponent<TextMeshProUGUI>();
|
|
|
|
leftProtectTheMerchantDgTicket.go = trfleftgood.Find("goodspurpleticket").gameObject;
|
|
leftProtectTheMerchantDgTicket.txt = leftProtectTheMerchantDgTicket.go.transform.Find("txtGoods").GetComponent<TextMeshProUGUI>();
|
|
|
|
leftDevelopTheJungleDgTicket.go = trfleftgood.Find("goodsskyblueticket").gameObject;
|
|
leftDevelopTheJungleDgTicket.txt = leftDevelopTheJungleDgTicket.go.transform.Find("txtGoods").GetComponent<TextMeshProUGUI>();
|
|
|
|
leftHuntEagleDgKey.go = trfleftgood.Find("goodsgoldkey").gameObject;
|
|
leftHuntEagleDgKey.txt = leftHuntEagleDgKey.go.transform.Find("txtGoods").GetComponent<TextMeshProUGUI>();
|
|
|
|
leftMaskEnhance.go = trfleftgood.Find("goodsmaskenhance").gameObject;
|
|
leftMaskEnhance.txt = leftMaskEnhance.go.transform.Find("txtGoods").GetComponent<TextMeshProUGUI>();
|
|
|
|
leftFantasyWorldRing.go = trfleftgood.Find("goodsFantasyWorldRing").gameObject;
|
|
leftFantasyWorldRing.txt = leftFantasyWorldRing.go.transform.Find("txtGoods").GetComponent<TextMeshProUGUI>();
|
|
|
|
leftMemoryPiece.go = trfleftgood.Find("goodsMemoryPiece").gameObject;
|
|
leftMemoryPiece.txt = leftMemoryPiece.go.transform.Find("txtGoods").GetComponent<TextMeshProUGUI>();
|
|
#endregion Left Goods
|
|
|
|
#region General Popup
|
|
Transform trfpopup = canvasPopup.transform;
|
|
pp1Buttons = trfpopup.Find("popup1Buttons").GetComponentsInChildren<IVPp1Button>(true);
|
|
pp2Buttons = trfpopup.Find("popup2Buttons").GetComponentsInChildren<IVPp2Button>(true);
|
|
checkNet = trfpopup.Find("CheckNetwork").GetChild(0).GetComponent<IVPp1Button>();
|
|
|
|
ppGoods = trfpopup.Find("popupGoods").GetComponent<IVPpGoods>();
|
|
ppPreset = trfpopup.Find("popupPreset").GetComponent<IVPpPreset>();
|
|
ppItemUse = trfpopup.Find("popupItemUse").GetComponent<IVPpItemUse>();
|
|
ppItemUseTo = trfpopup.Find("popupItemUseTo").GetComponent<IVPpItemUseTo>();
|
|
ppItemsUseTo = trfpopup.Find("popupItemsUseTo").GetComponent<IVPpItemsUseTo>();
|
|
ppItemBuy = trfpopup.Find("popupItemBuy").GetComponent<IVPpItemBuy>();
|
|
ppItemBuyCount = trfpopup.Find("popupItemBuyCount").GetComponent<IVPpItemBuyCount>();
|
|
ppRarityCheck = trfpopup.Find("popupRarityCheck").GetComponent<IVPpRarityCheck>();
|
|
ppHelp = trfpopup.Find("popupHelp").GetComponent<IVPpHelp>();
|
|
|
|
toastTop = trfpopup.Find("toastTop").GetComponent<IVPpToast>();
|
|
toastMiddle = trfpopup.Find("toastMiddle").GetComponent<IVPpToast>();
|
|
toastBottom = trfpopup.Find("toastBottom").GetComponent<IVPpToast>();
|
|
toastNotice = trfpopup.Find("toastServerCheck").GetComponent<IVPpNoticeToast>();
|
|
|
|
for (int i = 0; i < pp1Buttons.Length; i++)
|
|
pp1Buttons[i].Init();
|
|
for (int i = 0; i < pp2Buttons.Length; i++)
|
|
pp2Buttons[i].Init();
|
|
checkNet.Init();
|
|
|
|
ppGoods.Init();
|
|
ppPreset.Init();
|
|
ppItemUse.Init();
|
|
ppItemUseTo.Init();
|
|
ppItemsUseTo.Init();
|
|
ppItemBuy.Init();
|
|
ppItemBuyCount.Init();
|
|
ppRarityCheck.Init();
|
|
ppHelp.Init();
|
|
|
|
toastTop.Init();
|
|
toastMiddle.Init();
|
|
toastBottom.Init();
|
|
toastNotice.Init();
|
|
#endregion General Popup
|
|
|
|
#region General Effect
|
|
skClrCompose = trfpopup.Find("skClrCompose").GetComponent<SkeletonAnimation>();
|
|
ptcLeftEnhance = trfpopup.transform.Find("leftGoodsEnhance").GetComponent<ParticleSystem>();
|
|
#endregion General Effect
|
|
|
|
hotTimePanel = mainLeftTopSet.transform.Find("HotTime").gameObject;
|
|
hotTimeActive = hotTimePanel.transform.Find("HotTimeActive").gameObject;
|
|
txtTimer = hotTimePanel.transform.Find("txtTimer").GetComponent<TextMeshProUGUI>();
|
|
EventMgr.HotTimeTimerSet();
|
|
|
|
ppGoodsEffect = ppGoods.transform.Find("RewardPopupEffcet").GetComponent<ParticleSystem>();
|
|
ppGoodsEffectLineS = ppGoods.transform.Find("RewardPopupEffect_line_s").GetComponent<ParticleSystem>();
|
|
ppGoodsEffectLineM = ppGoods.transform.Find("RewardPopupEffect_line_m").GetComponent<ParticleSystem>();
|
|
ppGoodsEffectLineL = ppGoods.transform.Find("RewardPopupEffect_line_l").GetComponent<ParticleSystem>();
|
|
|
|
skillPreset[0] = mainRightBottomSet.transform.Find("tabSkill").transform.Find("tabSkillDisable").gameObject;
|
|
skillPreset[1] = mainRightBottomSet.transform.Find("tabSkill (1)").transform.Find("tabSkillDisable").gameObject;
|
|
skillPreset[2] = mainRightBottomSet.transform.Find("tabSkill (2)").transform.Find("tabSkillDisable").gameObject;
|
|
skillPreset[3] = mainRightBottomSet.transform.Find("tabSkill (3)").transform.Find("tabSkillDisable").gameObject;
|
|
skillPreset[4] = mainRightBottomSet.transform.Find("tabSkill (4)").transform.Find("tabSkillDisable").gameObject;
|
|
skillPreset[5] = mainRightBottomSet.transform.Find("tabSkill (5)").transform.Find("tabSkillDisable").gameObject;
|
|
|
|
Localize(false);
|
|
SSetGoods();
|
|
}
|
|
|
|
private void Update()
|
|
{
|
|
if (fBackTick > 0f)
|
|
{
|
|
fBackTick -= Time.unscaledDeltaTime;
|
|
return;
|
|
}
|
|
|
|
// 백버튼 처리. 제일 상위 UI/조건부터 차례대로 확인.
|
|
if (Input.GetKeyDown(KeyCode.Escape))
|
|
{
|
|
if (CoverCamera.IsOn())
|
|
return;
|
|
if (canvasFullBlack.enabled)
|
|
return;
|
|
fBackTick = 0.15f;
|
|
|
|
// 절전모드.
|
|
if (SleepModeMgr.SCloseMenu())
|
|
return;
|
|
|
|
#region Popup
|
|
// 1버튼 팝업.
|
|
for (int i = pp1Buttons.Length - 1; i >= 0; i--)
|
|
{
|
|
if (pp1Buttons[i].IsOpen())
|
|
{
|
|
pp1Buttons[i].BtnYesPressed();
|
|
return;
|
|
}
|
|
}
|
|
|
|
// 2버튼 팝업.
|
|
for (int i = pp2Buttons.Length - 1; i >= 0; i--)
|
|
{
|
|
if (pp2Buttons[i].IsOpen())
|
|
{
|
|
pp2Buttons[i].BtnNoPressed();
|
|
return;
|
|
}
|
|
}
|
|
|
|
// 재화 획득 팝업.
|
|
if (ppGoods.IsOpen())
|
|
{
|
|
ppGoods.BtnYesPressed();
|
|
return;
|
|
}
|
|
|
|
// 프리셋 팝업.
|
|
if (ppPreset.IsOpen())
|
|
{
|
|
ppPreset.BtnNoPressed();
|
|
return;
|
|
}
|
|
|
|
// 아이템 사용 팝업.
|
|
if (ppItemUse.IsOpen())
|
|
{
|
|
ppItemUse.BtnNoPressed();
|
|
return;
|
|
}
|
|
|
|
// 아이템 사용-획득 팝업.
|
|
if (ppItemUseTo.IsOpen())
|
|
{
|
|
ppItemUseTo.BtnNoPressed();
|
|
return;
|
|
}
|
|
|
|
// 아이템들 사용 팝업.
|
|
if (ppItemsUseTo.IsOpen())
|
|
{
|
|
ppItemsUseTo.BtnNoPressed();
|
|
return;
|
|
}
|
|
|
|
// 아이템 구매 팝업.
|
|
if (ppItemBuy.IsOpen())
|
|
{
|
|
ppItemBuy.BtnNoPressed();
|
|
return;
|
|
}
|
|
|
|
// 아이템 수량 구매 팝업.
|
|
if (ppItemBuyCount.IsOpen())
|
|
{
|
|
ppItemBuyCount.BtnNoPressed();
|
|
return;
|
|
}
|
|
|
|
// 희귀도 선택 팝업.
|
|
if (ppRarityCheck.IsOpen())
|
|
{
|
|
ppRarityCheck.BtnNoPressed();
|
|
return;
|
|
}
|
|
|
|
// 희귀도별 확률 팝업.
|
|
if (goPopupRate.activeSelf)
|
|
{
|
|
ClosePopupRarityRate();
|
|
return;
|
|
}
|
|
|
|
// 전체 보유 효과 팝업.
|
|
if (goPopupHaveEfc.activeSelf)
|
|
{
|
|
ClosePopupHaveEfc();
|
|
return;
|
|
}
|
|
|
|
// 오프라인 팝업.
|
|
if (goPopupOffline.activeSelf)
|
|
{
|
|
ClosePopupOffline();
|
|
return;
|
|
}
|
|
|
|
// 게임 종료 팝업.
|
|
if (popupExit.IsOpen())
|
|
{
|
|
popupExit.BtnNoPressed();
|
|
return;
|
|
}
|
|
#endregion Popup
|
|
|
|
#region 중앙 팝업 컨텐츠
|
|
// 우편.
|
|
if (MailMgr.SCloseMenu())
|
|
return;
|
|
// 이벤트 & 공지.
|
|
if (NoticeMgr.SCloseMenu())
|
|
return;
|
|
//출석
|
|
if (AttendMgr.SCloseMenu())
|
|
return;
|
|
//재화 정보
|
|
if (GoodsInfo.SCloseMenu())
|
|
return;
|
|
#endregion 중앙 팝업 컨텐츠
|
|
|
|
#region 전체 화면 컨텐츠
|
|
// 결투장.
|
|
if (PvpMgr.SCloseMenu())
|
|
return;
|
|
// 패스.
|
|
if (PassMgr.SCloseMenu())
|
|
return;
|
|
// 상점.
|
|
if (ShopMgr.SCloseMenu())
|
|
return;
|
|
// 코스튬.
|
|
if (CustomizeMgr.SCloseMenu())
|
|
return;
|
|
// 소환.
|
|
if (GachaMgr.SCloseMenu())
|
|
return;
|
|
#endregion 전체 화면 컨텐츠
|
|
|
|
// 스테이지 실패 팝업.
|
|
if (BattleMgr.SCloseMenu())
|
|
return;
|
|
|
|
#region 좌우 분할 컨텐츠
|
|
// 강화
|
|
if (EnhanceMgr.SCloseMenu())
|
|
return;
|
|
// 펫.
|
|
if (PetMgr.SCloseMenu())
|
|
return;
|
|
// 스킬.
|
|
if (SkillMgr.SCloseMenu())
|
|
return;
|
|
// 가방.
|
|
if (BagMgr.SCloseMenu())
|
|
return;
|
|
|
|
// 스테이지.
|
|
if (StageMgr.SCloseMenu())
|
|
return;
|
|
//던전
|
|
if (DungeonMgr.SCloseMenu())
|
|
return;
|
|
// 채팅.
|
|
if (ChatMgr.SCloseMenu())
|
|
return;
|
|
// 프로필
|
|
if (ProfileMgr.SCloseProfile())
|
|
return;
|
|
//이벤트
|
|
if (EventMgr.SCloseMenu())
|
|
return;
|
|
// 설정.
|
|
if (SettingMgr.SCloseMenu())
|
|
return;
|
|
// 퀘스트.
|
|
if (QuestMgr.SCloseMenu())
|
|
return;
|
|
#endregion 좌우 분할 컨텐츠
|
|
|
|
if (canvasMenu.enabled)
|
|
{
|
|
CloseMenu();
|
|
return;
|
|
}
|
|
|
|
// 전투 종류에 따른 처리. 던전의 경우 던전 나가기 확인 팝업 표시 필요.
|
|
if (BattleMgr.Instance.CurrentBattleType != BattleMgr.BattleType.Stage)
|
|
{
|
|
return;
|
|
}
|
|
|
|
OpenPopupExit();
|
|
}
|
|
}
|
|
|
|
public static void SOpenMenu()
|
|
{
|
|
curMgr.OpenMenu();
|
|
}
|
|
|
|
public void OpenMenu()
|
|
{
|
|
if (imgMenuPanel.activeSelf)
|
|
{
|
|
imgMenuPanel.SetActive(false);
|
|
canvasMenu.enabled = true;
|
|
|
|
if (DataHandler.IsClearStage(DataHandler.Const.pvpOpenStage))
|
|
{
|
|
imgPvp.color = new Color(1f, 1f, 1f);
|
|
}
|
|
else
|
|
{
|
|
imgPvp.color = new Color(128 / 255f, 128 / 255f, 128 / 255f);
|
|
}
|
|
|
|
imgPvpLock.SetActive(!DataHandler.IsClearStage(DataHandler.Const.pvpOpenStage));
|
|
}
|
|
else
|
|
{
|
|
CloseMenu();
|
|
}
|
|
|
|
SoundMgr.Instance.PlaySfx(SoundName.BtnPress);
|
|
}
|
|
|
|
public static void SCloseMenu()
|
|
{
|
|
curMgr.CloseMenu();
|
|
}
|
|
|
|
public void CloseMenu()
|
|
{
|
|
imgMenuPanel.SetActive(true);
|
|
canvasMenu.enabled = false;
|
|
}
|
|
|
|
public static void SCloseRewardEvent()
|
|
{
|
|
curMgr.btnOpenOpenRewardEvent.SetActive(false);
|
|
}
|
|
#endregion Base
|
|
|
|
#region Control Scene
|
|
// 메인 UI 켜기.
|
|
public static void SSetMainUiOn(bool bvalue)
|
|
{
|
|
curMgr.canvasRight.gameObject.SetActive(bvalue);
|
|
curMgr.canvasLeft.gameObject.SetActive(bvalue);
|
|
}
|
|
|
|
// 우측 메인 그룹 켜고 끄기.
|
|
public static void SSetMainUiGroupRight(bool righttop, bool rightbottom, bool pvp, bool open)
|
|
{
|
|
curMgr.mainRightTopSet.SetActive(righttop);
|
|
curMgr.mainRightBottomSet.SetActive(rightbottom);
|
|
curMgr.mainGroupPvp.SetActive(pvp);
|
|
|
|
#if false //TODO: block open event open button
|
|
if (DataHandler.GetPlayRewardEvent().sid < 1)
|
|
{
|
|
curMgr.btnOpenOpenRewardEvent.SetActive(open);
|
|
}
|
|
#else
|
|
curMgr.btnOpenOpenRewardEvent.gameObject.SetActive(false);
|
|
#endif
|
|
}
|
|
|
|
// 좌측 메인 그룹 켜고 끄기.
|
|
public static void SSetMainUiGroupLeft(bool lefttop, bool leftbottom, bool bottom)
|
|
{
|
|
curMgr.mainLeftTopSet.SetActive(lefttop);
|
|
curMgr.mainLeftBottomSet.SetActive(leftbottom);
|
|
curMgr.mainBottomSet.SetActive(bottom);
|
|
}
|
|
|
|
// 팝업 UI 켜기.
|
|
public static void SSetPopupUiOn(bool bvalue)
|
|
{
|
|
curMgr.canvasPopup.enabled = bvalue;
|
|
|
|
if (!bvalue)
|
|
{
|
|
if (curMgr.popupExit.IsOpen())
|
|
curMgr.popupExit.BtnNoPressed();
|
|
|
|
if (curMgr.goPopupOffline.activeSelf)
|
|
curMgr.ClosePopupOffline();
|
|
}
|
|
}
|
|
|
|
public static void OnOffStageInfo(bool bvalue)
|
|
{
|
|
curMgr.stageInfo.SetActive(bvalue);
|
|
}
|
|
#endregion Control Scene
|
|
|
|
#region Fade
|
|
public static void SFadeOutFullBack(float fduration)
|
|
{
|
|
if (curMgr != null)
|
|
curMgr.FadeOutFullBack(fduration);
|
|
}
|
|
|
|
private void FadeOutFullBack(float fduration)
|
|
{
|
|
Color clr = imgFullBlack.color;
|
|
clr.a = 0f;
|
|
canvasFullBlack.enabled = true;
|
|
imgFullBlack.DOFade(1f, fduration).SetUpdate(true);
|
|
}
|
|
|
|
public static void SFadeInFullBack(float fduration)
|
|
{
|
|
if (curMgr != null)
|
|
curMgr.FadeInFullBack(fduration);
|
|
}
|
|
|
|
private void FadeInFullBack(float fduration)
|
|
{
|
|
Color clr = imgFullBlack.color;
|
|
clr.a = 1f;
|
|
canvasFullBlack.enabled = true;
|
|
imgFullBlack.DOFade(0f, fduration).SetUpdate(true).OnComplete(() => canvasFullBlack.enabled = false);
|
|
}
|
|
|
|
public static void SFadeOutInFullBack(float ffadeout, float ffadein)
|
|
{
|
|
if (curMgr != null)
|
|
curMgr.FadeOutInFullBlack(ffadeout, ffadein);
|
|
}
|
|
|
|
private void FadeOutInFullBlack(float ffadeout, float ffadein)
|
|
{
|
|
Color clr = imgFullBlack.color;
|
|
clr.a = 0f;
|
|
canvasFullBlack.enabled = true;
|
|
imgFullBlack.DOFade(1f, ffadeout).SetUpdate(true).OnComplete(() =>
|
|
{
|
|
imgFullBlack.DOFade(0f, ffadein).SetUpdate(true).OnComplete(() => canvasFullBlack.enabled = false);
|
|
});
|
|
}
|
|
#endregion Fade
|
|
|
|
#region Player
|
|
//MainUI 왼쪽 상단에 플레이어 닉네임 설정
|
|
public static void SSetPlayerName()
|
|
{
|
|
curMgr.txtMainName.text = DataHandler.PlayData.playerName;
|
|
}
|
|
|
|
//MainUI 왼쪽 상단에 플레이어 칭호 설정
|
|
public static void SSetPlayerTitle(int id)
|
|
{
|
|
if (id == -1)
|
|
curMgr.txtMainTitle.text = LocalizationText.GetText("profile_empty_title");
|
|
else
|
|
curMgr.txtMainTitle.text = LocalizationText.GetText("profile_title_name" + id);
|
|
}
|
|
|
|
//MainUI 왼쪽 상단에 플레이어 레벨 설정
|
|
public static void SSetPlayerLv()
|
|
{
|
|
curMgr.txtMainLv.text = FormatString.TextLv(DataHandler.PlayData.playerLv);
|
|
}
|
|
|
|
//MainUI 왼쪽 상단에 플레이어 아이콘 설정
|
|
public static void SSetPlayerIcon(int id)
|
|
{
|
|
curMgr.imgMainIcon.sprite = AddressableMgr.GetPlayerIcon(id);
|
|
}
|
|
#endregion Player
|
|
|
|
#region Bgm & Zoom
|
|
public static void SOnChangeBgm(string strname)
|
|
{
|
|
if (curMgr != null)
|
|
curMgr.OnChangeBgm(strname);
|
|
}
|
|
|
|
private void OnChangeBgm(string strname)
|
|
{
|
|
txtBgmName.text = strname;
|
|
cvBgmName.gameObject.SetActive(true);
|
|
if (twcBgmName == null)
|
|
twcBgmName = cvBgmName.DOFade(0f, 1f).SetDelay(1.5f).SetAutoKill(false).SetUpdate(true).OnComplete(() => bChangingBgm = false).Pause();
|
|
twcBgmName.Restart();
|
|
}
|
|
|
|
public void ChangeZoom()
|
|
{
|
|
trfZoomSelect.position =trfZooms[IVCameraController.SChangeZoom()].position;
|
|
SoundMgr.Instance.PlaySfx(SoundName.BtnPress);
|
|
}
|
|
#endregion Bgm & Zoom
|
|
|
|
#region Up & Left Panel
|
|
public static void SOpenUpPanel(bool isUp = false, bool gold = false, bool dia = false, bool lvpoint = false, bool enhance = false, bool skill = false, bool awaken = false, bool awakenskill = false, bool gacha = false,
|
|
bool mileage = false, bool pvp = false, bool mail = false, float addy = 0)
|
|
{
|
|
if (curMgr != null)
|
|
{
|
|
RectTransform upGoods = curMgr.groupUpGood.GetComponent<RectTransform>();
|
|
|
|
if (isUp)
|
|
{
|
|
upGoods.anchoredPosition = new Vector3(-120, -20 + addy, 0);
|
|
}
|
|
else
|
|
{
|
|
upGoods.anchoredPosition = new Vector3 (-120, -44, 0);
|
|
}
|
|
|
|
curMgr.goUpMail.SetActive(mail);
|
|
curMgr.goUpGold.SetActive(gold);
|
|
curMgr.goUpDia.SetActive(dia);
|
|
curMgr.goUpLvPoint.SetActive(lvpoint);
|
|
curMgr.goUpReinStone.SetActive(enhance);
|
|
curMgr.goUpSkillStone.SetActive(skill);
|
|
curMgr.goUpAwakenStone.SetActive(awaken);
|
|
curMgr.goUpAwakenSkillStone.SetActive(awakenskill);
|
|
curMgr.goUpGachaToken.SetActive(gacha);
|
|
curMgr.goUpMileage.SetActive(mileage);
|
|
curMgr.goUpPvpTicket.SetActive(pvp);
|
|
|
|
curMgr.groupUpGood.SetActive(true);
|
|
curMgr.groupLeftGood.SetActive(false);
|
|
curMgr.canvasUpUI.enabled = true;
|
|
}
|
|
}
|
|
|
|
public static void SCloseUpPanel()
|
|
{
|
|
if (curMgr != null)
|
|
{
|
|
curMgr.canvasUpUI.enabled = false;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// open left panel, relative to right panel
|
|
/// </summary>
|
|
public static void SOpenLeftPanel(bool gold = false, bool dia = false, bool lvpoint = false, bool enhance = false,
|
|
bool skill = false, bool awaken = false, bool awakenskill = false, bool change = false,
|
|
bool pudding = false, bool dggoldticket = false, bool dgenhanceticket = false, bool dgpetticket = false,
|
|
bool dgawakenticket = false, bool dgrelicticket = false, bool maskenhance = false, bool fatansyWorldRing = false,
|
|
bool memoryPiece = false)
|
|
{
|
|
if (curMgr != null)
|
|
{
|
|
SSetGoods();
|
|
|
|
curMgr.leftGold.go.SetActive(gold);
|
|
curMgr.leftDia.go.SetActive(dia);
|
|
curMgr.leftLvPoint.go.SetActive(lvpoint);
|
|
curMgr.leftReinStone.go.SetActive(enhance);
|
|
curMgr.leftSkillStone.go.SetActive(skill);
|
|
curMgr.leftAwakenStone.go.SetActive(awaken);
|
|
curMgr.leftAwakenSkillStone.go.SetActive(awakenskill);
|
|
curMgr.leftChangeStone.go.SetActive(change);
|
|
curMgr.leftPudding.go.SetActive(pudding);
|
|
curMgr.leftDeepCaveDgTicket.go.SetActive(dggoldticket);
|
|
curMgr.leftAtlantisDgTicket.go.SetActive(dgenhanceticket);
|
|
curMgr.leftProtectTheMerchantDgTicket.go.SetActive(dgpetticket);
|
|
curMgr.leftDevelopTheJungleDgTicket.go.SetActive(dgawakenticket);
|
|
curMgr.leftHuntEagleDgKey.go.SetActive(dgrelicticket);
|
|
curMgr.leftMaskEnhance.go.SetActive(maskenhance);
|
|
curMgr.leftFantasyWorldRing.go.SetActive(fatansyWorldRing);
|
|
curMgr.leftMemoryPiece.go.SetActive(memoryPiece);
|
|
|
|
curMgr.groupUpGood.SetActive(false);
|
|
curMgr.groupLeftGood.SetActive(true);
|
|
curMgr.canvasUpUI.enabled = true;
|
|
}
|
|
}
|
|
|
|
public static void SCloseLeftPanel()
|
|
{
|
|
if (curMgr != null)
|
|
{
|
|
curMgr.canvasUpUI.enabled = false;
|
|
}
|
|
}
|
|
#endregion Up & Left Panel
|
|
|
|
#region Popup Preset
|
|
/// <summary>
|
|
/// 현재 선택된 스킬 프리셋.
|
|
/// </summary>
|
|
/// <returns>프리셋 인덱스.</returns>
|
|
public static int SGetSkillPreset()
|
|
{
|
|
return curMgr.ppPreset.GetSkillPreset();
|
|
}
|
|
|
|
/// <summary>
|
|
/// 현재 선택된 펫 프리셋.
|
|
/// </summary>
|
|
/// <returns>프리셋 인덱스.</returns>
|
|
public static int SGetPetPreset()
|
|
{
|
|
return curMgr.ppPreset.GetPetPreset();
|
|
}
|
|
|
|
/// <summary>
|
|
/// 현재 선택된 각성 프리셋.
|
|
/// </summary>
|
|
/// <returns>프리셋 인덱스.</returns>
|
|
public static int SGetAwakenPreset()
|
|
{
|
|
return curMgr.ppPreset.GetAwakenPreset();
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// 스테이지에서 사용하는 프리셋 인덱스 보존.
|
|
/// </summary>
|
|
/// <param name="iskillpreset">스킬 프리셋 인덱스.</param>
|
|
/// <param name="ipetpreset">펫 프리셋 인덱스트.</param>
|
|
/// <param name="iawakenpreset">각성 프리셋 인덱스.</param>
|
|
/// <returns></returns>
|
|
public static void SPreservePreset(int iskillpreset, int ipetpreset, int iawakenpreset)
|
|
{
|
|
curMgr.ppPreset.PreservePreset(iskillpreset, ipetpreset, iawakenpreset);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 보존해 두었던 프리셋으로 되돌리기.
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public static void SReturnToPreservePreset()
|
|
{
|
|
curMgr.ppPreset.ReturnToPreservePreset();
|
|
}
|
|
|
|
/// <summary>
|
|
/// 프리셋 팝업 열기.
|
|
/// </summary>
|
|
/// <param name="skillpreset">해당 컨텐츠에서 기본으로 선택된 스킬 프리셋 인덱스.</param>
|
|
/// <param name="petpreset">해당 컨텐츠에서 기본으로 선택된 펫 프리셋 인덱스트.</param>
|
|
/// <param name="awakenpreset">해당 컨텐츠에서 기본으로 선택된 각성 프리셋 인덱스.</param>
|
|
/// <param name="actionyes">네 버튼을 눌렀을 때 처리.</param>
|
|
/// <param name="actionno">아니오 버튼을 눌렀을 때 처리.</param>
|
|
/// <returns></returns>
|
|
public static void SOpenPopupPreset(int skillpreset, int petpreset, int awakenpreset, System.Action actionyes = null, System.Action actionno = null)
|
|
{
|
|
if (curMgr != null)
|
|
curMgr.OpenPopupPreset(skillpreset, petpreset, awakenpreset, actionyes, actionno);
|
|
}
|
|
|
|
// 프리셋 팝업 열기.
|
|
private void OpenPopupPreset(int skillpreset, int petpreset, int awakenpreset, System.Action actionyes = null, System.Action actionno = null)
|
|
{
|
|
if (ppPreset == null || ppPreset.IsOpen())
|
|
return;
|
|
|
|
iPopup++;
|
|
ppPreset.Open(skillpreset, petpreset, awakenpreset, actionyes, actionno);
|
|
if (!canvasPopup.enabled)
|
|
canvasPopup.enabled = true;
|
|
}
|
|
|
|
public static void ClosePopupSet()
|
|
{
|
|
if (curMgr.ppPreset != null && curMgr.ppPreset.IsOpen())
|
|
{
|
|
curMgr.ppPreset.BtnNoPressed();
|
|
|
|
if (!curMgr.canvasPopup.enabled)
|
|
curMgr.canvasPopup.enabled = false;
|
|
|
|
return;
|
|
}
|
|
|
|
if (curMgr.pp2Buttons != null)
|
|
{
|
|
for (int i = 0; i < curMgr.pp2Buttons.Length; i++)
|
|
{
|
|
// 이미 열려있는 팝업.
|
|
if (curMgr.pp2Buttons[i].IsOpen())
|
|
curMgr.pp2Buttons[i].BtnNoPressed();
|
|
}
|
|
|
|
if (!curMgr.canvasPopup.enabled)
|
|
curMgr.canvasPopup.enabled = false;
|
|
return;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 스킬 프리셋 선택.
|
|
/// </summary>
|
|
/// <param name="ipresetindex">선택한 프리셋 인덱스.</param>
|
|
/// <returns></returns>
|
|
public static void SSetSkillPreset(int ipresetindex)
|
|
{
|
|
if (curMgr != null)
|
|
curMgr.ppPreset.SetSkillPreset(ipresetindex);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 펫 프리셋 선택.
|
|
/// </summary>
|
|
/// <param name="ipresetindex">선택한 프리셋 인덱스.</param>
|
|
/// <returns></returns>
|
|
public static void SSetPetPreset(int ipresetindex)
|
|
{
|
|
if (curMgr != null)
|
|
curMgr.ppPreset.SetPetPreset(ipresetindex);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 각성 프리셋 선택.
|
|
/// </summary>
|
|
/// <param name="ipresetindex">선택한 프리셋 인덱스.</param>
|
|
/// <returns></returns>
|
|
public static void SSetAwakenPreset(int ipresetindex)
|
|
{
|
|
if (curMgr != null)
|
|
curMgr.ppPreset.SetAwakenPreset(ipresetindex);
|
|
}
|
|
#endregion Popup Preset
|
|
|
|
#region Popup
|
|
/// <summary>
|
|
/// 1버튼 팝업 열기.
|
|
/// </summary>
|
|
/// <param name="strmsg">메시지 텍스트.</param>
|
|
/// <param name="actionyes">확인 버튼을 눌렀을 때 처리.</param>
|
|
/// <param name="strtitle">제목 텍스트. 기본값 '확인'.</param>
|
|
/// <param name="stryes">확인 버튼 텍스트. 기본값 '확인'.</param>
|
|
/// <param name="bclose">확인 버튼을 눌렀을때 팝업을 닫을지.</param>
|
|
/// <param name="ftime">자동으로 팝업이 닫히는 시간.</param>
|
|
public static void SOpenPopupCheckNet(string strmsg, System.Action actionyes = null, string strtitle = null, string stryes = null, bool bclose = true, float ftime = 0f, int igroup = -1)
|
|
{
|
|
if (curMgr != null)
|
|
curMgr.OepnPopupNet(strmsg, actionyes, strtitle, stryes, bclose, ftime, igroup);
|
|
}
|
|
|
|
private void OepnPopupNet(string strmsg, System.Action actionyes = null, string strtitle = null, string stryes = null, bool bclose = true, float ftime = 0f, int igroup = -1)
|
|
{
|
|
if (checkNet == null)
|
|
return;
|
|
if (checkNet.IsOpen())
|
|
return;
|
|
|
|
checkNet.Open(strmsg, actionyes,strtitle, stryes, bclose, ftime, igroup);
|
|
if (!canvasPopup.enabled)
|
|
canvasPopup.enabled = true;
|
|
return;
|
|
|
|
}
|
|
|
|
public static void SOpenPopup1Button(string strmsg, System.Action actionyes = null, string strtitle = null, string stryes = null, bool bclose = true, float ftime = 0f, int igroup = -1)
|
|
{
|
|
if (curMgr != null)
|
|
curMgr.OpenPopup1Button(strmsg, actionyes, strtitle, stryes, bclose, ftime, igroup);
|
|
}
|
|
|
|
// 1버튼 팝업 열기.
|
|
private void OpenPopup1Button(string strmsg, System.Action actionyes = null, string strtitle = null, string stryes = null, bool bclose = true, float ftime = 0f, int igroup = -1)
|
|
{
|
|
if (pp1Buttons == null)
|
|
return;
|
|
for (int i = 0; i < pp1Buttons.Length; i++)
|
|
{
|
|
// 이미 열려있는 팝업.
|
|
if (pp1Buttons[i].IsOpen())
|
|
continue;
|
|
|
|
iPopup++;
|
|
pp1Buttons[i].Open(strmsg, actionyes, strtitle, stryes, bclose, ftime, igroup);
|
|
if (!canvasPopup.enabled)
|
|
canvasPopup.enabled = true;
|
|
return;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 1버튼 팝업 그룹 닫기.
|
|
/// </summary>
|
|
/// <param name="igroup">닫으려는 팝업의 그룹.</param>
|
|
/// <returns></returns>
|
|
public static void SClosePopup1Button(int igroup)
|
|
{
|
|
if (curMgr != null)
|
|
curMgr.ClosePopup1Button(igroup);
|
|
}
|
|
|
|
// 1버튼 팝업 그룹 닫기.
|
|
private void ClosePopup1Button(int igroup)
|
|
{
|
|
if (pp1Buttons == null)
|
|
return;
|
|
for (int i = 0; i < pp1Buttons.Length; i++)
|
|
{
|
|
// 닫혀있는 팝업.
|
|
if (!pp1Buttons[i].IsOpen())
|
|
continue;
|
|
pp1Buttons[i].CloseGroup(igroup);
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 2버튼 팝업 열기.
|
|
/// </summary>
|
|
/// <param name="strmsg">메시지 텍스트.</param>
|
|
/// <param name="actionyes">네 버튼을 눌렀을 때 처리.</param>
|
|
/// <param name="actionno">아니오 버튼을 눌렀을 때 처리.</param>
|
|
/// <param name="strtitle">제목 텍스트. 기본값 '확인'.</param>
|
|
/// <param name="stryes">네 버튼 텍스트. 기본값 '네'.</param>
|
|
/// <param name="strno">아니오 버튼 텍스트. 기본값 '아니오'.</param>
|
|
/// <returns></returns>
|
|
public static void SOpenPopup2Button(string strmsg, System.Action actionyes = null, System.Action actionno = null, string strtitle = null, string stryes = null, string strno = null, int igroup = -1)
|
|
{
|
|
if (curMgr != null)
|
|
curMgr.OpenPopup2Button(strmsg, actionyes, actionno, strtitle, stryes, strno, igroup);
|
|
}
|
|
|
|
// 2버튼 팝업 열기.
|
|
private void OpenPopup2Button(string strmsg, System.Action actionyes = null, System.Action actionno = null, string strtitle = null, string stryes = null, string strno = null, int igroup = -1)
|
|
{
|
|
if (pp2Buttons == null)
|
|
return;
|
|
for (int i = 0; i < pp2Buttons.Length; i++)
|
|
{
|
|
// 이미 열려있는 팝업.
|
|
if (pp2Buttons[i].IsOpen())
|
|
continue;
|
|
|
|
iPopup++;
|
|
pp2Buttons[i].Open(strmsg, actionyes, actionno, strtitle, stryes, strno, igroup);
|
|
if (!canvasPopup.enabled)
|
|
canvasPopup.enabled = true;
|
|
return;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 2버튼 팝업 그룹 닫기.
|
|
/// </summary>
|
|
/// <param name="igroup">닫으려는 팝업의 그룹.</param>
|
|
/// <returns></returns>
|
|
public static void SClosePopup2Button(int igroup)
|
|
{
|
|
if (curMgr != null)
|
|
curMgr.ClosePopup2Button(igroup);
|
|
}
|
|
|
|
// 2버튼 팝업 그룹 닫기.
|
|
private void ClosePopup2Button(int igroup)
|
|
{
|
|
if (pp2Buttons == null)
|
|
return;
|
|
for (int i = 0; i < pp2Buttons.Length; i++)
|
|
{
|
|
// 닫혀있는 팝업.
|
|
if (!pp2Buttons[i].IsOpen())
|
|
continue;
|
|
pp2Buttons[i].CloseGroup(igroup);
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 재화 목록 팝업 열기.
|
|
/// </summary>
|
|
/// <param name="goods">아이템 배열.</param>
|
|
/// <param name="actionyes">닫기 버튼을 눌렀을 때 처리.</param>
|
|
/// <param name="strtitle">제목 텍스트.</param>
|
|
/// <param name="ftime">자동으로 팝업이 닫히는 시간.</param>
|
|
/// <returns></returns>
|
|
public static void SOpenPopupGoods(IList<nGoods> goods, System.Action actionyes = null, string strtitle = null, float ftime = 0f)
|
|
{
|
|
if (curMgr != null)
|
|
curMgr.OpenPopupGoods(goods, actionyes, strtitle, ftime);
|
|
}
|
|
|
|
// 재화 목록 팝업 열기.
|
|
private void OpenPopupGoods(IList<nGoods> goods, System.Action actionyes = null, string strtitle = null, float ftime = 0f)
|
|
{
|
|
if (ppGoods == null)
|
|
return;
|
|
iPopup++;
|
|
ppGoods.Open(goods, actionyes, strtitle, ftime);
|
|
ppGoodsEffect.Play();
|
|
SoundMgr.Instance.PlaySfx(SoundName.GetGoods);
|
|
StartCoroutine(PopupGoodsLineEffect());
|
|
if (!canvasPopup.enabled)
|
|
canvasPopup.enabled = true;
|
|
}
|
|
|
|
int LineSML = 1;
|
|
public static void SetLineSML(int sml)
|
|
{
|
|
curMgr.LineSML = sml;
|
|
}
|
|
|
|
public IEnumerator PopupGoodsLineEffect()
|
|
{
|
|
yield return new WaitForSeconds(0.1f);
|
|
|
|
switch (LineSML)
|
|
{
|
|
case 1://small
|
|
curMgr.ppGoodsEffectLineS.Play();
|
|
break;
|
|
case 2://medium
|
|
curMgr.ppGoodsEffectLineM.Play();
|
|
break;
|
|
case 3://large
|
|
curMgr.ppGoodsEffectLineL.Play();
|
|
break;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 아이템 사용 팝업 열기.
|
|
/// </summary>
|
|
/// <param name="goodsuse">사용할 아이템.</param>
|
|
/// <param name="actionsub">- 버튼을 눌렀을 때 처리.</param>
|
|
/// <param name="actionadd">+ 버튼을 눌렀을 때 처리.</param>
|
|
/// <param name="actionmin">Min 버튼을 눌렀을 때 처리.</param>
|
|
/// <param name="actionmax">Max 버튼을 눌렀을 때 처리.</param>
|
|
/// <param name="actionyes">네 버튼을 눌렀을 때 처리.</param>
|
|
/// <param name="actionno">아니오 버튼을 눌렀을 때 처리.</param>
|
|
/// <param name="strtitle">제목 텍스트.</param>
|
|
/// <param name="stryes">네 버튼 텍스트.</param>
|
|
/// <param name="strno">아니오 버튼 텍스트.</param>
|
|
/// <returns></returns>
|
|
public static void SOpenPopupItemUse(nGoods goodsuse, System.Action actionsub, System.Action actionadd, System.Action actionmin, System.Action actionmax,
|
|
System.Action actionyes, System.Action actionno, string strtitle, string stryes, string strno)
|
|
{
|
|
curMgr.iPopup++;
|
|
curMgr.ppItemUse.Open(goodsuse, actionsub, actionadd, actionmin, actionmax, actionyes, actionno, strtitle, stryes, strno);
|
|
if (!curMgr.canvasPopup.enabled)
|
|
curMgr.canvasPopup.enabled = true;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 아이템 사용 팝업 수 표시.
|
|
/// </summary>
|
|
/// <param name="icount">사용하려는 수. 1, 2, 3...</param>
|
|
/// <param name="iuse">실제로 사용되는 수. 한 번 사용할 때 5개가 필요한 아이템은 5, 10, 15...</param>
|
|
/// <returns></returns>
|
|
public static void SSetPopupItemUseCount(int icount, int iuse)
|
|
{
|
|
curMgr.ppItemUse.SetCount(icount, iuse);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 아이템 사용-생성 팝업 열기.
|
|
/// </summary>
|
|
/// <param name="goodsuse">사용할 아이템.</param>
|
|
/// <param name="goodsto">생성될 아이템.</param>
|
|
/// <param name="actionsub">- 버튼을 눌렀을 때 처리.</param>
|
|
/// <param name="actionadd">+ 버튼을 눌렀을 때 처리.</param>
|
|
/// <param name="actionmin">Min 버튼을 눌렀을 때 처리.</param>
|
|
/// <param name="actionmax">Max 버튼을 눌렀을 때 처리.</param>
|
|
/// <param name="actionyes">네 버튼을 눌렀을 때 처리.</param>
|
|
/// <param name="actionno">아니오 버튼을 눌렀을 때 처리.</param>
|
|
/// <param name="strtitle">제목 텍스트.</param>
|
|
/// <param name="stryes">네 버튼 텍스트.</param>
|
|
/// <param name="strno">아니오 버튼 텍스트.</param>
|
|
/// <returns></returns>
|
|
public static void SOpenPopupItemUseTo(nGoods goodsuse, nGoods goodsto, System.Action actionsub, System.Action actionadd, System.Action actionmin, System.Action actionmax,
|
|
System.Action actionyes, System.Action actionno, string strtitle, string stryes, string strno)
|
|
{
|
|
curMgr.iPopup++;
|
|
curMgr.ppItemUseTo.Open(goodsuse, goodsto, actionsub, actionadd, actionmin, actionmax, actionyes, actionno, strtitle, stryes, strno);
|
|
if (!curMgr.canvasPopup.enabled)
|
|
curMgr.canvasPopup.enabled = true;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 아이템 사용-생성 팝업 수 표시.
|
|
/// </summary>
|
|
/// <param name="icount">사용하려는 수. 1, 2, 3...</param>
|
|
/// <param name="iuse">실제로 사용되는 수. 한 번 사용할 때 5개가 필요한 아이템은 5, 10, 15...</param>
|
|
/// <param name="icount">생성되는 수. 1, 2, 3...</param>
|
|
/// <returns></returns>
|
|
public static void SSetPopupItemUseToCount(int icount, int iuse, int ito)
|
|
{
|
|
curMgr.ppItemUseTo.SetCount(icount, iuse, ito);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 아이템들 사용-생성 팝업 열기.
|
|
/// </summary>
|
|
/// <param name="goodsuses">사용할 아이템 배열.</param>
|
|
/// <param name="goodsto">생성될 아이템.</param>
|
|
/// <param name="actionyes">네 버튼을 눌렀을 때 처리.</param>
|
|
/// <param name="actionno">아니오 버튼을 눌렀을 때 처리.</param>
|
|
/// <param name="strtitle">제목 텍스트.</param>
|
|
/// <param name="stryes">네 버튼 텍스트.</param>
|
|
/// <param name="strno">아니오 버튼 텍스트.</param>
|
|
/// <returns></returns>
|
|
public static void SOpenPopupItemsUseTo(nGoods[] goodsuses, nGoods goodsto, System.Action actionyes, System.Action actionno, string strtitle, string strmsg, string stryes, string strno)
|
|
{
|
|
curMgr.iPopup++;
|
|
curMgr.ppItemsUseTo.Open(goodsuses, goodsto, actionyes, actionno, strtitle, strmsg, stryes, strno);
|
|
if (!curMgr.canvasPopup.enabled)
|
|
curMgr.canvasPopup.enabled = true;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 아이템들 사용-생성 팝업 수 표시.
|
|
/// </summary>
|
|
/// <param name="icnthaves">각 아이템별로 보유중인 수.</param>
|
|
/// <param name="icntneeds">각 아이템별로 필요한 수.</param>
|
|
/// <returns></returns>
|
|
public static void SSetPopupItemsUseToCount(int[] icnthaves, int[] icntneeds)
|
|
{
|
|
curMgr.ppItemsUseTo.SetCount(icnthaves, icntneeds);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 아이템 구매 팝업 열기.
|
|
/// </summary>
|
|
/// <param name="goods">구매할 아이템.</param>
|
|
/// <param name="ibuytype">구매에 사용하는 재화 종류.</param>
|
|
/// <param name="ibuyid">구매에 사용하는 재화 ID.</param>
|
|
/// <param name="iprice">구매 가격.</param>
|
|
/// <param name="actionyes">네 버튼을 눌렀을 때 처리.</param>
|
|
/// <param name="actionno">아니오 버튼을 눌렀을 때 처리.</param>
|
|
/// <param name="strtitle">제목 텍스트.</param>
|
|
/// <param name="strno">아니오 버튼 텍스트.</param>
|
|
/// <returns></returns>
|
|
public static void SOpenPopupItemBuy(nGoods goods, int ibuytype, int ibuyid, int iprice, System.Action actionyes, System.Action actionno, string strtitle, string strno)
|
|
{
|
|
curMgr.iPopup++;
|
|
curMgr.ppItemBuy.Open(goods, ibuytype, ibuyid, iprice, actionyes, actionno, strtitle, strno);
|
|
if (!curMgr.canvasPopup.enabled)
|
|
curMgr.canvasPopup.enabled = true;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 아이템 수량 구매 팝업 열기.
|
|
/// </summary>
|
|
/// <param name="goods">구매할 아이템.</param>
|
|
/// <param name="ibuytype">구매에 사용하는 재화 종류.</param>
|
|
/// <param name="ibuyid">구매에 사용하는 재화 ID.</param>
|
|
/// <param name="iprice">구매 가격.</param>
|
|
/// <param name="actionsub">- 버튼을 눌렀을 때 처리.</param>
|
|
/// <param name="actionadd">+ 버튼을 눌렀을 때 처리.</param>
|
|
/// <param name="actionmin">Min 버튼을 눌렀을 때 처리.</param>
|
|
/// <param name="actionmax">Max 버튼을 눌렀을 때 처리.</param>
|
|
/// <param name="actionyes">네 버튼을 눌렀을 때 처리.</param>
|
|
/// <param name="actionno">아니오 버튼을 눌렀을 때 처리.</param>
|
|
/// <param name="strtitle">제목 텍스트.</param>
|
|
/// <param name="strno">아니오 버튼 텍스트.</param>
|
|
/// <returns></returns>
|
|
public static void SOpenPopupItemBuyCount(nGoods goods, int ibuytype, int ibuyid, int iprice,
|
|
System.Action actionsub, System.Action actionadd, System.Action actionmin, System.Action actionmax, System.Action actionyes, System.Action actionno, string strtitle, string strno, Sprite sprBtn=null)
|
|
{
|
|
curMgr.iPopup++;
|
|
curMgr.ppItemBuyCount.Open(goods, ibuytype, ibuyid, iprice, actionsub, actionadd, actionmin, actionmax, actionyes, actionno, strtitle, strno, sprBtn: sprBtn);
|
|
if (!curMgr.canvasPopup.enabled)
|
|
curMgr.canvasPopup.enabled = true;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 아이템 수량 구매 팝업 수 표시.
|
|
/// </summary>
|
|
/// <param name="icount">사용하려는 수. 1, 2, 3...</param>
|
|
/// <param name="iunitcount">1개 구매했을때 획득하는 수량.</param>
|
|
/// <param name="iprice">1개 구매 가격.</param>
|
|
/// <returns></returns>
|
|
public static void SSetPopupItemBuyCount(int icount, int iunitcount, int iprice)
|
|
{
|
|
curMgr.ppItemBuyCount.SetCount(icount, iunitcount, iprice);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 희귀도 체크 팝업 열기.
|
|
/// </summary>
|
|
/// <param name="goods">아이템.</param>
|
|
/// <param name="rarities">각 희귀도 초기 체크 상태.</param>
|
|
/// <param name="actiontoggle">토글을 눌렀을 때 처리.</param>
|
|
/// <param name="actionyes">네 버튼을 눌렀을 때 처리.</param>
|
|
/// <param name="actionno">아니오 버튼을 눌렀을 때 처리.</param>
|
|
/// <param name="strtitle">제목 텍스트.</param>
|
|
/// <param name="strdesc">설명 텍스트.</param>
|
|
/// <param name="stryes">네 버튼 텍스트.</param>
|
|
/// <param name="strno">아니오 버튼 텍스트.</param>
|
|
/// <returns></returns>
|
|
public static void SOpenPopupRarityCheck(nGoods goods, fRangeRarity rarities, System.Action actiontoggle, System.Action actionyes, System.Action actionno,
|
|
string strtitle, string strdesc, string stryes, string strno)
|
|
{
|
|
curMgr.iPopup++;
|
|
curMgr.ppRarityCheck.Open(goods, rarities, actiontoggle, actionyes, actionno, strtitle, strdesc, stryes, strno);
|
|
if (!curMgr.canvasPopup.enabled)
|
|
curMgr.canvasPopup.enabled = true;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 희귀도 체크 Yes 버튼 활성화.
|
|
/// </summary>
|
|
/// <param name="benable">활성화 상태.</param>
|
|
/// <returns></returns>
|
|
public static void SSetPopupRarityCheckYes(bool benable)
|
|
{
|
|
curMgr.ppRarityCheck.SetBtnYes(benable);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 희귀도 체크 상태.
|
|
/// </summary>
|
|
/// <returns>각 희귀도별 체크 상태 플래그.</returns>
|
|
public static fRangeRarity SGetPopupRarityCheck()
|
|
{
|
|
return curMgr.ppRarityCheck.GetPopupRarityCheck();
|
|
}
|
|
|
|
/// <summary>
|
|
/// 희귀도별 확률 팝업 열기.
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public static void SOpenPopupRarityRate()
|
|
{
|
|
curMgr.OpenPopupRarityRate();
|
|
}
|
|
|
|
private void OpenPopupRarityRate()
|
|
{
|
|
var gcp = GameProperty.Instance.GlobalColorPallete;
|
|
|
|
if (txtRarityTitles == null)
|
|
{
|
|
bReLocalizeRarity = false;
|
|
Transform trfpp = goPopupRate.transform;
|
|
trfpp.Find("txtT").GetComponent<TextMeshProUGUI>().text = LocalizationText.GetText("all_effectaddinfo");
|
|
trfpp.Find("txtRateT").GetComponent<TextMeshProUGUI>().text = LocalizationText.GetText("rate_rarityt");
|
|
trfpp.Find("txtOptionT").GetComponent<TextMeshProUGUI>().text = LocalizationText.GetText("option_rarityt");
|
|
trfpp.Find("txtRateMsg").GetComponent<TextMeshProUGUI>().text = LocalizationText.GetText("option_raritymsg");
|
|
|
|
TextMeshProUGUI[] txtrates = trfpp.Find("rates").GetComponentsInChildren<TextMeshProUGUI>();
|
|
for (int i = 0; i < txtrates.Length; i++)
|
|
{
|
|
txtrates[i].text = FormatString.CombineAllString(Global.STR_Rarity[i + 1], FormatString.S_Blank, FormatString.TextIntPerBracket(DataHandler.GetExtraRarityRate(i + 1)));
|
|
}
|
|
|
|
Dictionary<eEffectType, int>[] datas = DataHandler.GetExtraAbilityIds();
|
|
RectTransform rtrfoption = trfpp.Find("SvOption").GetChild(0).GetComponent<RectTransform>();
|
|
|
|
string stroption = FormatString.StringFormat("{0}/{1}/{2}/{3}/{4}/{5}/{6}",
|
|
Utility.GetMergeStringWithColor(gcp.GetColorByKey("gray"), "{0}"),
|
|
Utility.GetMergeStringWithColor(gcp.GetColorByKey("orange"), "{1}"),
|
|
Utility.GetMergeStringWithColor(gcp.GetColorByKey("green"), "{2}"),
|
|
Utility.GetMergeStringWithColor(gcp.GetColorByKey("magenta"), "{3}"),
|
|
Utility.GetMergeStringWithColor(gcp.GetColorByKey("skyblue"), "{4}"),
|
|
Utility.GetMergeStringWithColor(gcp.GetColorByKey("yellow"), "{5}"),
|
|
Utility.GetMergeStringWithColor(gcp.GetColorByKey("red_light"), "{6}"));
|
|
|
|
Vector2 v2size = rtrfoption.sizeDelta;
|
|
v2size.y = datas[0].Count * 82 - 10;
|
|
rtrfoption.sizeDelta = v2size;
|
|
|
|
txtRarityTitles = new TextMeshProUGUI[datas[0].Count];
|
|
txtRarityRates = new TextMeshProUGUI[datas[0].Count];
|
|
|
|
int index = 0;
|
|
foreach (var item in datas[0])
|
|
{
|
|
eEffectType key = item.Key;
|
|
GameObject go = Instantiate(prfRarityRate, rtrfoption);
|
|
txtRarityTitles[index] = go.GetComponent<TextMeshProUGUI>();
|
|
txtRarityRates[index] = go.transform.GetChild(0).GetComponent<TextMeshProUGUI>();
|
|
|
|
txtRarityTitles[index].text = FormatString.TextEffectTitle(key);
|
|
txtRarityRates[index].text = FormatString.StringFormat(stroption,
|
|
FormatString.TextEffectValue(key, DataHandler.GetExtraAbilityValue(datas[0][key]), true, true, true),
|
|
FormatString.TextEffectValue(key, DataHandler.GetExtraAbilityValue(datas[1][key]),true, true, true),
|
|
FormatString.TextEffectValue(key, DataHandler.GetExtraAbilityValue(datas[2][key]),true, true, true),
|
|
FormatString.TextEffectValue(key, DataHandler.GetExtraAbilityValue(datas[3][key]),true, true, true),
|
|
FormatString.TextEffectValue(key, DataHandler.GetExtraAbilityValue(datas[4][key]), true, true, true),
|
|
FormatString.TextEffectValue(key, DataHandler.GetExtraAbilityValue(datas[5][key]), true, true, true),
|
|
FormatString.TextEffectValue(key, DataHandler.GetExtraAbilityValue(datas[6][key]), true, true, true));
|
|
index++;
|
|
}
|
|
}
|
|
else if (bReLocalizeRarity)
|
|
{
|
|
bReLocalizeRarity = false;
|
|
|
|
Transform trfpp = goPopupRate.transform;
|
|
trfpp.Find("txtT").GetComponent<TextMeshProUGUI>().text = LocalizationText.GetText("all_effectaddinfo");
|
|
trfpp.Find("txtRateT").GetComponent<TextMeshProUGUI>().text = LocalizationText.GetText("rate_rarityt");
|
|
trfpp.Find("txtOptionT").GetComponent<TextMeshProUGUI>().text = LocalizationText.GetText("option_rarityt");
|
|
trfpp.Find("txtRateMsg").GetComponent<TextMeshProUGUI>().text = LocalizationText.GetText("option_raritymsg");
|
|
|
|
Dictionary<eEffectType, int>[] datas = DataHandler.GetExtraAbilityIds();
|
|
|
|
string stroption = FormatString.StringFormat("{0}/{1}/{2}/{3}/{4}/{5}/{6}",
|
|
Utility.GetMergeStringWithColor(gcp.GetColorByKey("gray"), "{0}"),
|
|
Utility.GetMergeStringWithColor(gcp.GetColorByKey("orange"), "{1}"),
|
|
Utility.GetMergeStringWithColor(gcp.GetColorByKey("green"), "{2}"),
|
|
Utility.GetMergeStringWithColor(gcp.GetColorByKey("magenta"), "{3}"),
|
|
Utility.GetMergeStringWithColor(gcp.GetColorByKey("skyblue"), "{4}"),
|
|
Utility.GetMergeStringWithColor(gcp.GetColorByKey("yellow"), "{5}"),
|
|
Utility.GetMergeStringWithColor(gcp.GetColorByKey("red_light"), "{6}"));
|
|
|
|
int index = 0;
|
|
foreach (var item in datas[0])
|
|
{
|
|
eEffectType key = item.Key;
|
|
txtRarityTitles[index].text = FormatString.TextEffectTitle(key);
|
|
txtRarityRates[index].text = FormatString.StringFormat(stroption,
|
|
FormatString.TextEffectValue(key, DataHandler.GetExtraAbilityValue(datas[0][key])),
|
|
FormatString.TextEffectValue(key, DataHandler.GetExtraAbilityValue(datas[1][key])),
|
|
FormatString.TextEffectValue(key, DataHandler.GetExtraAbilityValue(datas[2][key])),
|
|
FormatString.TextEffectValue(key, DataHandler.GetExtraAbilityValue(datas[3][key])),
|
|
FormatString.TextEffectValue(key, DataHandler.GetExtraAbilityValue(datas[4][key])),
|
|
FormatString.TextEffectValue(key, DataHandler.GetExtraAbilityValue(datas[5][key])),
|
|
FormatString.TextEffectValue(key, DataHandler.GetExtraAbilityValue(datas[6][key])));
|
|
index++;
|
|
}
|
|
}
|
|
|
|
iPopup++;
|
|
goPopupRate.SetActive(true);
|
|
if (!canvasPopup.enabled)
|
|
canvasPopup.enabled = true;
|
|
}
|
|
|
|
// 희귀도별 확률 팝업 닫기.
|
|
public void ClosePopupRarityRate()
|
|
{
|
|
goPopupRate.SetActive(false);
|
|
iPopup--;
|
|
if (iPopup <= 0)
|
|
canvasPopup.enabled = false;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 전체 효과 팝업 열기.
|
|
/// </summary>
|
|
/// <param name="strtitle">팝업 제목.</param>
|
|
/// <param name="datas">효과별 값.</param>
|
|
/// <returns></returns>
|
|
public static void SOpenPopupHaveEfc(string strtitle, Dictionary<eEffectType, long> datas)
|
|
{
|
|
SoundMgr.Instance.PlaySfx(SoundName.BtnPress);
|
|
curMgr.OpenPopupHaveEfc(strtitle, datas);
|
|
}
|
|
|
|
private void OpenPopupHaveEfc(string strtitle, Dictionary<eEffectType, long> datas)
|
|
{
|
|
// 팝업 처음 열 때.
|
|
if (txtHaveEfcT == null)
|
|
{
|
|
txtHaveEfcT = goPopupHaveEfc.transform.Find("txtTitle").GetComponent<TextMeshProUGUI>();
|
|
|
|
Transform trfsv = goPopupHaveEfc.transform.Find("Sv").GetChild(0);
|
|
txtHaveEfcTitles = new TextMeshProUGUI[datas.Count];
|
|
txtHaveEfcValues = new TextMeshProUGUI[datas.Count];
|
|
|
|
int index = 0;
|
|
foreach (var item in datas)
|
|
{
|
|
GameObject go = Instantiate(prfHaveEfc, trfsv);
|
|
txtHaveEfcTitles[index] = go.GetComponent<TextMeshProUGUI>();
|
|
txtHaveEfcValues[index] = go.transform.GetChild(0).GetComponent<TextMeshProUGUI>();
|
|
|
|
if (item.Value <= 0L)
|
|
{
|
|
go.SetActive(false);
|
|
}
|
|
else
|
|
{
|
|
txtHaveEfcTitles[index].text = FormatString.TextEffectTitle(item.Key);
|
|
txtHaveEfcValues[index].text = FormatString.TextEffectValue(item.Key, item.Value, bint : true);
|
|
}
|
|
index++;
|
|
}
|
|
}
|
|
// 팝업에 세팅된 텍스트 수가 데이터 수보다 적을 때 추가 생성.
|
|
else if (datas.Count > txtHaveEfcTitles.Length)
|
|
{
|
|
Transform trfsv = goPopupHaveEfc.transform.Find("Sv").GetChild(0);
|
|
TextMeshProUGUI[] txttitles = txtHaveEfcTitles;
|
|
TextMeshProUGUI[] txtvalues = txtHaveEfcValues;
|
|
txtHaveEfcTitles = new TextMeshProUGUI[datas.Count];
|
|
txtHaveEfcValues = new TextMeshProUGUI[datas.Count];
|
|
|
|
int index = 0;
|
|
foreach (var item in datas)
|
|
{
|
|
// 기존 텍스트 그대로 사용.
|
|
if (index < txttitles.Length)
|
|
{
|
|
txtHaveEfcTitles[index] = txttitles[index];
|
|
txtHaveEfcValues[index] = txtvalues[index];
|
|
}
|
|
// 부족한 텍스트 추가 생성.
|
|
else
|
|
{
|
|
GameObject go = Instantiate(prfHaveEfc, trfsv);
|
|
txtHaveEfcTitles[index] = go.GetComponent<TextMeshProUGUI>();
|
|
txtHaveEfcValues[index] = go.transform.GetChild(0).GetComponent<TextMeshProUGUI>();
|
|
}
|
|
|
|
if (item.Value <= 0L)
|
|
{
|
|
txtHaveEfcTitles[index].gameObject.SetActive(false);
|
|
}
|
|
else
|
|
{
|
|
txtHaveEfcTitles[index].text = FormatString.TextEffectTitle(item.Key);
|
|
txtHaveEfcValues[index].text = FormatString.TextEffectValue(item.Key, item.Value, bint: true);
|
|
txtHaveEfcTitles[index].gameObject.SetActive(true);
|
|
}
|
|
index++;
|
|
}
|
|
}
|
|
// 팝업에 세팅된 텍스트 수가 데이터 수 이하일때.
|
|
else
|
|
{
|
|
int index = 0;
|
|
foreach (var item in datas)
|
|
{
|
|
if (item.Value <= 0L)
|
|
{
|
|
txtHaveEfcTitles[index].gameObject.SetActive(false);
|
|
}
|
|
else
|
|
{
|
|
txtHaveEfcTitles[index].text = FormatString.TextEffectTitle(item.Key);
|
|
txtHaveEfcValues[index].text = FormatString.TextEffectValue(item.Key, item.Value, bint: true);
|
|
txtHaveEfcTitles[index].gameObject.SetActive(true);
|
|
}
|
|
index++;
|
|
}
|
|
|
|
// 남는 항목 비활성화.
|
|
for (; index < txtHaveEfcTitles.Length; index++)
|
|
{
|
|
txtHaveEfcTitles[index].gameObject.SetActive(false);
|
|
}
|
|
}
|
|
txtHaveEfcT.text = strtitle;
|
|
|
|
iPopup++;
|
|
goPopupHaveEfc.SetActive(true);
|
|
if (!canvasPopup.enabled)
|
|
canvasPopup.enabled = true;
|
|
}
|
|
|
|
// 전체 효과 정보 닫기.
|
|
public void ClosePopupHaveEfc()
|
|
{
|
|
SoundMgr.Instance.PlaySfx(SoundName.BtnPress);
|
|
|
|
goPopupHaveEfc.SetActive(false);
|
|
iPopup--;
|
|
if (iPopup <= 0)
|
|
canvasPopup.enabled = false;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 토스트 팝업 열기.
|
|
/// </summary>
|
|
/// <param name="strmsg">내용.</param>
|
|
/// <param name="ftime">표시 시간.</param>
|
|
/// <param name="itype">토스트 위치. 1:Top, 0:Middle, -1:Bottom.</param>
|
|
/// <returns></returns>
|
|
public static void SOpenToast(string strmsg, float ftime = 2f, int itype = 1)
|
|
{
|
|
if (curMgr != null)
|
|
curMgr.OpenToast(strmsg, ftime, itype);
|
|
}
|
|
|
|
private void OpenToast(string strmsg, float ftime = 2f, int itype = 1)
|
|
{
|
|
if (toastTop == null)
|
|
return;
|
|
iPopup++;
|
|
switch (itype)
|
|
{
|
|
case -1:
|
|
toastBottom.Open(strmsg, ftime);
|
|
break;
|
|
case 0:
|
|
toastMiddle.Open(strmsg, ftime);
|
|
break;
|
|
default:
|
|
toastTop.Open(strmsg, ftime);
|
|
break;
|
|
}
|
|
if (!canvasPopup.enabled)
|
|
canvasPopup.enabled = true;
|
|
}
|
|
|
|
// 팝업 닫았을 때.
|
|
public static void SOnClosePopup()
|
|
{
|
|
if (curMgr != null)
|
|
{
|
|
curMgr.iPopup--;
|
|
if (curMgr.iPopup <= 0)
|
|
curMgr.canvasPopup.enabled = false;
|
|
}
|
|
}
|
|
|
|
public static void SOpenToastNotice(string strmsg)
|
|
{
|
|
if (curMgr != null)
|
|
curMgr.OpenToastNotice(strmsg);
|
|
}
|
|
|
|
private void OpenToastNotice(string strmsg)
|
|
{
|
|
if (toastTop == null)
|
|
return;
|
|
iPopup++;
|
|
|
|
toastNotice.ServerNoticeOpen(strmsg);
|
|
|
|
if (!canvasPopup.enabled)
|
|
canvasPopup.enabled = true;
|
|
}
|
|
|
|
public static void CloseToastNotice()
|
|
{
|
|
if (curMgr != null)
|
|
curMgr.toastNotice.ServerNoticeClose();
|
|
}
|
|
|
|
public static void SOpenHelp(string strmsg)
|
|
{
|
|
if (curMgr != null)
|
|
curMgr.OpenHelp(strmsg);
|
|
}
|
|
|
|
private void OpenHelp(string strmsg)
|
|
{
|
|
if (toastTop == null)
|
|
return;
|
|
iPopup++;
|
|
ppHelp.Open(strmsg);
|
|
if (!canvasPopup.enabled)
|
|
canvasPopup.enabled = true;
|
|
}
|
|
|
|
// 팝업 닫았을 때.
|
|
public static void SOnCloseHelp()
|
|
{
|
|
if (curMgr != null)
|
|
{
|
|
curMgr.iPopup--;
|
|
|
|
if (curMgr.iPopup <= 0)
|
|
curMgr.canvasPopup.enabled = false;
|
|
}
|
|
SoundMgr.Instance.PlaySfx(SoundName.BtnPress);
|
|
}
|
|
#endregion Popup
|
|
|
|
#region Popup Exit & Offline
|
|
/// <summary>
|
|
/// 게임 종료 확인 팝업 열기.
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
private void OpenPopupExit()
|
|
{
|
|
if (bInitNeedExit)
|
|
{
|
|
bInitNeedExit = false;
|
|
popupExit.Init();
|
|
}
|
|
|
|
iPopup++;
|
|
CoverCamera.Hold();
|
|
popupExit.Open(LocalizationText.GetText("msg_exit"), SingleMgr.GameFinishSvSave, OnClosePopupExit,
|
|
LocalizationText.GetText(Global.STR_CONFIRM), LocalizationText.GetText("all_quit"), LocalizationText.GetText(Global.STR_CANCEL));
|
|
if (!canvasPopup.enabled)
|
|
canvasPopup.enabled = true;
|
|
|
|
// 애니메이션 로드.
|
|
Addressables.LoadAssetAsync<SkeletonDataAsset>("effect/game_off/game_off_SkeletonData.asset").Completed += ALoadExitComp;
|
|
}
|
|
|
|
private void OnClosePopupExit()
|
|
{
|
|
SkeletonAnimation skanim = popupExit.transform.Find("skanim").GetComponent<SkeletonAnimation>();
|
|
// 애니메이션 언로드.
|
|
if (skanim.skeletonDataAsset != null)
|
|
{
|
|
CoverCamera.Hold();
|
|
skanim.transform.localScale = new Vector3(0.01f, 0.01f, 0.01f);
|
|
skanim.skeletonDataAsset.Clear();
|
|
skanim.ClearState();
|
|
skanim.skeletonDataAsset = null;
|
|
if (handleSkAnim.IsValid())
|
|
Addressables.Release(handleSkAnim);
|
|
AddressableMgr.SAddUnload();
|
|
CoverCamera.Release();
|
|
}
|
|
}
|
|
|
|
// 게임 종료 연출 로드.
|
|
private void ALoadExitComp(AsyncOperationHandle<SkeletonDataAsset> obj)
|
|
{
|
|
SkeletonAnimation skanim = popupExit.transform.Find("skanim").GetComponent<SkeletonAnimation>();
|
|
MeshRenderer renderer = skanim.GetComponent<MeshRenderer>();
|
|
renderer.sortingLayerID = canvasPopup.sortingLayerID;
|
|
renderer.sortingOrder = 201;
|
|
skanim.skeletonDataAsset = obj.Result;
|
|
skanim.Initialize(true);
|
|
skanim.AnimationState.SetAnimation(0, "idle", true);
|
|
skanim.transform.localScale = Vector3.one;
|
|
|
|
handleSkAnim = obj;
|
|
CoverCamera.Release();
|
|
}
|
|
|
|
|
|
public void OpenPopupRefreshTest()
|
|
{
|
|
if (bInitNeedExit)
|
|
{
|
|
bInitNeedExit = false;
|
|
popupExit.Init();
|
|
}
|
|
|
|
iPopup++;
|
|
popupExit.Open(LocalizationText.GetText("test_refresh"), SettingMgr.STestRefreshDate, OnClosePopupExit,
|
|
LocalizationText.GetText(Global.STR_CONFIRM), LocalizationText.GetText("all_quit"), LocalizationText.GetText(Global.STR_CANCEL));
|
|
if (!canvasPopup.enabled)
|
|
canvasPopup.enabled = true;
|
|
|
|
// 애니메이션 로드.
|
|
Addressables.LoadAssetAsync<SkeletonDataAsset>("effect/game_off/game_off_SkeletonData.asset").Completed += ALoadExitComp;
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// 오프라인 팝업 열기.
|
|
/// </summary>
|
|
/// <param name="itimesec">오프라인 시간(초).</param>
|
|
/// <param name="goods">보상 목록.</param>
|
|
/// <returns></returns>
|
|
public static void SOpenPopupOffline(int itimesec, List<nGoods> goods)
|
|
{
|
|
curMgr.OpenPopupOffline(itimesec, goods);
|
|
}
|
|
|
|
private void OpenPopupOffline(int itimesec, List<nGoods> goods)
|
|
{
|
|
SoundMgr.Instance.PlaySfx(SoundName.GetGoods);
|
|
|
|
Transform trfpopup = goPopupOffline.transform;
|
|
trfpopup.Find("txtT").GetComponent<TextMeshProUGUI>().text = LocalizationText.GetText("offline_title");
|
|
if (itimesec > 86400)
|
|
itimesec = 86400;
|
|
trfpopup.Find("txtTime").GetComponent<TextMeshProUGUI>().text = FormatString.TextTime(itimesec);
|
|
trfpopup.Find("txtDesc").GetComponent<TextMeshProUGUI>().text = LocalizationText.GetText("offline_desc");
|
|
trfpopup.Find("btnYes").GetChild(0).GetComponent<TextMeshProUGUI>().text = LocalizationText.GetText(Global.STR_OK);
|
|
|
|
GoodsItem[] goodsitems = trfpopup.Find("wrapper").GetComponentsInChildren<GoodsItem>(true);
|
|
for (int i = 0; i < goodsitems.Length; i++)
|
|
{
|
|
if (i >= goods.Count)
|
|
{
|
|
goodsitems[i].gameObject.SetActive(false);
|
|
continue;
|
|
}
|
|
goodsitems[i].SetData(goods[i]);
|
|
goodsitems[i].gameObject.SetActive(true);
|
|
}
|
|
|
|
iPopup++;
|
|
CoverCamera.Hold();
|
|
goPopupOffline.SetActive(true);
|
|
if (!canvasPopup.enabled)
|
|
canvasPopup.enabled = true;
|
|
|
|
// 애니메이션 로드.
|
|
Addressables.LoadAssetAsync<SkeletonDataAsset>("effect/offline_present/offline_present_SkeletonData.asset").Completed += ALoadOfflineComp;
|
|
}
|
|
|
|
public void ClosePopupOffline()
|
|
{
|
|
SkeletonAnimation skanim = goPopupOffline.transform.Find("skanim").GetComponent<SkeletonAnimation>();
|
|
// 애니메이션 언로드.
|
|
if (skanim.skeletonDataAsset != null)
|
|
{
|
|
CoverCamera.Hold();
|
|
skanim.transform.localScale = new Vector3(0.01f, 0.01f, 0.01f);
|
|
skanim.skeletonDataAsset.Clear();
|
|
skanim.ClearState();
|
|
skanim.skeletonDataAsset = null;
|
|
if (handleSkAnim.IsValid())
|
|
Addressables.Release(handleSkAnim);
|
|
AddressableMgr.SAddUnload();
|
|
CoverCamera.Release();
|
|
}
|
|
|
|
goPopupOffline.SetActive(false);
|
|
SSetPlayerLv();
|
|
iPopup--;
|
|
if (iPopup <= 0)
|
|
canvasPopup.enabled = false;
|
|
|
|
SoundMgr.Instance.PlaySfx(SoundName.BtnPress);
|
|
}
|
|
|
|
// 오프라인 연출 로드.
|
|
private void ALoadOfflineComp(AsyncOperationHandle<SkeletonDataAsset> obj)
|
|
{
|
|
SkeletonAnimation skanim = goPopupOffline.transform.Find("skanim").GetComponent<SkeletonAnimation>();
|
|
MeshRenderer renderer = skanim.GetComponent<MeshRenderer>();
|
|
renderer.sortingLayerID = canvasPopup.sortingLayerID;
|
|
renderer.sortingOrder = 201;
|
|
skanim.skeletonDataAsset = obj.Result;
|
|
skanim.Initialize(true);
|
|
skanim.AnimationState.SetAnimation(0, "idle", true);
|
|
skanim.transform.localScale = Vector3.one;
|
|
|
|
handleSkAnim = obj;
|
|
CoverCamera.Release();
|
|
}
|
|
#endregion Popup Exit & Offline
|
|
|
|
#region General Effect
|
|
/// <summary>
|
|
/// 색상 합성 연출 재생.
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public static void SPlayEfcClrCompose()
|
|
{
|
|
curMgr.skClrCompose.gameObject.SetActive(true);
|
|
curMgr.skClrCompose.AnimationState.SetAnimation(0, "animation", false);
|
|
}
|
|
|
|
public static void SPlayEfcOpenColorBox()
|
|
{
|
|
curMgr.skClrCompose.gameObject.SetActive(true);
|
|
curMgr.skClrCompose.AnimationState.SetAnimation(0, "ColorOpenBox", false);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 색상 합성 연출 정지.
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public static void SStopEfcClrCompose()
|
|
{
|
|
curMgr.skClrCompose.gameObject.SetActive(false);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 좌측 창 강화 이펙트 재생.
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public static void SPlayEfcLeftEnhance()
|
|
{
|
|
curMgr.ptcLeftEnhance.Play();
|
|
}
|
|
#endregion General Effect
|
|
|
|
#region Goods
|
|
public static void SSetGoods()
|
|
{
|
|
if (curMgr == null) return;
|
|
|
|
curMgr.txtMainGold.text = FormatString.BigIntString1(DataHandler.Goods.gold);
|
|
curMgr.txtUpGold.text = curMgr.txtMainGold.text;
|
|
curMgr.leftGold.txt.text = curMgr.txtMainGold.text;
|
|
|
|
curMgr.txtMainDia.text = FormatString.TextInt(DataHandler.Goods.Dia);
|
|
curMgr.txtUpDia.text = curMgr.txtMainDia.text;
|
|
curMgr.leftDia.txt.text = curMgr.txtMainDia.text;
|
|
|
|
curMgr.txtUpMileage.text = FormatString.TextInt(DataHandler.Goods.mileage);
|
|
|
|
curMgr.txtUpReinStone.text = FormatString.TextInt(DataHandler.Goods.gearReinStone);
|
|
curMgr.leftReinStone.txt.text = curMgr.txtUpReinStone.text;
|
|
|
|
curMgr.txtUpSkillStone.text = FormatString.TextInt(DataHandler.Goods.skillReinStone);
|
|
curMgr.leftSkillStone.txt.text = curMgr.txtUpSkillStone.text;
|
|
|
|
curMgr.txtUpAwakenStone.text = FormatString.TextInt(DataHandler.Goods.gearAwakenStone);
|
|
curMgr.leftAwakenStone.txt.text = curMgr.txtUpAwakenStone.text;
|
|
|
|
curMgr.txtUpAwakenSkillStone.text = FormatString.TextInt(DataHandler.Goods.skillAwakenStone);
|
|
curMgr.leftAwakenSkillStone.txt.text = curMgr.txtUpAwakenSkillStone.text;
|
|
|
|
curMgr.leftChangeStone.txt.text = FormatString.TextInt(DataHandler.Goods.changeStone);
|
|
|
|
curMgr.leftPudding.txt.text = FormatString.TextInt(DataHandler.Goods.pudding);
|
|
|
|
curMgr.txtUpLvPoint.text = FormatString.TextInt(DataHandler.Goods.point);
|
|
curMgr.leftLvPoint.txt.text = curMgr.txtUpLvPoint.text;
|
|
|
|
RefreshDeepCaveDungeonTicket();
|
|
RefreshAtlantisDungeonTicket();
|
|
RefreshProtectTheMerchantDgTicket();
|
|
RefreshDevelopTheJungleDgTicket();
|
|
RefreshHuntEagleDgTicket();
|
|
|
|
curMgr.leftMaskEnhance.txt.text = FormatString.TextInt(DataHandler.Goods.condMight);
|
|
|
|
RefreshFantasyWorldRing();
|
|
RefreshMemoryPiece();
|
|
}
|
|
|
|
public static void SSetGold(BigInteger value)
|
|
{
|
|
if (curMgr == null) return;
|
|
curMgr.txtMainGold.text = FormatString.BigIntString1(value);
|
|
curMgr.txtUpGold.text = curMgr.txtMainGold.text;
|
|
curMgr.leftGold.txt.text = curMgr.txtMainGold.text;
|
|
}
|
|
|
|
public static void SSetDia(int value)
|
|
{
|
|
if (curMgr == null) return;
|
|
curMgr.txtMainDia.text = FormatString.TextInt(value);
|
|
curMgr.txtUpDia.text = curMgr.txtMainDia.text;
|
|
curMgr.leftDia.txt.text = curMgr.txtMainDia.text;
|
|
}
|
|
|
|
public static void SSetLvPoint(int value)
|
|
{
|
|
if (curMgr == null) return;
|
|
curMgr.txtUpLvPoint.text = FormatString.TextInt(value);
|
|
curMgr.leftLvPoint.txt.text = curMgr.txtUpLvPoint.text;
|
|
}
|
|
|
|
public static void SSetEnhanceStone(int value)
|
|
{
|
|
if (curMgr == null) return;
|
|
curMgr.txtUpReinStone.text = FormatString.TextInt(value);
|
|
curMgr.leftReinStone.txt.text = curMgr.txtUpReinStone.text;
|
|
}
|
|
|
|
public static void SSetSkillStone(int value)
|
|
{
|
|
if (curMgr == null) return;
|
|
curMgr.txtUpSkillStone.text = FormatString.TextInt(value);
|
|
curMgr.leftSkillStone.txt.text = curMgr.txtUpSkillStone.text;
|
|
}
|
|
|
|
public static void SSetAwakenStone(int value)
|
|
{
|
|
if (curMgr == null) return;
|
|
curMgr.txtUpAwakenStone.text = FormatString.TextInt(value);
|
|
curMgr.leftAwakenStone.txt.text = curMgr.txtUpAwakenStone.text;
|
|
}
|
|
|
|
public static void SSetAwakenSkillStone(int value)
|
|
{
|
|
if (curMgr == null) return;
|
|
curMgr.txtUpAwakenSkillStone.text = FormatString.TextInt(value);
|
|
curMgr.leftAwakenSkillStone.txt.text = curMgr.txtUpAwakenSkillStone.text;
|
|
}
|
|
|
|
public static void SSetChangeStone(int value)
|
|
{
|
|
if (curMgr == null) return;
|
|
curMgr.leftChangeStone.txt.text = FormatString.TextInt(value);
|
|
}
|
|
|
|
public static void SSetPudding(int value)
|
|
{
|
|
if (curMgr == null) return;
|
|
curMgr.leftPudding.txt.text = FormatString.TextInt(value);
|
|
}
|
|
|
|
public static void SSetGachaTokenType(int icode)
|
|
{
|
|
if (curMgr == null) return;
|
|
curMgr.imgUpGachaTicket.sprite = AddressableMgr.GetGoodsIcon(icode);
|
|
}
|
|
|
|
public static void SSetGachaToken(int value)
|
|
{
|
|
if (curMgr == null) return;
|
|
curMgr.txtUpGachaToken.text = FormatString.TextInt(value);
|
|
}
|
|
|
|
public static void SSetPvpTicket(int value)
|
|
{
|
|
curMgr.txtUpPvpTicket.text = FormatString.TextInt(value);
|
|
}
|
|
|
|
public static void RefreshDeepCaveDungeonTicket()
|
|
{
|
|
if (GameModDataGroup.Instance.TryGetModData(DeepCaveDungeonProperty.CodeName, out DeepCaveDungeonData modData))
|
|
curMgr.leftDeepCaveDgTicket.txt.text = FormatString.TextInt(modData.EnterTicketCount);
|
|
}
|
|
|
|
public static void RefreshAtlantisDungeonTicket()
|
|
{
|
|
if (GameModDataGroup.Instance.TryGetModData(AtlantisDungeonProperty.CodeName, out AtlantisDungeonData modData))
|
|
curMgr.leftAtlantisDgTicket.txt.text = FormatString.TextInt(modData.EnterTicketCount);
|
|
}
|
|
|
|
public static void RefreshProtectTheMerchantDgTicket()
|
|
{
|
|
if (GameModDataGroup.Instance.TryGetModData(ProtectTheMerchantDgProp.CodeName, out ProtectTheMerchantDgData modData))
|
|
curMgr.leftProtectTheMerchantDgTicket.txt.text = FormatString.TextInt(modData.EnterTicketCount);
|
|
}
|
|
|
|
public static void RefreshDevelopTheJungleDgTicket()
|
|
{
|
|
if (GameModDataGroup.Instance.TryGetModData(DevelopTheJungleDgProp.CodeName, out DevelopTheJungleDgData modData))
|
|
curMgr.leftDevelopTheJungleDgTicket.txt.text = FormatString.TextInt(modData.EnterTicketCount);
|
|
}
|
|
|
|
public static void RefreshHuntEagleDgTicket()
|
|
{
|
|
if (GameModDataGroup.Instance.TryGetModData(HuntEagleDgProp.CodeName, out HuntEagleDgData modData))
|
|
curMgr.leftHuntEagleDgKey.txt.text = FormatString.TextInt(modData.EnterTicketCount);
|
|
}
|
|
|
|
public static void RefreshFantasyWorldRing()
|
|
{
|
|
curMgr.leftFantasyWorldRing.txt.text = FormatString.TextInt(DataHandler.Goods.fantasyWorldRing);
|
|
}
|
|
|
|
public static void RefreshMemoryPiece()
|
|
{
|
|
curMgr.leftMemoryPiece.txt.text = FormatString.TextInt(DataHandler.Goods.memoryPiece);
|
|
}
|
|
#endregion Goods
|
|
|
|
#region HotTimeUIOnOff
|
|
public static void HotTimeUIOnOff(bool isOn)
|
|
{
|
|
curMgr.hotTimeActive.SetActive(isOn);
|
|
curMgr.txtTimer.gameObject.SetActive(isOn);
|
|
}
|
|
|
|
public static void HotTimerSetting(string timer)
|
|
{
|
|
curMgr.txtTimer.text = timer;
|
|
}
|
|
#endregion
|
|
|
|
#region Test Log
|
|
[SerializeField]
|
|
private TextMeshProUGUI txtTestLog;
|
|
|
|
public static void SPrintTestLog(string strlog)
|
|
{
|
|
if (curMgr != null)
|
|
curMgr.txtTestLog.text = FormatString.CombineStringWithBreakLine(curMgr.txtTestLog.text, strlog);
|
|
Logger.Log(strlog);
|
|
}
|
|
#endregion Test Log
|
|
|
|
public void moveContent(int inum)
|
|
{
|
|
SoundMgr.Instance.PlaySfx(SoundName.BtnPress);
|
|
SingleMgr.MoveContent((eEventMoveType)inum);
|
|
}
|
|
|
|
public void forceEscape()
|
|
{
|
|
if (CoverCamera.IsOn())
|
|
return;
|
|
if (canvasFullBlack.enabled)
|
|
return;
|
|
fBackTick = 0.15f;
|
|
|
|
#region Popup
|
|
// 1버튼 팝업.
|
|
for (int i = pp1Buttons.Length - 1; i >= 0; i--)
|
|
{
|
|
if (pp1Buttons[i].IsOpen())
|
|
{
|
|
pp1Buttons[i].BtnYesPressed();
|
|
return;
|
|
}
|
|
}
|
|
|
|
// 2버튼 팝업.
|
|
for (int i = pp2Buttons.Length - 1; i >= 0; i--)
|
|
{
|
|
if (pp2Buttons[i].IsOpen())
|
|
{
|
|
pp2Buttons[i].BtnNoPressed();
|
|
return;
|
|
}
|
|
}
|
|
|
|
// 재화 획득 팝업.
|
|
if (ppGoods.IsOpen())
|
|
{
|
|
ppGoods.BtnYesPressed();
|
|
return;
|
|
}
|
|
|
|
// 프리셋 팝업.
|
|
if (ppPreset.IsOpen())
|
|
{
|
|
ppPreset.BtnNoPressed();
|
|
return;
|
|
}
|
|
|
|
// 아이템 사용 팝업.
|
|
if (ppItemUse.IsOpen())
|
|
{
|
|
ppItemUse.BtnNoPressed();
|
|
return;
|
|
}
|
|
|
|
// 아이템 사용-획득 팝업.
|
|
if (ppItemUseTo.IsOpen())
|
|
{
|
|
ppItemUseTo.BtnNoPressed();
|
|
return;
|
|
}
|
|
|
|
// 아이템들 사용 팝업.
|
|
if (ppItemsUseTo.IsOpen())
|
|
{
|
|
ppItemsUseTo.BtnNoPressed();
|
|
return;
|
|
}
|
|
|
|
// 아이템 구매 팝업.
|
|
if (ppItemBuy.IsOpen())
|
|
{
|
|
ppItemBuy.BtnNoPressed();
|
|
return;
|
|
}
|
|
|
|
// 아이템 수량 구매 팝업.
|
|
if (ppItemBuyCount.IsOpen())
|
|
{
|
|
ppItemBuyCount.BtnNoPressed();
|
|
return;
|
|
}
|
|
|
|
// 희귀도 선택 팝업.
|
|
if (ppRarityCheck.IsOpen())
|
|
{
|
|
ppRarityCheck.BtnNoPressed();
|
|
return;
|
|
}
|
|
|
|
// 희귀도별 확률 팝업.
|
|
if (goPopupRate.activeSelf)
|
|
{
|
|
ClosePopupRarityRate();
|
|
return;
|
|
}
|
|
|
|
// 전체 보유 효과 팝업.
|
|
if (goPopupHaveEfc.activeSelf)
|
|
{
|
|
ClosePopupHaveEfc();
|
|
return;
|
|
}
|
|
|
|
// 오프라인 팝업.
|
|
if (goPopupOffline.activeSelf)
|
|
{
|
|
ClosePopupOffline();
|
|
return;
|
|
}
|
|
|
|
// 게임 종료 팝업.
|
|
if (popupExit.IsOpen())
|
|
{
|
|
popupExit.BtnNoPressed();
|
|
return;
|
|
}
|
|
#endregion Popup
|
|
|
|
#region 중앙 팝업 컨텐츠
|
|
// 우편.
|
|
if (MailMgr.SCloseMenu())
|
|
return;
|
|
// 이벤트 & 공지.
|
|
if (NoticeMgr.SCloseMenu())
|
|
return;
|
|
//출석
|
|
if (AttendMgr.SCloseMenu())
|
|
return;
|
|
#endregion 중앙 팝업 컨텐츠
|
|
|
|
#region 전체 화면 컨텐츠
|
|
// 결투장.
|
|
if (PvpMgr.SCloseMenu())
|
|
return;
|
|
// 패스.
|
|
if (PassMgr.SCloseMenu())
|
|
return;
|
|
// 상점.
|
|
if (ShopMgr.SCloseMenu())
|
|
return;
|
|
// 코스튬.
|
|
if (CustomizeMgr.SCloseMenu())
|
|
return;
|
|
// 소환.
|
|
if (GachaMgr.SCloseMenu())
|
|
return;
|
|
#endregion 전체 화면 컨텐츠
|
|
|
|
#region 좌우 분할 컨텐츠
|
|
// 강화
|
|
if (EnhanceMgr.SCloseMenu())
|
|
return;
|
|
// 펫.
|
|
if (PetMgr.SCloseMenu())
|
|
return;
|
|
// 스킬.
|
|
if (SkillMgr.SCloseMenu())
|
|
return;
|
|
// 가방.
|
|
if (BagMgr.SCloseMenu())
|
|
return;
|
|
|
|
// 스테이지.
|
|
if (StageMgr.SCloseMenu())
|
|
return;
|
|
//던전
|
|
if (DungeonMgr.SCloseMenu())
|
|
return;
|
|
// 채팅.
|
|
if (ChatMgr.SCloseMenu())
|
|
return;
|
|
// 프로필
|
|
if (ProfileMgr.SCloseProfile())
|
|
return;
|
|
//이벤트
|
|
if (EventMgr.SCloseMenu())
|
|
return;
|
|
// 설정.
|
|
if (SettingMgr.SCloseMenu())
|
|
return;
|
|
#endregion 좌우 분할 컨텐츠
|
|
|
|
if (DispatchMgr.Instance.DispatchView.viewState != ViewState.Hidden)
|
|
{
|
|
DispatchMgr.Instance.DispatchView.Hide();
|
|
return;
|
|
}
|
|
|
|
if (canvasMenu.enabled)
|
|
{
|
|
CloseMenu();
|
|
return;
|
|
}
|
|
}
|
|
|
|
public static void SOnOffDungeonButton(bool onoff)
|
|
{
|
|
curMgr.btnRetry.SetActive(onoff);
|
|
curMgr.imgMenuPanel.SetActive(onoff);
|
|
curMgr.btnMenu.SetActive(onoff);
|
|
curMgr.btnShop.SetActive(onoff);
|
|
curMgr.btnPass.SetActive(onoff);
|
|
curMgr.btnEvent.SetActive(onoff);
|
|
curMgr.hotTimePanel.SetActive(onoff);
|
|
|
|
#if false //TODO: block open event open button
|
|
if (DataHandler.GetPlayRewardEvent().sid < 1)
|
|
{
|
|
curMgr.btnOpenOpenRewardEvent.SetActive(onoff);
|
|
}
|
|
#else
|
|
curMgr.btnOpenOpenRewardEvent.gameObject.SetActive(false);
|
|
#endif
|
|
|
|
curMgr.dungeonButton.interactable = onoff;
|
|
|
|
for (int i = 0; i < curMgr.skillPreset.Length; i++)
|
|
{
|
|
if (DataHandler.PlayData.usePreset != i)
|
|
{
|
|
curMgr.skillPreset[i].SetActive(!onoff);
|
|
}
|
|
}
|
|
}
|
|
|
|
public static void SAllOffDownMenu()
|
|
{
|
|
EnhanceMgr.CloseEnhance();
|
|
}
|
|
|
|
public static void SRightWindowClose()
|
|
{
|
|
StageMgr.SCloseMenu();
|
|
SettingMgr.SCloseMenu();
|
|
EventMgr.SCloseMenu();
|
|
TreasureMgr.SCloseMenu();
|
|
}
|
|
}
|