Пример #1
0
    public bool HaveCanReadStory()
    {
        bool state       = false;
        long curTime     = ClientTimer.Instance.GetCurrentTimeStamp();
        bool lastIsClear = true;

        for (int i = 0; i < storyIds.Count; ++i)
        {
            ActivityCapsuleStoryRule rule = GetStoryRule(storyIds[i]);
            if (lastIsClear)
            {
                if (curTime >= rule.data.OpenTime)
                {
                    if (!IsReadStory(storyIds[i]))
                    {
                        state = true;
                        break;
                    }
                }
            }
            lastIsClear = IsReadStory(storyIds[i]);
        }
        //UnityEngine.Debug.LogWarning("HaveCanReadStory:"+state);
        return(state);
    }
Пример #2
0
    public void SetData(string id, ActivityCapsuleTemplateModel model, bool isClearPre)
    {
        _isClearPre = isClearPre;

        ActivityCapsuleStoryRule rule = model.GetStoryRule(id);

        _data = rule;
        if (_data == null)
        {
            return;
        }
        long curTime = ClientTimer.Instance.GetCurrentTimeStamp();

        //Debug.Log("openTime:"+ _data.data.OpenTime + " curTime:"+curTime);
        _contentText.text = "剧情" + rule.index;
        if (curTime < _data.data.OpenTime)
        {
            _btnBg.interactable = false;
            _openObj.Hide();
            _lockObj.Show();
            _bg.texture    = null;
            _bg.color      = new Color(0.9f, 0.9f, 0.9f, 1);
            _lockText.text = I18NManager.Get("ActivityCapsuleTemplate_storyOpenTips", DateUtil.GetYMDD(_data.data.OpenTime));
        }
        else
        {
            _btnBg.interactable = true;
            _bg.texture         = ResourceManager.Load <Texture>("ActivityCapsuleTemplate/story_" + _data.index);
            _openObj.Show();
            _lockObj.Hide();

            if (!isClearPre)
            {
                _redPoint.Hide();
            }
            else
            {
                _redPoint.SetActive(!model.IsReadStory(id));
            }
        }
    }