コード例 #1
0
    //광고 관련 UI 설정
    void Set_AdUI()
    {
        if (TimeManager.Instance.Get_nowTime() < _user.User_Ads.AdTm)
        {
            Activate_AdstateObj(AdIconState.Wait);
            //text_FreeGemLeftTime.gameObject.SetActive(true);
            if (!Dic_routine.ContainsKey("FreeGem"))
            {
                Coroutine _routine = StartCoroutine(routine_FreeGemLeftTime());
                Dic_routine["FreeGem"] = _routine;
            }

            //text_FreeGemLeftTime.text = string.Format("{0}:{1}", span.Minutes, span.Seconds);
        }
        else
        {
            //다음 광고 상태오브젝트 표시
            Dictionary <ushort, Infos_AdReward> adReward = TableDataManager.instance.Infos_AdRewards;
            adRewardItem = _user.User_Ads.RwdItTp;
            AdIconState _adIcnState = AdIconState.NONE;
            ushort      All_ItemNum = (ushort)(_user.Get_allWeaponCount() + _user.Get_allDecoCount());

            //아이템 갯수별 보상아이템갯수
            int rwdCount = TableDataManager.instance.Get_AdsRwdNum(All_ItemNum, adRewardItem);


            //상태값 저장
            switch (adRewardItem)
            {
            case ITEMTYPE.GEM: _adIcnState = AdIconState.Gem;
                Lst_textAdicon[((int)_adIcnState) - 1].text = string.Format("x{0}", rwdCount);
                break;

            case ITEMTYPE.GOLD: _adIcnState = AdIconState.Gold;
                Lst_textAdicon[((int)_adIcnState) - 1].text = string.Format("x{0}", rwdCount);
                break;

            case ITEMTYPE.ROULETTE: _adIcnState = AdIconState.Roulette; break;

            default: _adIcnState = AdIconState.Roulette; break;
            }



            Activate_AdstateObj(_adIcnState);
            //text_FreeGemLeftTime.gameObject.SetActive(false);

            //보상광고로드 하기
            //AdsManager.instance.Reuest_Ads(Ads_TYPE.Reward);
        }
    }
コード例 #2
0
 void Activate_AdstateObj(AdIconState activeState)
 {
     for (int i = 0; i < Lst_AdStateOBJ.Count; i++)
     {
         if (i == (int)activeState)
         {
             Lst_AdStateOBJ[i].SetActive(true);
         }
         else
         {
             Lst_AdStateOBJ[i].SetActive(false);
         }
     }
 }