コード例 #1
0
 private void OnLoadingModeGUI()
 {
     EditorGUILayout.BeginHorizontal();
     EditorGUILayout.PropertyField(loadingModeProp, HelpStyles.GetContent("Loading mode", null));
     HelpStyles.HelpButton(Utils.gitUnityRepoURL + "/wiki/Configuring-SDK#loading-mode");
     EditorGUILayout.EndHorizontal();
 }
コード例 #2
0
        private void OnAppAdsTxtGUI()
        {
            var content = HelpStyles.GetContent(" Don’t forget to implement app-ads.txt", HelpStyles.helpIconContent.image);

            if (GUILayout.Button(content, EditorStyles.label, GUILayout.ExpandWidth(false)))
            {
                Application.OpenURL(Utils.gitAppAdsTxtRepoUrl);
            }
        }
コード例 #3
0
        private void DrawBannerScope()
        {
            EditorGUILayout.LabelField("Ad View:");
            EditorGUI.indentLevel++;
            bannerRefreshProp.intValue = Mathf.Clamp(
                EditorGUILayout.IntField("Refresh rate(sec)", bannerRefreshProp.intValue), 0, short.MaxValue);

            var obsoleteAPI = bannerSizeProp.intValue > 0;

            if (obsoleteAPI != EditorGUILayout.Toggle("Use Single Banner(Obsolete)", obsoleteAPI))
            {
                obsoleteAPI             = !obsoleteAPI;
                bannerSizeProp.intValue = obsoleteAPI ? 1 : 0;
            }
            if (obsoleteAPI)
            {
                EditorGUILayout.PropertyField(bannerSizeProp, HelpStyles.GetContent("Single Ad size", null));
                //if (settings.bannerSize == AdSize.Banner && Utils.IsPortraitOrientation())
                //{
                //    DialogOrCancel( "For portrait applications, we recommend using the adaptive banner size." +
                //            "This will allow you to get more expensive advertising.", target );
                //}
                EditorGUI.indentLevel++;
                switch (( AdSize )bannerSizeProp.intValue)
                {
                case AdSize.Banner:
                    EditorGUILayout.HelpBox("Size in DPI: 320:50", MessageType.None);
                    break;

                case AdSize.AdaptiveBanner:
                    EditorGUILayout.HelpBox("Pick the best ad size in full width screen for improved performance.", MessageType.None);
                    break;

                case AdSize.SmartBanner:
                    EditorGUILayout.HelpBox("Typically, Smart Banners on phones have a Banner size. " +
                                            "Or on tablets a Leaderboard size", MessageType.None);
                    break;

                case AdSize.Leaderboard:
                    EditorGUILayout.HelpBox("Size in DPI: 728:90", MessageType.None);
                    break;

                case AdSize.MediumRectangle:
                    EditorGUILayout.HelpBox("Size in DPI: 300:250", MessageType.None);
                    var enableMrec = allowedAdFlagsProp.intValue | ( int )AdFlags.MediumRectangle;
                    if (enableMrec != allowedAdFlagsProp.intValue)
                    {
                        allowedAdFlagsProp.intValue = enableMrec;
                    }
                    break;
                }
                EditorGUI.indentLevel--;
            }
            EditorGUI.indentLevel--;
        }
コード例 #4
0
 private void DrawRewardedScope(bool allowInter)
 {
     EditorGUILayout.LabelField("Rewarded ads:");
     EditorGUI.indentLevel++;
     EditorGUI.BeginDisabledGroup(!allowInter);
     interWhenNoRewardedAdProp.boolValue = EditorGUILayout.ToggleLeft(
         HelpStyles.GetContent("Increase filling by Interstitial ads", null,
                               "Sometimes a situation occurs when filling Rewarded ads is not enough, " +
                               "in this case, you can allow the display of Interstitial ads to receiving a reward in any case."),
         allowInter && interWhenNoRewardedAdProp.boolValue);
     EditorGUI.EndDisabledGroup();
     EditorGUI.indentLevel--;
 }
