Ejemplo n.º 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();
 }
Ejemplo n.º 2
0
        public static void OnHeaderGUI(string gitRepoName, bool allowedPackageUpdate, string currVersion, ref string newCASVersion)
        {
            EditorGUILayout.BeginHorizontal(EditorStyles.toolbar);
            HelpStyles.HelpButton(gitRootURL + gitRepoName + "/wiki");

            if (GUILayout.Button(gitRepoName + " " + currVersion, EditorStyles.toolbarButton))
            {
                Application.OpenURL(gitRootURL + gitRepoName + "/releases");
            }
            if (GUILayout.Button("Check for Updates", EditorStyles.toolbarButton, GUILayout.ExpandWidth(false)))
            {
                newCASVersion = GetNewVersionOrNull(gitRepoName, currVersion, true);
                string message = string.IsNullOrEmpty(newCASVersion) ? "You are using the latest version."
                    : "There is a new version " + newCASVersion + " of the " + gitRepoName + " available for update.";
                EditorUtility.DisplayDialog("Check for Updates", message, "OK");
            }

            if (GUILayout.Button("Support", EditorStyles.toolbarButton, GUILayout.ExpandWidth(false)))
            {
                Application.OpenURL(gitRootURL + gitRepoName + "#support");
            }
            EditorGUILayout.EndHorizontal();

            if (!string.IsNullOrEmpty(newCASVersion))
            {
                var updateMessage = "There is a new version " + newCASVersion + " of the " + gitRepoName + " available for update.";
#if UNITY_2018_4_OR_NEWER
                if (allowedPackageUpdate)
                {
                    if (HelpStyles.WarningWithButton(updateMessage, "Update"))
                    {
                        UpdatePackageManagerRepo(gitRepoName, newCASVersion);
                    }
                }
                else
#endif
                {
                    EditorGUILayout.HelpBox(updateMessage, MessageType.Warning);
                }
            }
        }
Ejemplo n.º 3
0
        private void OnUserTrackingDesctiptionGUI()
        {
            if (platform != BuildTarget.iOS)
            {
                return;
            }
            HelpStyles.BeginBoxScope();
            var enabled = userTrackingUsageDescriptionProp.arraySize > 0;

            EditorGUILayout.BeginHorizontal();
            if (enabled != EditorGUILayout.ToggleLeft("Set User Tracking Usage description in Info.plist", enabled))
            {
                enabled = !enabled;
                if (enabled)
                {
                    var defDescr = Utils.DefaultUserTrackingUsageDescription();
                    userTrackingUsageDescriptionProp.arraySize = defDescr.Length;
                    for (int i = 0; i < defDescr.Length; i++)
                    {
                        var pair = userTrackingUsageDescriptionProp.GetArrayElementAtIndex(i);
                        pair.Next(true);
                        pair.stringValue = defDescr[i].key;
                        pair.Next(false);
                        pair.stringValue = defDescr[i].value;
                    }
                }
                else
                {
                    userTrackingUsageDescriptionProp.ClearArray();
                }
            }
            HelpStyles.HelpButton(Utils.gitUnityRepoURL + "/wiki/App-Tracking-Transparency");
            EditorGUILayout.EndHorizontal();
            if (enabled)
            {
                userTrackingList.DoLayoutList();
            }
            HelpStyles.EndBoxScope();
        }
Ejemplo n.º 4
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();
        }