Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
魔术师Dix
UPM解决方案:苍耳
提交
4a43be46
UPM解决方案:苍耳
项目概览
魔术师Dix
/
UPM解决方案:苍耳
通知
26
Star
3
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
2
Wiki
分析
仓库
DevOps
项目成员
Pages
UPM解决方案:苍耳
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
2
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
4a43be46
编写于
11月 09, 2022
作者:
魔术师Dix
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[Fix]判空,以及打印处理;
上级
a1fe5f09
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
29 addition
and
13 deletion
+29
-13
UpmGitExtension/Assets/UpmGitExtension/Editor/Core/Extensions/UpmPackageVersionEx.cs
...itExtension/Editor/Core/Extensions/UpmPackageVersionEx.cs
+18
-2
UpmGitExtension/Assets/UpmGitExtension/Editor/Core/UI/GitPackageInstallationWindow.cs
...tExtension/Editor/Core/UI/GitPackageInstallationWindow.cs
+1
-1
UpmGitExtension/Assets/UpmGitExtension/Editor/Core/UpmGitUtils.cs
...tension/Assets/UpmGitExtension/Editor/Core/UpmGitUtils.cs
+10
-10
未找到文件。
UpmGitExtension/Assets/UpmGitExtension/Editor/Core/Extensions/UpmPackageVersionEx.cs
浏览文件 @
4a43be46
...
...
@@ -40,7 +40,14 @@ namespace Cocklebur
OnAfterDeserialize
();
}
public
override
IEnumerable
<
UIError
>
errors
=>
null
;
public
override
IEnumerable
<
UIError
>
errors
{
get
{
//ToDo : 以后这里需要判定错误;不要直接返回空这么暴力;
return
null
;
}
}
public
string
fullVersionString
{
get
;
private
set
;
}
public
SemVersion
semVersion
{
get
;
private
set
;
}
...
...
@@ -87,7 +94,7 @@ namespace Cocklebur
base
.
OnAfterDeserialize
();
semVersion
=
m_Version
??
new
SemVersion
();
var
revision
=
packageInfo
?.
git
?.
revision
??
""
;
var
revision
=
GetGitRevision
()
;
if
(!
revision
.
Contains
(
m_VersionString
)
&&
0
<
revision
.
Length
)
{
fullVersionString
=
$"
{
m_Version
}
(
{
revision
}
)"
;
...
...
@@ -112,7 +119,16 @@ namespace Cocklebur
{
Debug
.
LogException
(
e
);
}
}
public
string
GetGitRevision
()
{
var
pkgInfo
=
this
.
GetPackageInfo
();
if
(
pkgInfo
==
null
)
return
string
.
Empty
;
if
(
pkgInfo
.
git
==
null
)
return
string
.
Empty
;
if
(
pkgInfo
.
git
.
revision
==
null
)
return
string
.
Empty
;
return
pkgInfo
.
git
.
revision
;
}
}
}
\ No newline at end of file
UpmGitExtension/Assets/UpmGitExtension/Editor/Core/UI/GitPackageInstallationWindow.cs
浏览文件 @
4a43be46
...
...
@@ -249,7 +249,7 @@ namespace Cocklebur
private
static
string
GetShortPackageId
(
UpmPackageVersionEx
self
)
{
var
semver
=
self
.
semVersion
.
GetPkgVersionName
();
var
revision
=
self
.
Get
PackageInfo
()?.
git
?.
revision
;
var
revision
=
self
.
Get
GitRevision
()
;
return
revision
.
Contains
(
semver
)
?
$"
{
self
.
packageUniqueId
}
/
{
semver
}
"
:
$"
{
self
.
packageUniqueId
}
/
{
semver
}
(
{
revision
}
)"
;
...
...
UpmGitExtension/Assets/UpmGitExtension/Editor/Core/UpmGitUtils.cs
浏览文件 @
4a43be46
...
...
@@ -180,7 +180,10 @@ namespace Cocklebur
return
pkg
;
}
#if DEBUG_UPM_GIT
Debug
.
LogError
(
$"【UPM】未查找到 PackageInfo :
{
key
}
"
);
//To Do : 重新按照地址下载 PkgInfo ?
#endif
return
null
;
#else
return
version
.
packageInfo
;
...
...
@@ -195,15 +198,6 @@ namespace Cocklebur
SetCachePackageInfo
(
key
,
version
.
packageInfo
);
}
internal
static
PackageInfo
GetPackageInfo
(
string
pkgId
)
{
PackageInfo
info
;
if
(
dictCachePackageInfo
.
TryGetValue
(
pkgId
,
out
info
))
return
info
;
Debug
.
LogError
(
$"【UPM】未查找到 PackageInfo :
{
pkgId
}
"
);
return
null
;
}
private
static
void
SetCachePackageInfo
(
string
key
,
PackageInfo
newInfo
)
{
PackageInfo
oldInfo
;
...
...
@@ -215,7 +209,13 @@ namespace Cocklebur
if
(
string
.
IsNullOrEmpty
(
url
))
return
;
return
;
}
//To Do : 新增时需要比对;
/*
* To Do :
* 新增时需要比对;
* 现在是直接替换,但是很多数据最好是不直接替换而是比对;
* 直接替换会导致一些别的问题;
*/
dictCachePackageInfo
[
key
]
=
newInfo
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录