Example #1
0
    public bool CheckWindowViewInfo()
    {
        bool isView = true;

        if (PlayerPrefs.HasKey(EventWindow.DAILY_VIEW_CHECK) == false)
        {
            PlayerPrefs.SetString(EventWindow.DAILY_VIEW_CHECK, LitJson.JsonMapper.ToJson(new WindowViewCheckInfo(true, Util.GetTimeAddDay(1) + 18000)));
        }
        else
        {
            try
            {
                WindowViewCheckInfo viewInfo = LitJson.JsonMapper.ToObject <WindowViewCheckInfo>(PlayerPrefs.GetString(EventWindow.DAILY_VIEW_CHECK));
                if (viewInfo.isDisable)
                {
                    if (viewInfo.nextViewTime < Util.GetNowLocalGameTime())
                    {
                        PlayerPrefs.SetString(EventWindow.DAILY_VIEW_CHECK, LitJson.JsonMapper.ToJson(new WindowViewCheckInfo(true, Util.GetTimeAddDay(1) + 18000)));
                    }
                    else
                    {
                        isView = false;
                    }
                }
            }
            catch
            {
                PlayerPrefs.SetString(EventWindow.DAILY_VIEW_CHECK, LitJson.JsonMapper.ToJson(new WindowViewCheckInfo(true, Util.GetTimeAddDay(1) + 18000)));
            }
        }

        return(isView);
    }
Example #2
0
    public bool GetWindowViewDisableValue()
    {
        bool isDisable = true;

        try
        {
            WindowViewCheckInfo viewInfo = LitJson.JsonMapper.ToObject <WindowViewCheckInfo>(PlayerPrefs.GetString(EventWindow.DAILY_VIEW_CHECK));
            isDisable = viewInfo.isDisable;
        }
        catch { }

        return(isDisable);
    }