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 btnDungeonOut; private GameObject btnOpenOpenRewardEvent; private TextMeshProUGUI txtRewardEvent; private GameObject mainLeftBottomSet; private GameObject hotTimePanel; private GameObject hotTimeActive; private TextMeshProUGUI txtTimer; private GameObject mainRightBottomSet; private Toggle toggleDungeonAuto; private TextMeshProUGUI txtCheckBox; private GameObject mainBottomSet; private Button dungeonButton; [SerializeField] private Canvas canvasMenu; Image imgPvp; GameObject imgPvpLock; #endregion #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; private GameObject goLeftGold; private GameObject goLeftLvPoint; private GameObject goLeftReinStone; private GameObject goLeftSkillStone; private GameObject goLeftAwakenStone; private GameObject goLeftAwakenSkillStone; private GameObject goLeftChangeStone; private GameObject goLeftPudding; private GameObject goLeftDia; private GameObject goLeftDgGoldTicket; private GameObject goLeftDgEnhanceTicket; private GameObject goLeftDgPetTicket; private GameObject goLeftDgAwakenTicket; private GameObject goLeftDgRelicTicket; private GameObject goLeftMaskEnhance; private TextMeshProUGUI txtLeftGold; private TextMeshProUGUI txtLeftLvPoint; private TextMeshProUGUI txtLeftReinStone; private TextMeshProUGUI txtLeftSkillStone; private TextMeshProUGUI txtLeftAwakenStone; private TextMeshProUGUI txtLeftAwakenSkillStone; private TextMeshProUGUI txtLeftChangeStone; private TextMeshProUGUI txtLeftPudding; private TextMeshProUGUI txtLeftDia; private TextMeshProUGUI txtLeftDgGoldTicket; private TextMeshProUGUI txtLeftDgEnhanceTicket; private TextMeshProUGUI txtLeftDgPetTicket; private TextMeshProUGUI txtLeftDgAwakenTicket; private TextMeshProUGUI txtLeftDgRelicTicket; private TextMeshProUGUI txtLeftMaskEnhance; #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 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 private float fBackTick = 1f; private int iPopup = 0; private bool bChangingBgm = false; private TweenerCore twcBgmName = null; #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 { txtCheckBox.text = LocalizationText.GetText("auto_progress"); 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(); txtBgmName = cvBgmName.transform.Find("txtBgmName").GetComponent(); 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(); txtEventButton.text = LocalizationText.GetText("event_title"); btnDungeonOut = mainRightTopSet.transform.Find("btnDungeonOut").gameObject; dungeonButton = mainLeftBottomSet.transform.Find("BtnDungeon").GetComponent