Beispiel #1
0
    protected override void OnEnable()
    {
        base.OnEnable();
        if (m_args == null)
        {
            return;
        }

        _imgFadeInOut.color = Color.black;
        _imgFadeInOut.gameObject.SetActive(true);
        _ProgressBar.gameObject.SetActive(true);
        _ProgressBar.Reset();

        if ((SCENEIDs)m_args[0] == SCENEIDs.LobbyToGame)
        {
            _ProgressBar.SetFillAmount(0.03f);
            _ProgressBar.AutoAddGague(10f, null);
            PK.GamesInfo.REData info = USER.I.GetGameListInfo((int)m_args[1]);

            _GameKind   = (eGameList)m_args[1];
            _bundleName = DEF.GetGameBundleName(_GameKind);

            // gamecommon 번들에 넣어둔 이미지 로딩
            Sprite spr = DEF.GetGameLoadingImage(_GameKind);
            if (spr != null)
            {
                _imgTitle.texture = spr.texture;
                _imgFadeInOut.DOFade(0, 0.3f).OnComplete(OnFadeComplete);
            }
            else  // 혹시나 로딩 실패하면 기존 웹다운방식
            {
                DB.I.WebDownloadImage(info.loading_image, (x) =>
                {
                    _imgTitle.texture = x;
                    _imgFadeInOut.DOFade(0, 0.3f).OnComplete(OnFadeComplete);
                });
            }
        }
        else
        {
            Close("cancel");
        }
    }