Exemple #1
0
        static void displayUpdateInfo(EntitasUpdateInfo info)
        {
            switch (info.updateState)
            {
            case EntitasUpdateState.UpdateAvailable:
                if (EditorUtility.DisplayDialog("Entitas Update",
                                                string.Format("A newer version of Entitas is available!\n\n" +
                                                              "Currently installed version: {0}\n" +
                                                              "New version: {1}", info.localVersionString, info.remoteVersionString),
                                                "Show release",
                                                "Cancel"
                                                ))
                {
                    Application.OpenURL(URL_GITHUB_RELEASES);
                }
                break;

            case EntitasUpdateState.UpToDate:
                EditorUtility.DisplayDialog("Entitas Update",
                                            "Entitas is up to date (" + info.localVersionString + ")",
                                            "Ok"
                                            );
                break;

            case EntitasUpdateState.AheadOfLatestRelease:
                if (EditorUtility.DisplayDialog("Entitas Update",
                                                string.Format("Your Entitas version seems to be newer than the latest release?!?\n\n" +
                                                              "Currently installed version: {0}\n" +
                                                              "Latest release: {1}", info.localVersionString, info.remoteVersionString),
                                                "Show release",
                                                "Cancel"
                                                ))
                {
                    Application.OpenURL(URL_GITHUB_RELEASES);
                }
                break;

            case EntitasUpdateState.NoConnection:
                if (EditorUtility.DisplayDialog("Entitas Update",
                                                "Could not request latest Entitas version!\n\n" +
                                                "Make sure that you are connected to the internet.\n",
                                                "Try again",
                                                "Cancel"
                                                ))
                {
                    CheckForUpdates();
                }
                break;
            }
        }
 static void displayUpdateInfo(EntitasUpdateInfo info)
 {
     switch(info.updateState) {
         case EntitasUpdateState.UpdateAvailable:
             if(EditorUtility.DisplayDialog("Entitas Update",
                     string.Format("A newer version of Entitas is available!\n\n" +
                     "Currently installed version: {0}\n" +
                     "New version: {1}", info.localVersionString, info.remoteVersionString),
                     "Show release",
                     "Cancel"
                 )) {
                 Application.OpenURL(URL_GITHUB_RELEASES);
             }
             break;
         case EntitasUpdateState.UpToDate:
             EditorUtility.DisplayDialog("Entitas Update",
                 "Entitas is up to date (" + info.localVersionString + ")",
                 "Ok"
             );
             break;
         case EntitasUpdateState.AheadOfLatestRelease:
             if(EditorUtility.DisplayDialog("Entitas Update",
                     string.Format("Your Entitas version seems to be newer than the latest release?!?\n\n" +
                     "Currently installed version: {0}\n" +
                     "Latest release: {1}", info.localVersionString, info.remoteVersionString),
                     "Show release",
                     "Cancel"
                 )) {
                 Application.OpenURL(URL_GITHUB_RELEASES);
             }
             break;
         case EntitasUpdateState.NoConnection:
             if(EditorUtility.DisplayDialog("Entitas Update",
                     "Could not request latest Entitas version!\n\n" +
                     "Make sure that you are connected to the internet.\n",
                     "Try again",
                     "Cancel"
                 )) {
                 CheckForUpdates();
             }
             break;
     }
 }