コード例 #1
0
        void Request()
        {
            _mStatus = kProgressStatus.CheckingNeedConsent;

            string url = "";

            if (TTDebug.IsDebug())
            {
                url = TTConsentDefine.GetApiUrl(DeveloperType, true);
            }
            else
            {
#if UNITY_EDITOR
                url = TTConsentDefine.GetApiUrl(DeveloperType, true);
#else
                url = TTConsentDefine.GetApiUrl(DeveloperType);
#endif
            }

            StartCoroutine(_Request(
                               url,
                               text =>
            {
                try
                {
                    var response = JsonUtility.FromJson <ResponseData>(text);
                    if (response.NeedConsent())
                    {
                        ShowDialog(response);
                    }
                    else
                    {
                        Debug.Log("### TTConsent 同意不要");
                        NextScene();
                    }
                }
                catch
                {
                    NextScene();
                }
            },
                               NextScene)
                           );
        }
コード例 #2
0
        public void Setup(kDeveloper developerType, string text)
        {
#if NEES_DRAW_THRIDPARTY
            GdprData gdprData;
            try
            {
                gdprData = JsonUtility.FromJson <GdprData>(text);
            }
            catch (Exception)
            {
                gdprData   = new GdprData();
                gdprData.m = _mMessageText.text;
                gdprData.d = _mDeveloperText.text;
                gdprData.t = new string[0];
            }

            var messageText = gdprData.m;
#else
            var messageText = text;
#endif
            messageText        = messageText.Replace("%D_NAME%", TTConsentDefine.GetDeveloperName(developerType));
            _mMessageText.text = messageText;

            var developerText = _mDeveloperText.text;
            developerText        = developerText.Replace("%D_NAME%", TTConsentDefine.GetDeveloperName(developerType));
            developerText        = developerText.Replace("%P_LINK%", TTConsentDefine.GetPrivacyUrl(developerType));
            developerText        = developerText.Replace("%T_LINK%", TTConsentDefine.GetTermsUrl(developerType));
            _mDeveloperText.text = developerText;

#if NEES_DRAW_THRIDPARTY
            foreach (var thirdPartyText in gdprData.t)
            {
                var textObj = Instantiate(_mPrefabThirdPartyTextObj);
                textObj.GetComponent <TMP_Text>().text = thirdPartyText;
                textObj.transform.SetParent(_mScrollContentsObj.transform, false);

                var spaceObj = Instantiate(_mPrefabThirdPartySpaceObj);
                spaceObj.transform.SetParent(_mScrollContentsObj.transform, false);
            }
#else
            LayoutRebuilder.ForceRebuildLayoutImmediate(_mScrollContentsObj.GetComponent <RectTransform>());
#endif
        }