Beispiel #1
0
    public static void OnPostProcessBuild(BuildTarget target, string path)
    {
        path = UnityPathBugFix(path);

        EveryplaySettings settings = EveryplaySettingsEditor.LoadEveryplaySettings();

        if (settings != null)
        {
            if (settings.IsBuildTargetEnabled)
            {
                if (settings.IsValid)
                {
                    if (target == kBuildTarget_iOS)
                    {
                        PostProcessBuild_iOS(path);
                    }
                    else if (target == kBuildTarget_tvOS)
                    {
                        PostProcessBuild_iOS(path);
                    }
                    else if (target == BuildTarget.Android)
                    {
                        PostProcessBuild_Android(path);
                    }
                }
                else
                {
                    Debug.LogError("Everyplay will be disabled because client id, client secret or redirect URI was not valid.");
                }
            }
        }

        ValidateEveryplayState(settings);
    }
    public static void ShowWelcome()
    {
        if (!EditorPrefs.HasKey("EveryplayWelcomeShown"))
        {
            Texture2D texture = (Texture2D)EditorGUIUtility.Load("Everyplay/Images/everyplay-welcome.png");

            if (texture != null)
            {
                GUIStyle style = new GUIStyle();
                style.margin    = new RectOffset(0, 0, 0, 0);
                style.padding   = new RectOffset(0, 0, 0, 0);
                style.alignment = TextAnchor.MiddleCenter;

                if (style != null)
                {
                    EditorPrefs.SetBool("EveryplayWelcomeShown", true);
                    EveryplayWelcome window = (EveryplayWelcome)GetWindow(typeof(EveryplayWelcome), true, "Welcome to Everyplay!");
                    window.position         = new Rect(196, 196, texture.width, texture.height);
                    window.minSize          = new Vector2(texture.width, texture.height);
                    window.maxSize          = new Vector2(texture.width, texture.height);
                    window.welcomeTexture2d = texture;
                    window.welcomeStyle     = style;
                    window.Show();

                    EveryplaySettingsEditor.ShowSettings();
                }
            }
        }
    }
Beispiel #3
0
    public static void OnPostprocessScene()
    {
        EveryplaySettings settings = EveryplaySettingsEditor.LoadEveryplaySettings();

        if (settings != null)
        {
            if (settings.earlyInitializerEnabled && settings.IsValid && settings.IsEnabled)
            {
                GameObject everyplayEarlyInitializer = new GameObject("EveryplayEarlyInitializer");
                everyplayEarlyInitializer.AddComponent <EveryplayEarlyInitializer>();
            }
        }
    }
    void OnGUI()
    {
        if (welcomeStyle == null || welcomeTexture2d == null)
        {
            return;
        }

        if (GUI.Button(new Rect(0, 0, welcomeTexture2d.width, welcomeTexture2d.height), welcomeTexture2d, welcomeStyle))
        {
            Close();
            EveryplaySettingsEditor.ShowSettings();
            Application.OpenURL("https://developers.everyplay.com/");
        }
    }
    private static void Update()
    {
        if (editorFrames > editorFramesToWait)
        {
            Clean(true);

            EveryplayPostprocessor.ValidateEveryplayState(EveryplaySettingsEditor.LoadEveryplaySettings());

            EditorApplication.update -= Update;
        }
        else
        {
            editorFrames++;
        }
    }
Beispiel #6
0
    public static void OnPostProcessBuild(BuildTarget target, string path)
    {
        if (path.StartsWith("./"))           // Fix two erroneous path cases on Unity 5.4f03
        {
            path = Path.Combine(Application.dataPath.Replace("Assets", ""), path.Replace("./", ""));
        }
        else if (path.Contains("./"))
        {
            path = path.Replace("./", "");
        }

        EveryplaySettings settings = EveryplaySettingsEditor.LoadEveryplaySettings();

        if (settings != null)
        {
            if (settings.IsBuildTargetEnabled)
            {
                if (settings.IsValid)
                {
                    if (target == kBuildTarget_iOS)
                    {
                        PostProcessBuild_iOS(path, settings.clientId);
                    }
                    else if (target == kBuildTarget_tvOS)
                    {
                        PostProcessBuild_iOS(path, settings.clientId);
                    }
                    else if (target == BuildTarget.Android)
                    {
                        PostProcessBuild_Android(path, settings.clientId);
                    }
                }
                else
                {
                    Debug.LogError("Everyplay will be disabled because client id, client secret or redirect URI was not valid.");
                }
            }
        }

        ValidateEveryplayState(settings);
    }