コード例 #5
0
        private void OnLabelGUI(Label label)
        {
            if (label == Label.None)
            {
                return;
            }
            string title   = "";
            string tooltip = "";

            if ((label & Label.Banner) == Label.Banner)
            {
                title   += "b ";
                tooltip += "'b' - Support Banner Ad\n";
            }
            if ((label & Label.Inter) == Label.Inter)
            {
                title   += "i ";
                tooltip += "'i' - Support Interstitial Ad\n";
            }
            if ((label & Label.Reward) == Label.Reward)
            {
                title   += "r ";
                tooltip += "'r' - Support Rewarded Ad\n";
            }
            if ((label & Label.Beta) == Label.Beta)
            {
                title   += "beta";
                tooltip += "'beta' - Dependencies in closed beta and available upon invite only. " +
                           "If you would like to be considered for the beta, please contact Support.";
            }
            if ((label & Label.Obsolete) == Label.Obsolete)
            {
                title   += "obsolete";
                tooltip += "'obsolete' - The mediation of the network is considered obsolete and not recommended for install.";
            }
            GUILayout.Label(HelpStyles.GetContent(title, null, tooltip), HelpStyles.labelStyle);
        }
コード例 #6
0
        private bool DrawAdFlagToggle(AdFlags flag)
        {
            var flagInt = ( int )flag;
            var enabled = (allowedAdFlagsProp.intValue & flagInt) == flagInt;
            var icon    = HelpStyles.GetFormatIcon(flag, enabled);
            var content = HelpStyles.GetContent("", icon, "Use " + flag.ToString() + " placement");

            EditorGUI.BeginDisabledGroup(flag == AdFlags.Native);
            if (flag == AdFlags.Native)
            {
                if (enabled)
                {
                    allowedAdFlagsProp.intValue = allowedAdFlagsProp.intValue ^ flagInt;
                    enabled = false;
                }
                content.tooltip = "Native ads coming soon";
            }
            if (icon == null)
            {
                content.text    = content.tooltip;
                content.tooltip = "";
            }
            if (enabled != GUILayout.Toggle(enabled, content, "button", GUILayout.ExpandWidth(false), GUILayout.MinWidth(45)))
            {
                enabled = !enabled;
                if (enabled)
                {
                    allowedAdFlagsProp.intValue = allowedAdFlagsProp.intValue | flagInt;
                }
                else
                {
                    allowedAdFlagsProp.intValue = allowedAdFlagsProp.intValue ^ flagInt;
                }
            }
            EditorGUI.EndDisabledGroup();
            return(enabled);
        }
