Beispiel #1
0
 private void show(bool isAddSql)
 {
     if (mImage == null)
     {
         mImage = GetComponent <Image>();
         mBt    = GetComponent <Button>();
         mBt.onClick.AddListener(() =>
         {
             onclick();
         });
     }
     transform.localScale = new Vector2(1, 1);
     if (mBean.buttonType == ACTIVE_BUTTON_TYPE_AD)
     {
         mImage.sprite = Resources.Load("UI_yellow/guanggao/02", typeof(Sprite)) as Sprite;
         AdIntance.getIntance().setType(mBean.adType);
     }
     else if (mBean.buttonType == ACTIVE_BUTTON_TYPE_VOCATION)
     {
         mImage.sprite = Resources.Load("UI_yellow/zhuanzhi/06", typeof(Sprite)) as Sprite;
     }
     if (isAddSql)
     {
         updateSql(UPDATE_SHOW_SHOW);
     }
 }
Beispiel #2
0
    public bool init(long type, long adId, bool isAddSql)
    {
        if (type == mBean.buttonType)
        {
            return(true);

            /*           if (mBean.buttonType == ACTIVE_BUTTON_TYPE_VOCATION)
             *         {
             *             return true;
             *         }
             *         else {
             *             mBean.adType = adId;
             *             mBean.count = count;
             *             if (isAddSql)
             *             {
             *                 updateSql(UPDATE_SHOW_UPDATE);
             *             }
             *             return true;
             *         }       */
        }
        if (mBean.buttonType != -1)
        {
            return(false);
        }
        float time = AdIntance.getIntance().getTime();

        //  if (time == -1 && mBean.buttonType == ACTIVE_BUTTON_TYPE_AD) {
        //      time = 0;
        //  }
        mTime            = 0;
        mBean.adType     = adId;
        mBean.buttonType = type;
        show(isAddSql);
        return(true);
    }
Beispiel #3
0
    private void Update()
    {
        //    Debug.Log("==================ActiveButtonControl Update  mTime=  " + mTime + " mShowTime=" + mShowTime);
        if (mTime == -1 || mBean.buttonType != ACTIVE_BUTTON_TYPE_AD)
        {
            return;
        }
        if (mShowTime == -1)
        {
            mShowTime = JsonUtils.getIntance().getConfigValueForId(100050) * 60;
        }

        mTime += Time.deltaTime;


        AdIntance.getIntance().setTime(mTime);

        if (mTime > mShowTime)
        {
            GameObject.Find("active_button_list").GetComponent <ActiveListControl>().removeAd();
        }
    }
Beispiel #4
0
 public void removeShowTime()
 {
     mTime = -1;
     AdIntance.getIntance().setTime(mTime);
     AdIntance.getIntance().setType(-1);
 }