提交 9162a443 编写于 作者: 魔术师Dix's avatar 魔术师Dix

[Fix]先处理一部分报错;

上级 8e14a773
......@@ -52,7 +52,7 @@ namespace Cocklebur
compatibleVersions.Add(curVersion.version.ToString());
verified = curVersion.version.ToString();
}
VersionsInfo versionsInfo = new VersionsInfo(allVersions, compatibleVersions, verified);
VersionsInfo versionsInfo = new VersionsInfo(allVersions, compatibleVersions, verified, null);
for (int i = versions.Count - 1; i >= 0; i--)
{
......
#if UNITY_2020_3_41|| UNITY_2021_3_12
#define UPM_GIT_NEW
#else
#undef UPM_GIT_NEW
#endif
using System;
using System.Collections.Generic;
using System.Text.RegularExpressions;
......@@ -33,9 +27,7 @@ namespace Cocklebur
public UpmPackageVersionEx(UpmPackageVersion packageVersion) : base(packageVersion.GetPackageInfo(), packageVersion.isInstalled, packageVersion.isUnityPackage)
{
#if UPM_GIT_NEW
packageInfo = packageVersion.GetPackageInfo();
#endif
m_MinimumUnityVersion = UnityVersionToSemver(Application.unityVersion).ToString();
OnAfterDeserialize();
}
......@@ -52,10 +44,9 @@ namespace Cocklebur
public string fullVersionString { get; private set; }
public SemVersion semVersion { get; private set; }
#if UPM_GIT_NEW
[SerializeField]
internal UnityEditor.PackageManager.PackageInfo packageInfo;
#endif
[SerializeField]
private string m_MinimumUnityVersion;
......
#if UNITY_2020_3_41 || UNITY_2021_3_12
#define UPM_GIT_NEW
#else
#undef UPM_GIT_NEW
#endif
using System.Collections.Generic;
using System.IO;
using UnityEditor;
......@@ -149,7 +143,7 @@ namespace Cocklebur
internal static bool IsError(this UpmAddOperation op)
{
if (op == null) return false;
return op.error != null;
return op.logErrorInConsole;
}
#endregion
......@@ -167,12 +161,11 @@ namespace Cocklebur
internal static PackageInfo GetPackageInfo(this IPackageVersion version)
{
#if UPM_GIT_NEW
if (version == null) return null;
PackageInfo info;
string key = version.uniqueId;
if (dictCachePackageInfo.TryGetValue(key, out info)) return info;
var allPkg = PackageInfo.GetAll();
var allPkg = PackageInfo.GetAllRegisteredPackages();
foreach (var pkg in allPkg)
{
SetCachePackageInfo(pkg.packageId, pkg);
......@@ -185,9 +178,6 @@ namespace Cocklebur
//To Do : 重新按照地址下载 PkgInfo ?
#endif
return null;
#else
return version.packageInfo;
#endif
}
private static void AddPackageInfo(UpmPackageVersionEx version)
......@@ -228,22 +218,13 @@ namespace Cocklebur
EditorUtility.DisplayDialog(L10n.Tr("Unity Package Manager"), message, L10n.Tr("OK"));
}
internal static bool IsGit(this IPackageVersion version)
{
#if UPM_GIT_NEW
return version.HasTag(PackageTag.Git);
#else
return version.packageInfo.source == UnityEditor.PackageManager.PackageSource.Git;
#endif
}
internal static bool IsGit(this IPackageVersion version) { return version.HasTag(PackageTag.Git); }
internal static void UpdateVersions(UpmPackage upmPackage, IEnumerable<UpmPackageVersion> newVersions)
{
#if UPM_GIT_NEW
upmPackage.UpdateVersions(newVersions, 0);
#else
upmPackage.UpdateVersions(newVersions);
#endif
//upmPackage.UpdateVersions(newVersions);
//(upmPackage.versions as UpmVersionList).GetUpdateTarget
}
#endregion
......
......@@ -7,14 +7,14 @@
"dependencies": {
"com.unity.services.core": "1.0.1"
},
"url": "https://packages.unity.cn"
"url": "https://packages.unity.com"
},
"com.unity.ext.nunit": {
"version": "1.0.6",
"depth": 1,
"source": "registry",
"dependencies": {},
"url": "https://packages.unity.cn"
"url": "https://packages.unity.com"
},
"com.unity.ide.visualstudio": {
"version": "2.0.16",
......@@ -23,23 +23,32 @@
"dependencies": {
"com.unity.test-framework": "1.1.9"
},
"url": "https://packages.unity.cn"
"url": "https://packages.unity.com"
},
"com.unity.ide.vscode": {
"version": "1.2.5",
"depth": 0,
"source": "registry",
"dependencies": {},
"url": "https://packages.unity.cn"
"url": "https://packages.unity.com"
},
"com.unity.nuget.newtonsoft-json": {
"version": "3.0.2",
"depth": 2,
"source": "registry",
"dependencies": {},
"url": "https://packages.unity.com"
},
"com.unity.services.core": {
"version": "1.0.1",
"version": "1.5.2",
"depth": 1,
"source": "registry",
"dependencies": {
"com.unity.modules.unitywebrequest": "1.0.0"
"com.unity.modules.unitywebrequest": "1.0.0",
"com.unity.nuget.newtonsoft-json": "3.0.2",
"com.unity.modules.androidjni": "1.0.0"
},
"url": "https://packages.unity.cn"
"url": "https://packages.unity.com"
},
"com.unity.test-framework": {
"version": "1.1.33",
......@@ -50,7 +59,7 @@
"com.unity.modules.imgui": "1.0.0",
"com.unity.modules.jsonserialize": "1.0.0"
},
"url": "https://packages.unity.cn"
"url": "https://packages.unity.com"
},
"com.unity.timeline": {
"version": "1.6.4",
......@@ -62,7 +71,7 @@
"com.unity.modules.audio": "1.0.0",
"com.unity.modules.particlesystem": "1.0.0"
},
"url": "https://packages.unity.cn"
"url": "https://packages.unity.com"
},
"com.unity.modules.ai": {
"version": "1.0.0",
......@@ -209,17 +218,6 @@
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {
"com.unity.modules.ui": "1.0.0",
"com.unity.modules.imgui": "1.0.0",
"com.unity.modules.jsonserialize": "1.0.0",
"com.unity.modules.uielementsnative": "1.0.0"
}
},
"com.unity.modules.uielementsnative": {
"version": "1.0.0",
"depth": 1,
"source": "builtin",
"dependencies": {
"com.unity.modules.ui": "1.0.0",
"com.unity.modules.imgui": "1.0.0",
......
......@@ -13,23 +13,24 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
m_EnablePreReleasePackages: 0
m_EnablePackageDependencies: 1
m_AdvancedSettingsExpanded: 1
m_ScopedRegistriesSettingsExpanded: 1
m_SeeAllPackageVersions: 1
m_SeeAllPackageVersions: 0
m_DismissPreviewPackagesInUse: 0
oneTimeWarningShown: 1
m_Registries:
- m_Id: main
m_Name:
m_Url: https://packages.unity.cn
m_Url: https://packages.unity.com
m_Scopes: []
m_IsDefault: 1
m_Capabilities: 7
m_ConfigSource: 0
m_UserSelectedRegistryName:
m_UserAddingNewScopedRegistry: 0
m_RegistryInfoDraft:
m_Modified: 0
m_ErrorMessage:
m_UserModificationsInstanceId: -826
m_OriginalInstanceId: -828
m_UserModificationsInstanceId: -842
m_OriginalInstanceId: -844
m_LoadAssets: 0
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册