示例#1
0
    public void LoadBundle()
    {
#if UNITY_EDITOR
        SOUND.I.LoadLocalDirectoryAudioClipsPackage("Lobby/", "Sounds", (x) => {
            if (!SOUND.I.IsPlay(DEF.SND.lobby_bgm))
            {
                SOUND.I.Play(DEF.SND.lobby_bgm, true);
            }
        });
#else
        SOUND.I.LoadAssetBundleAudioClipsPackage(DEF.GetLobbyBundleName());
        if (!SOUND.I.IsPlay(DEF.SND.lobby_bgm))
        {
            SOUND.I.Play(DEF.SND.lobby_bgm, true);
        }
#endif
        // 고정적인 빌드에 포함되는 리소스
        Popup = CreateUIPrefab <PopupUI>(thisTrans, "Popup_UI");
        Popup.GetComponent <UnityEngine.UI.CanvasScaler>().matchWidthOrHeight = Main.I.GetMatchWidthOrHeight();
        Popup.Initialize();

        // 가변적으로 필요시 번들및 빌드에서 처리할 리소스들
        UIGameLoadingPage = CreateUIPrefab <GameLoadingPage>(thisTrans, "GameLoadingPage");
        UIGameLoadingPage.GetComponent <UnityEngine.UI.CanvasScaler>().matchWidthOrHeight = Main.I.GetMatchWidthOrHeight();

        Gift = CreateUIPrefab <UIPopGift>(thisTrans, "Gift");
        Gift.GetComponent <UnityEngine.UI.CanvasScaler>().matchWidthOrHeight = Main.I.GetMatchWidthOrHeight();
        Gift.gameObject.SetActive(false);

        Tournaments = CreateUIPrefab <TournamentsUI>(thisTrans, "Tournaments_UI");
        Tournaments.GetComponent <UnityEngine.UI.CanvasScaler>().matchWidthOrHeight = Main.I.GetMatchWidthOrHeight();
        Tournaments.gameObject.SetActive(false);

        BroadCast = CreateUIPrefab <BroadCastUI>(thisTrans, "BroadCast_UI");
        BroadCast.GetComponent <UnityEngine.UI.CanvasScaler>().matchWidthOrHeight = Main.I.GetMatchWidthOrHeight();
        BroadCast.gameObject.SetActive(true);

        Coins = CreateUIPrefab <CoinsUI>(thisTrans, "Coins_UI");
        Coins.GetComponent <UnityEngine.UI.CanvasScaler>().matchWidthOrHeight = Main.I.GetMatchWidthOrHeight();
        Coins.gameObject.SetActive(true);
        Coins.Initialize();

        Game = CreateUIPrefab <GameUI>(thisTrans, "Game_UI");
        Game.GetComponent <UnityEngine.UI.CanvasScaler>().matchWidthOrHeight = Main.I.GetMatchWidthOrHeight();

        GuestGuide = CreateUIPrefab <UIPopGuestGuide>(thisTrans, "GuestGuide");
        GuestGuide.GetComponent <UnityEngine.UI.CanvasScaler>().matchWidthOrHeight = Main.I.GetMatchWidthOrHeight();

        PayTable = CreateUIPrefab <PayTableUI>(thisTrans, "PayTable_UI");
        PayTable.GetComponent <UnityEngine.UI.CanvasScaler>().matchWidthOrHeight = Main.I.GetMatchWidthOrHeight();

        if (eTutorial.on == CONFIG.CurrentTutorial)
        {
            Tutorial = CreateUIPrefab <UITutorial>(thisTrans, "Tutorial_UI");
        }
    }
 public void FindTheScript()
 {
     MyCoinsUiScript = GameObject.FindGameObjectWithTag("CoinsManager").GetComponent <CoinsUI>();
 }