Example #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)
            {
                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);
            }
        }
    }
Example #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)
            {
                EveryplayPostprocessor.SetEveryplayEnabledForTarget(BuildTargetGroup.Android, isValid ? settings.androidSupportEnabled : false);
            }
            else if (target == BuildTargetGroup.Standalone)
            {
                EveryplayPostprocessor.SetEveryplayEnabledForTarget(BuildTargetGroup.Standalone, isValid ? settings.standaloneSupportEnabled : false);
            }
        }
    }
Example #3
0
    private static void Update()
    {
        if (editorFrames > editorFramesToWait)
        {
            Clean(true);

            EveryplayPostprocessor.ValidateEveryplayState(EveryplaySettingsEditor.LoadEveryplaySettings());

            EditorApplication.update -= Update;
        }
        else
        {
            editorFrames++;
        }
    }
Example #4
0
    public static void ShowSettings()
    {
        EveryplaySettings settingsInstance = LoadEveryplaySettings();

        if (settingsInstance == null)
        {
            settingsInstance = CreateEveryplaySettings();
        }

        if (settingsInstance != null)
        {
            EveryplayPostprocessor.ValidateAndUpdateFacebook();
            EveryplayLegacyCleanup.Clean(false);
            Selection.activeObject = settingsInstance;
        }
    }
    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);
    }
Example #6
0
    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;

            if (currentSettings != null)
            {
                bool settingsValid = currentSettings.IsValid;

                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();

                bool validityChanged          = currentSettings.IsValid != settingsValid;
                bool selectedPlatformsChanged = false;

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

                if (iosSupportEnabled != currentSettings.iosSupportEnabled)
                {
                    selectedPlatformsChanged          = true;
                    currentSettings.iosSupportEnabled = iosSupportEnabled;
                    EditorUtility.SetDirty(currentSettings);
                }

                if (CheckForSDK_tvOS())
                {
                    tvosSupportEnabled = EditorGUILayout.Toggle(labelSupport_tvOS, currentSettings.tvosSupportEnabled);

                    if (tvosSupportEnabled != currentSettings.tvosSupportEnabled)
                    {
                        selectedPlatformsChanged           = true;
                        currentSettings.tvosSupportEnabled = tvosSupportEnabled;
                        EditorUtility.SetDirty(currentSettings);
                    }
                }

                if (CheckForSDK_Android())
                {
                    androidSupportEnabled = EditorGUILayout.Toggle(labelSupport_Android, currentSettings.androidSupportEnabled);

                    if (androidSupportEnabled != currentSettings.androidSupportEnabled)
                    {
                        selectedPlatformsChanged = true;
                        currentSettings.androidSupportEnabled = androidSupportEnabled;
                        EditorUtility.SetDirty(currentSettings);
                    }
                }

                if (CheckForSDK_Mac())
                {
                    standaloneSupportEnabled = EditorGUILayout.Toggle(labelSupport_Standalone, currentSettings.standaloneSupportEnabled);

                    if (standaloneSupportEnabled != currentSettings.standaloneSupportEnabled)
                    {
                        selectedPlatformsChanged = true;
                        currentSettings.standaloneSupportEnabled = standaloneSupportEnabled;
                        EditorUtility.SetDirty(currentSettings);
                    }
                }

                if (validityChanged || selectedPlatformsChanged)
                {
                    EveryplayPostprocessor.ValidateEveryplayState(currentSettings);
                }

                EditorGUILayout.EndVertical();

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

                EditorGUILayout.BeginVertical();
                earlyInitializerEnabled = EditorGUILayout.Toggle(labelEarlyInitializer, currentSettings.earlyInitializerEnabled);
                if (earlyInitializerEnabled != currentSettings.earlyInitializerEnabled)
                {
                    currentSettings.earlyInitializerEnabled = earlyInitializerEnabled;
                    EditorUtility.SetDirty(currentSettings);
                }
                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)
            {
            }
        }
    }
    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)
            {
            }
        }
    }