SetEveryplayEnabledForTarget() public static method

public static SetEveryplayEnabledForTarget ( BuildTargetGroup target, bool enabled ) : void
target BuildTargetGroup
enabled bool
return void
Ejemplo n.º 1
0
    public static void ValidateEveryplayState(EveryplaySettings settings)
    {
        bool isValid = false;

        if (settings != null && settings.IsValid)
        {
            isValid = true;
        }

        foreach (BuildTargetGroup target in System.Enum.GetValues(typeof(BuildTargetGroup)))
        {
            if (target == kBuildTargetGroup_iOS)
            {
                EveryplayPostprocessor.SetEveryplayEnabledForTarget(kBuildTargetGroup_iOS, isValid ? settings.iosSupportEnabled : false);
            }
            else if (target == kBuildTargetGroup_tvOS)
            {
                EveryplayPostprocessor.SetEveryplayEnabledForTarget(kBuildTargetGroup_tvOS, isValid ? settings.tvosSupportEnabled : false);
            }
            else if (target == BuildTargetGroup.Android)
            {
                EveryplayPostprocessor.SetEveryplayEnabledForTarget(BuildTargetGroup.Android, isValid ? settings.androidSupportEnabled : false);
            }
            else if (target == BuildTargetGroup.Standalone)
            {
                EveryplayPostprocessor.SetEveryplayEnabledForTarget(BuildTargetGroup.Standalone, isValid ? settings.standaloneSupportEnabled : false);
            }
        }
    }
Ejemplo n.º 2
0
    public static void ValidateEveryplayState(EveryplaySettings settings)
    {
        bool isValid = false;

        if (settings != null && settings.IsValid)
        {
            isValid = true;
        }

        foreach (BuildTargetGroup target in System.Enum.GetValues(typeof(BuildTargetGroup)))
        {
            if (target == kBuildTargetGroup_iOS)
            {
                EveryplayPostprocessor.SetEveryplayEnabledForTarget(kBuildTargetGroup_iOS, isValid ? settings.iosSupportEnabled : false);
            }
            else if (target == kBuildTargetGroup_tvOS)
            {
                EveryplayPostprocessor.SetEveryplayEnabledForTarget(kBuildTargetGroup_tvOS, isValid ? settings.tvosSupportEnabled : false);
            }
            else if (target == BuildTargetGroup.Android)
            {
                bool androidEnabled = isValid ? settings.androidSupportEnabled : false;
                EveryplayPostprocessor.SetEveryplayEnabledForTarget(BuildTargetGroup.Android, androidEnabled);
                #if UNITY_5_5_OR_NEWER
                FixAndroidDynamicLibraryCopyWithGradle(androidEnabled);
                #endif
            }
            else if (target == BuildTargetGroup.Standalone)
            {
                EveryplayPostprocessor.SetEveryplayEnabledForTarget(BuildTargetGroup.Standalone, isValid ? settings.standaloneSupportEnabled : false);
            }
        }
    }
    public static void ValidateEveryplayState(EveryplaySettings settings)
    {
        if (settings != null && settings.IsValid)
        {
            EveryplayPostprocessor.SetEveryplayEnabledForTarget(kBuildTargetGroupIOS, settings.iosSupportEnabled);
            EveryplayPostprocessor.SetEveryplayEnabledForTarget(BuildTargetGroup.Android, settings.androidSupportEnabled);
        }
        else
        {
            EveryplayPostprocessor.SetEveryplayEnabledForTarget(kBuildTargetGroupIOS, false);
            EveryplayPostprocessor.SetEveryplayEnabledForTarget(BuildTargetGroup.Android, false);
        }

        // Disable PluginImporter on iOS and use xCode editor instead
        SetPluginImportEnabled(kBuildTargetIOS, false);
    }
    public override void OnInspectorGUI()
    {
        try {
            // Might be null when this gui is open and this file is being reimported
            if (target == null)
            {
                Selection.activeObject = null;
                return;
            }

            currentSettings = (EveryplaySettings)target;
            bool showAndroidSettings = CheckForAndroidSDK();

            if (currentSettings != null)
            {
                EditorGUILayout.HelpBox("1) Enter your game credentials", MessageType.None);

                if (!currentSettings.IsValid)
                {
                    EditorGUILayout.HelpBox("Invalid or missing game credentials, Everyplay disabled. Check your game credentials at https://developers.everyplay.com/", MessageType.Error);
                }

                EditorGUILayout.BeginHorizontal();
                EditorGUILayout.LabelField(labelClientId, GUILayout.Width(108), GUILayout.Height(18));
                currentSettings.clientId = TrimmedText(EditorGUILayout.TextField(currentSettings.clientId));
                EditorGUILayout.EndHorizontal();

                EditorGUILayout.BeginHorizontal();
                EditorGUILayout.LabelField(labelClientSecret, GUILayout.Width(108), GUILayout.Height(18));
                currentSettings.clientSecret = TrimmedText(EditorGUILayout.TextField(currentSettings.clientSecret));
                EditorGUILayout.EndHorizontal();

                EditorGUILayout.BeginHorizontal();
                EditorGUILayout.LabelField(labelRedirectURI, GUILayout.Width(108), GUILayout.Height(18));
                currentSettings.redirectURI = TrimmedText(EditorGUILayout.TextField(currentSettings.redirectURI));
                EditorGUILayout.EndHorizontal();

                EditorGUILayout.HelpBox("2) Enable recording on these platforms", MessageType.None);

                EditorGUILayout.BeginVertical();

                iosSupportEnabled = EditorGUILayout.Toggle(labelIOsSupport, currentSettings.iosSupportEnabled);

                if (iosSupportEnabled != currentSettings.iosSupportEnabled)
                {
                    currentSettings.iosSupportEnabled = iosSupportEnabled;
                    EveryplayPostprocessor.SetEveryplayEnabledForTarget(BuildTargetGroup.iOS, currentSettings.iosSupportEnabled);
                    EditorUtility.SetDirty(currentSettings);
                }

                if (showAndroidSettings)
                {
                    androidSupportEnabled = EditorGUILayout.Toggle(labelAndroidSupport, currentSettings.androidSupportEnabled);

                    if (androidSupportEnabled != currentSettings.androidSupportEnabled)
                    {
                        currentSettings.androidSupportEnabled = androidSupportEnabled;
                        EveryplayPostprocessor.SetEveryplayEnabledForTarget(BuildTargetGroup.Android, currentSettings.androidSupportEnabled);
                        EditorUtility.SetDirty(currentSettings);
                    }
                }

                EditorGUILayout.EndVertical();

                EditorGUILayout.HelpBox("3) Try out Everyplay", MessageType.None);

                EditorGUILayout.BeginVertical();
                testButtonsEnabled = EditorGUILayout.Toggle(labelTestButtons, currentSettings.testButtonsEnabled);
                if (testButtonsEnabled != currentSettings.testButtonsEnabled)
                {
                    currentSettings.testButtonsEnabled = testButtonsEnabled;
                    EditorUtility.SetDirty(currentSettings);
                    EnableTestButtons(testButtonsEnabled);
                }
                EditorGUILayout.EndVertical();
            }
        }
        catch (Exception e) {
            if (e != null)
            {
            }
        }
    }