Exemplo n.º 1
0
    public void Init()
    {
        UI.SetWaitLoading(false);

        objCanvasGame.GetComponent <Canvas>().worldCamera = Main.I.MainCamera;
        objCanvasGame.GetComponent <CanvasScaler>().matchWidthOrHeight = Main.I.GetMatchWidthOrHeight();

        PK.GamesInfo.REData info = USER.I.GetGameListInfo((int)gameId);
        if (info != null)
        {
            ServerURL = info.connection_url;
            // 페이 테이블 정보 페이지 스프라이트 세팅
            UI.PayTable.SetPageSprite(_spritePayTable);
            objCanvasGame.SendMessage("StartGameInitialize");
        }
        else
        {
            Debug.LogError("InGame::Init - Not GameID:" + gameId);
        }

#if UNITY_EDITOR
        this.gameObject.AddComponent <TestNetwork>();
        //Edit - Project Setting - Quality
        // 로 가서 vSync Count 란을 Don't Sync로 셋팅하면 코드에서 셋팅한 프레임으로 동작
        QualitySettings.vSyncCount  = 0;
        Application.targetFrameRate = test_FrameRate;
        SOUND.I.SetSoundOn(test_soundOn);
#endif
    }
Exemplo n.º 2
0
    // 아이템 활성화시 첫 구성에 필요한 작업을 한다.
    public void ClacJackpotPool()
    {
        saveJackpot = 0;

        if (_Info != null && this.gameObject.activeSelf)
        {
            // 리스트뷰에서 일정시간에 게임 리스트를 요청했을거다..
            // 갱신 타임에 한번씩 잭팟정보를 확인한다.
            _Info = USER.I.GetGameListInfo(_Info.game_id);
            if (_Info != null)
            {
                if (_Info.jackpot_pool > 0)
                {
                    textJackpot.gameObject.SetActive(true);
                    // 1/10 뺀금액을 시작금액으로 일정횟수만큼 갱신효과를 위해
                    // 차액이 1/10억보다 부족할경우 처리필요
                    long temp = _Info.jackpot_pool / 10;                            // 1000000000;
                    saveJackpot = _Info.jackpot_pool - textJackpot.GetCurBalance(); // 현재 잭팟의 차액
                    if (saveJackpot > temp)
                    {
                        saveJackpot = temp;                      // 차액이 크다면 기본 1/10억으로 맞춘다.
                    }
                    textJackpot.SetBalance(_Info.jackpot_pool - saveJackpot);
                }
                else
                {
                    textJackpot.gameObject.SetActive(false);
                }
            }
        }
        else
        {
            textJackpot.gameObject.SetActive(false);
        }
    }
Exemplo n.º 3
0
    // 리스트 공백용 or 게임 리소스 준비안될때
    public void InitDefault()
    {
        _Info                = null;
        _id                  = 0;
        _url                 = "";
        _bundleName          = "";
        this.gameObject.name = "none";
        callbackSelected     = null;

        if (imgBody != null)
        {
            Destroy(imgBody.gameObject);
            imgBody = null;
        }
        if (effect != null)
        {
            Destroy(effect.gameObject);
            effect = null;
        }

        this.gameObject.SetActive(true);
        saveJackpot = 0;
        textJackpot.gameObject.SetActive(false);
        imgComingSoon.gameObject.SetActive(false);
        imgBody = CreateUIPrefab <Image>(this.GetComponent <RectTransform>(), "CabinetBody");
        imgBody.transform.SetSiblingIndex(0);

        SetState(eState.None);
    }
Exemplo n.º 4
0
    // 이 케비넷 아이템은 재활용되므로 초기화시 기존 프리팹 생성들은 제거해야 한다.
    public void Init(PK.GamesInfo.REData info, System.Action <int> callback)
    {
        if (imgBody != null)
        {
            Destroy(imgBody.gameObject);
            imgBody = null;
        }
        if (effect != null)
        {
            Destroy(effect.gameObject);
            effect = null;
        }
        this.gameObject.name = info.game_id.ToString();

        this.gameObject.SetActive(true);

        imgBody = CreateUIPrefab <Image>(this.GetComponent <RectTransform>(), "CabinetBody_" + info.game_id.ToString());
        if (imgBody != null)
        {
            _Info            = info;
            callbackSelected = callback;
            _id  = info.game_id;
            _url = info.icon;

            curUpdateTime = SYSTIMER.GetCurTime();

            ClacJackpotPool();

            imgBody.transform.SetSiblingIndex(0);
            effect = CreateUIPrefab <CabinetEffect>(this.GetComponent <RectTransform>(), "CabinetEffect_" + _id.ToString());
            if (effect != null)
            {
                effect.transform.SetSiblingIndex(1);
                effect.GetComponent <RectTransform>().anchoredPosition = new Vector2(-117.8f, -40.9f);
                effect.enabled = false;
            }

            OnEnable();
            SetTag(_Info.tag);
        }
        else
        {
            InitDefault();
        }
    }
Exemplo n.º 5
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");
        }
    }
Exemplo n.º 6
0
    /// <summary>
    /// 설치가 가능한 게임 리스트
    /// </summary>
    static public bool IsUseGameID(eGameList id)
    {
        PK.GamesInfo.REData data = USER.I.GetGameListInfo((int)id);
        if (data != null)
        {
            return(true);
        }
        return(false);

        /*
         * switch (id)
         * {
         *  case eGameList.emeraldSevens:
         *  case eGameList.HighDiamonds:
         *  case eGameList.HotLotto:
         *  case eGameList.flyingPiggy:
         *  case eGameList.DoubleLuck:
         *  case eGameList.DoubleJackpot7s:
         *      return true;
         * }
         * return false;
         */
    }