コード例 #7
0
        private void OnOtherSettingsGUI()
        {
            HelpStyles.BeginBoxScope();
            otherSettingsFoldout = GUILayout.Toggle(otherSettingsFoldout, "Other settings", EditorStyles.foldout);
            if (!otherSettingsFoldout)
            {
                HelpStyles.EndBoxScope();
                return;
            }

            OnLoadingModeGUI();

            debugModeProp.boolValue = EditorGUILayout.ToggleLeft(
                HelpStyles.GetContent("Verbose Debug logging", null,
                                      "The enabled Debug Mode will display a lot of useful information for debugging about the states of the sdk with tag CAS. " +
                                      "Disabling the Debug Mode may improve application performance."),
                debugModeProp.boolValue);

            analyticsCollectionEnabledProp.boolValue = EditorGUILayout.ToggleLeft(
                HelpStyles.GetContent("Impression Analytics collection (Firebase)", null,
                                      "If your application uses Google Analytics(Firebase) then CAS collects ad impressions and states to analytic.\n" +
                                      "Disabling analytics collection may save internet traffic and improve application performance.\n" +
                                      "The Analytics collection has no effect on ad revenue."),
                analyticsCollectionEnabledProp.boolValue);

            buildPreprocessEnabledProp.boolValue = EditorGUILayout.ToggleLeft(
                "Build preprocess enabled",
                buildPreprocessEnabledProp.boolValue);

            if (!buildPreprocessEnabledProp.boolValue)
            {
                EditorGUI.indentLevel++;
                EditorGUILayout.HelpBox("Automatic configuration at build time is disabled.\n" +
                                        "You can use `Assets > CleverAdsSolutions > Configure project` to call configuration manually.",
                                        MessageType.None);
                EditorGUI.indentLevel--;
            }

            if (platform == BuildTarget.Android)
            {
                EditorGUI.indentLevel++;
                updateGradlePluginVersionProp.boolValue = EditorGUILayout.ToggleLeft(
                    HelpStyles.GetContent("Update Gradle Plugin enabled", null,
                                          "The Gradle plugin version will be updated during build to be optimal " +
                                          "for the current Gradle Wrapper version."),
                    updateGradlePluginVersionProp.boolValue);

                EditorGUILayout.BeginHorizontal();
                multiDexEnabledProp.boolValue = EditorGUILayout.ToggleLeft(
                    "Multi DEX enabled",
                    multiDexEnabledProp.boolValue);
                HelpStyles.HelpButton(Utils.gitUnityRepoURL + "/wiki/Include-Android#enable-multidex");
                EditorGUILayout.EndHorizontal();

                exoPlayerIncludedProp.boolValue = EditorGUILayout.ToggleLeft(
                    HelpStyles.GetContent("ExoPlayer included", null,
                                          "ExoPlayer can be used instead of MediaPlayer to play videos " +
                                          "with better performance and avoid known ANR errors."),
                    exoPlayerIncludedProp.boolValue);

                EditorGUI.indentLevel--;
            }
            else
            {
                EditorGUILayout.BeginHorizontal();
                var reportEndpointEnabled = attributionReportEndpointProp.stringValue.Length > 0;
                if (reportEndpointEnabled != EditorGUILayout.ToggleLeft(
                        "Set Attribution Report endpoint", reportEndpointEnabled))
                {
                    reportEndpointEnabled = !reportEndpointEnabled;
                    if (reportEndpointEnabled)
                    {
                        attributionReportEndpointProp.stringValue = Utils.attributionReportEndPoint;
                    }
                    else
                    {
                        attributionReportEndpointProp.stringValue = string.Empty;
                    }
                }
                HelpStyles.HelpButton(Utils.gitUnityRepoURL + "/wiki/Include-iOS#ios-15-global-skadnetwork-reporting");
                EditorGUILayout.EndHorizontal();
                if (reportEndpointEnabled)
                {
                    EditorGUI.indentLevel++;
                    attributionReportEndpointProp.stringValue = EditorGUILayout.TextField(
                        attributionReportEndpointProp.stringValue);
                    EditorGUI.indentLevel--;
                }
            }

            autoCheckForUpdatesEnabledProp.boolValue = EditorGUILayout.ToggleLeft(
                "Auto check for CAS updates enabled",
                autoCheckForUpdatesEnabledProp.boolValue);

            delayAppMeasurementGADInitProp.boolValue = EditorGUILayout.ToggleLeft(
                "Delay measurement of the Google SDK initialization",
                delayAppMeasurementGADInitProp.boolValue);

            EditorGUILayout.BeginHorizontal();
            GUILayout.Label("Most popular country of users (ISO2)", GUILayout.ExpandWidth(false));
            EditorGUI.BeginChangeCheck();
            var countryCode = mostPopularCountryOfUsersProp.stringValue;

            countryCode = EditorGUILayout.TextField(countryCode, GUILayout.Width(25.0f));
            if (EditorGUI.EndChangeCheck())
            {
                if (countryCode.Length > 2)
                {
                    countryCode = countryCode.Substring(0, 2);
                }
                mostPopularCountryOfUsersProp.stringValue = countryCode.ToUpper();
            }
            EditorGUILayout.EndHorizontal();

            HelpStyles.EndBoxScope();
        }