Example #1
0
 public static void CheckConfigAndClearDir()
 {
     #region 检查多余
     //if (!File.Exists(Application.dataPath + "/RushDevelopFW/PackageConfig.txt"))
     //{
     //    return;
     //}
     //ConfigJson currentConfig = JsonUtility.FromJson<ConfigJson>(File.ReadAllText(Application.dataPath + "/RushDevelopFW/PackageConfig.txt"));
     //ConfigJson downloadConfig = JsonUtility.FromJson<ConfigJson>(File.ReadAllText(@"C:\Users\Administrator\Desktop" + "/PackageConfig.txt"));
     //int currentConfigLength = currentConfig.direct.Count;
     //int downConfigLength = downloadConfig.direct.Count;
     //if (currentConfigLength > downConfigLength)
     //{
     //    for (int i = 0; i < currentConfigLength; i++)
     //    {
     //        if (!downloadConfig.direct.Contains(currentConfig.direct[i]))
     //        {
     //            Debug.LogError("在框架库中发现多余脚本:" + currentConfig.direct[i] + ",可前往删除!");
     //        }
     //    }
     //}
     #endregion
     //下载版本号 对比是否需要更新
     //用playerPrefs永久序列化更新标志位到本地
     WebRequestInEdior.GetIns().GetVersion();
 }
 private void OnGUI()
 {
     GUILayout.BeginArea(middleCenterRect);
     GUILayout.BeginVertical();
     EditorGUILayout.LabelField("检测到R.D.发布了新版本" + versionNum + ",是否更新?", labelStyle, GUILayout.Width(200));
     GUILayout.Space(20);
     GUILayout.BeginHorizontal();
     if (GUILayout.Button("是", GUILayout.Width(80)))
     {
         //Debug.Log("更新");
         Close();
         //开始下载package
         WebRequestInEdior.GetIns().GetNewPackage();
     }
     GUILayout.Space(20);
     if (GUILayout.Button("否", GUILayout.Width(80)))
     {
         Debug.Log("取消更新");
         Close();
     }
     GUILayout.EndHorizontal();
     GUILayout.EndVertical();
     GUILayout.EndArea();
 }