Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
zwt069074237
UPM解决方案:苍耳
提交
331a1f59
UPM解决方案:苍耳
项目概览
zwt069074237
/
UPM解决方案:苍耳
与 Fork 源项目一致
Fork自
魔术师Dix / UPM解决方案:苍耳
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
UPM解决方案:苍耳
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
331a1f59
编写于
1月 12, 2023
作者:
魔术师Dix
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
【UpmGitTool】手动拉取Git包的方法;
上级
83f7f1d7
变更
4
展开全部
隐藏空白更改
内联
并排
Showing
4 changed file
with
1466 addition
and
311 deletion
+1466
-311
UpmGitTool/Assets/Scenes/SampleScene.unity
UpmGitTool/Assets/Scenes/SampleScene.unity
+1360
-306
UpmGitTool/Assets/Scritps/Core/CoreFunction.cs
UpmGitTool/Assets/Scritps/Core/CoreFunction.cs
+8
-5
UpmGitTool/Assets/Scritps/UI/Controller/UICtrl_ManualFetch.cs
...itTool/Assets/Scritps/UI/Controller/UICtrl_ManualFetch.cs
+87
-0
UpmGitTool/Assets/Scritps/UI/Controller/UICtrl_ManualFetch.cs.meta
...l/Assets/Scritps/UI/Controller/UICtrl_ManualFetch.cs.meta
+11
-0
未找到文件。
UpmGitTool/Assets/Scenes/SampleScene.unity
浏览文件 @
331a1f59
此差异已折叠。
点击以展开。
UpmGitTool/Assets/Scritps/Core/CoreFunction.cs
浏览文件 @
331a1f59
using
System.Collections.Generic
;
using
System.IO
;
using
System.Security.Cryptography
;
namespace
UpmGitTool
{
...
...
@@ -18,7 +17,7 @@ namespace UpmGitTool
{
var
name
=
version
.
Name
;
var
gitPath
=
version
.
GitUrl
;
AppState
.
unityManifes
?.
InstallVersion
(
name
,
gitPath
);
AppState
.
unityManifes
?.
InstallVersion
(
name
,
gitPath
);
}
public
static
void
InstallVersion
(
this
DependencyInfo
depency
)
...
...
@@ -111,7 +110,7 @@ namespace UpmGitTool
/// <param name="targetVer">目标版本</param>
public
static
bool
IsCurrentVersionNewer
(
string
curVer
,
string
targetVer
)
{
var
cV
=
SemVersion
.
Parse
(
curVer
);
var
cV
=
SemVersion
.
Parse
(
curVer
);
var
tV
=
SemVersion
.
Parse
(
targetVer
);
return
cV
>=
tV
;
}
...
...
@@ -154,12 +153,16 @@ namespace UpmGitTool
{
if
(
pkg
==
null
)
return
;
var
gitUrl
=
pkg
.
PackageUrl
;
pkg
.
FetchReq
=
StartFetchGitUrl
(
gitUrl
);
}
public
static
GitFetchReq
StartFetchGitUrl
(
string
gitUrl
)
{
GitFetchReq
req
=
new
GitFetchReq
(
gitUrl
);
pkg
.
FetchReq
=
req
;
QueueGitFetchReq
.
Enqueue
(
req
);
req
.
State
=
E_FetchState
.
Waitting
;
GYEventsCenter
.
PostNotification
(
Lib
.
ON_ADD_GIT_FETCH_REQ
,
QueueGitFetchReq
);
return
req
;
}
/// <summary>
...
...
UpmGitTool/Assets/Scritps/UI/Controller/UICtrl_ManualFetch.cs
0 → 100644
浏览文件 @
331a1f59
/*
*Copyright(C) 2023 by Cocklebur All rights reserved.
*Unity版本:2022.2.1f1c1
*作者:Chief
*创建日期: 2023-01-12
*模块说明:模板信息
*版本: 1.0
*/
using
Sirenix.OdinInspector
;
using
TMPro
;
using
UnityEngine
;
using
UnityEngine.UI
;
namespace
UpmGitTool.UI
{
/// <summary>
/// 手动拉取控件
/// </summary>
public
class
UICtrl_ManualFetch
:
MonoBehaviour
{
[
LabelText
(
"打开按钮"
)]
public
Button
BtnOpen
;
[
LabelText
(
"关闭按钮"
)]
public
Button
BtnClose
;
[
LabelText
(
"拉取按钮"
)]
public
Button
BtnFetch
;
[
LabelText
(
"Git拉取地址输入框"
)]
public
TMP_InputField
GitPathInputFiled
;
private
void
Start
()
{
BtnOpen
.
onClick
.
AddListener
(
Open
);
BtnClose
.
onClick
.
AddListener
(
Close
);
BtnFetch
.
onClick
.
AddListener
(
Fetch
);
GitPathInputFiled
.
onEndEdit
.
AddListener
(
CheckGitPath
);
Close
();
}
private
void
Open
()
{
SetActive
(
true
);
CheckGitPath
(
GitPathInputFiled
.
text
);
}
private
void
Close
()
{
SetActive
(
false
);
GitPathInputFiled
.
text
=
string
.
Empty
;
}
private
void
SetActive
(
bool
active
)
{
BtnOpen
.
gameObject
.
SetActive
(!
active
);
BtnClose
.
gameObject
.
SetActive
(
active
);
BtnFetch
.
gameObject
.
SetActive
(
active
);
GitPathInputFiled
.
gameObject
.
SetActive
(
active
);
}
private
void
CheckGitPath
(
string
path
)
{
bool
pathError
=
IsGitPathError
(
path
);
BtnFetch
.
interactable
=
!
pathError
;
}
private
bool
IsGitPathError
(
string
path
)
{
if
(
string
.
IsNullOrEmpty
(
path
))
return
true
;
if
(
string
.
IsNullOrWhiteSpace
(
path
))
return
true
;
if
(!
path
.
Contains
(
"git"
))
return
false
;
return
false
;
}
private
void
Fetch
()
{
string
path
=
GitPathInputFiled
.
text
;
if
(
IsGitPathError
(
path
))
return
;
//从Git上拉取所有包;
CoreFunction
.
StartFetchGitUrl
(
path
);
Close
();
}
}
}
\ No newline at end of file
UpmGitTool/Assets/Scritps/UI/Controller/UICtrl_ManualFetch.cs.meta
0 → 100644
浏览文件 @
331a1f59
fileFormatVersion: 2
guid: c133d8fb396b41547a0b13a337da2d33
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录