public void Init(TabSelectAnimBtnData tabData, System.Action <string, bool> onValueChange)
    {
        _data          = tabData;
        _onValueChange = onValueChange;

        if (_countDown != null)
        {
            ClientTimer.Instance.RemoveCountDown(_countDown);
            _countDown = null;
        }
        if (_data.endTime != 0)
        {
            _openObj.Show();
            long endTime = _data.endTime;
            //long endTime = ClientTimer.Instance.GetCurrentTimeStamp() + 5000000;
            _countDown = ClientTimer.Instance.AddCountDown("TabSelectAnimBtnItem_" + _data.path, endTime, 1, onCountdown, onCountdownFinish);
        }
        else
        {
            _openObj.Hide();
        }

        _lockObj.SetActive(_data.lockState);

        if (_data.lockState)
        {
            _tabBtn.interactable = false;
            UIEventListener.Get(_tabBtn.gameObject).onClick = OnLockClick;
        }
    }
Beispiel #2
0
    private void InitTabBtnBarData()
    {
        List <TabSelectAnimBtnData> list = new List <TabSelectAnimBtnData>();
        TabSelectAnimBtnData        data = new TabSelectAnimBtnData();

        data.path        = LIMIT_UI_0;
        data.isAlwayShow = true;
        data.lockState   = true;
        list.Add(data);

        data             = new TabSelectAnimBtnData();
        data.path        = GOLD_UI;
        data.isAlwayShow = true;
        list.Add(data);

        data             = new TabSelectAnimBtnData();
        data.path        = GEM_UI;
        data.isAlwayShow = true;
        list.Add(data);

        data             = new TabSelectAnimBtnData();
        data.path        = ACTIVITY_UI;
        data.isAlwayShow = false;
        data.startTime   = GlobalData.ConfigModel.GetGameTimeConfigByKey(GameConfigKey.DRAW_ACTIVITY_START_TIME);
        data.endTime     = GlobalData.ConfigModel.GetGameTimeConfigByKey(GameConfigKey.DRAW_ACTIVITY_END_TIME);
        //Debug.LogWarning("drawCard endTime:"+ GlobalData.ConfigModel.GetGameTimeConfigByKey(GameConfigKey.DRAW_ACTIVITY_END_TIME));
        list.Add(data);

        data             = new TabSelectAnimBtnData();
        data.path        = LIMIT_UI;
        data.isAlwayShow = true;
        data.lockState   = true;
        list.Add(data);

        _tabBtnBar.SetData(list);
    }