Пример #1
0
 private void UpdateUIDownload()
 {
     if (downloadRequest != null)
     {
         downloadProgress = downloadRequest.progress;
         if (downloadRequest.isDone)
         {
             if (string.IsNullOrEmpty(downloadRequest.error))
             {
                 downloadProgress = 1f;
                 NPNFUpgradeUlti.SaveFile(downloadRequest.bytes);
                 CurrentPhase = UpgreadePhase.Uninstall_Current_Version;
                 downloadRequest.Dispose();
                 downloadRequest = null;
             }
             else
             {
                 string error = downloadRequest.error;
                 downloadRequest.Dispose();
                 downloadRequest = null;
                 if (EditorUtility.DisplayDialog("Download NPNF SDK Latest Version", error, "Retry", "Close"))
                 {
                     downloadRequest = new WWW(latestUrlSDK);
                 }
                 else
                 {
                     this.Close();
                 }
             }
         }
     }
 }
Пример #2
0
 private void UninstallCurrentVersion()
 {
     if (NPNFUpgradeUlti.UninstallCurrentVersion())
     {
         CurrentPhase = UpgreadePhase.Import_Latest_Version;
     }
 }
Пример #3
0
        private void CheckLatestVersion()
        {
            string latestVersion;

            if (!NPNFUpgradeUlti.GetLatestVersion(out latestVersion, out latestUrlSDK))
            {
                EditorUtility.DisplayDialog("Check for New Version", "Can not check versions, network fault", "Close");
                this.Close();
                return;
            }

            Version current = new Version(NPNFSettings.SDK_VERSION);
            Version latest  = new Version(latestVersion);

            if (latest.CompareTo(current) > 0)
            {
                bool pick = EditorUtility.DisplayDialog("Check for New Version", "There is a new version of NPNF SDK available for upgrade", "Upgrade", "Later");
                if (pick)
                {
                    CurrentPhase = UpgreadePhase.Download_Latest_SDK;
                }
                else
                {
                    this.Close();
                }
            }
            else
            {
                EditorUtility.DisplayDialog("Check for New Version", "No newer version found. You are already using the latest version", "OK");
                this.Close();
            }
        }