Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
yqian1000
Rebirth_DeckTool
提交
c14f7cec
R
Rebirth_DeckTool
项目概览
yqian1000
/
Rebirth_DeckTool
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
Rebirth_DeckTool
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
c14f7cec
编写于
4月 20, 2023
作者:
yqian1000
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
优化图片列表加载
上级
c9f3fe11
变更
7
显示空白变更内容
内联
并排
Showing
7 changed file
with
21 addition
and
12 deletion
+21
-12
Assets/Resources/Prefab/UI/Cards/CardListView.prefab
Assets/Resources/Prefab/UI/Cards/CardListView.prefab
+2
-2
Assets/Resources/Prefab/UI/Deck/DeckCardListView.prefab
Assets/Resources/Prefab/UI/Deck/DeckCardListView.prefab
+1
-1
Assets/Scripts/Logic/CardManager.cs
Assets/Scripts/Logic/CardManager.cs
+1
-1
Assets/Scripts/Logic/Data/Card.cs
Assets/Scripts/Logic/Data/Card.cs
+1
-1
Assets/Scripts/Logic/Data/Series.cs
Assets/Scripts/Logic/Data/Series.cs
+2
-2
Assets/Scripts/Logic/DownloadData.cs
Assets/Scripts/Logic/DownloadData.cs
+5
-1
Assets/Scripts/Logic/DownloadImage.cs
Assets/Scripts/Logic/DownloadImage.cs
+9
-4
未找到文件。
Assets/Resources/Prefab/UI/Cards/CardListView.prefab
浏览文件 @
c14f7cec
...
...
@@ -3863,9 +3863,9 @@ MonoBehaviour:
scrollRect
:
{
fileID
:
2373949832944046736
}
top
:
30
bottom
:
30
interval
:
10
interval
:
6
elem
:
{
fileID
:
-7887652861602639447
,
guid
:
690fc32fa58083545a25ccbc922a4ea5
,
type
:
3
}
elemCount
:
2
0
elemCount
:
1
0
---
!u!1
&2440221074765671710
GameObject
:
m_ObjectHideFlags
:
0
...
...
Assets/Resources/Prefab/UI/Deck/DeckCardListView.prefab
浏览文件 @
c14f7cec
...
...
@@ -298,7 +298,7 @@ MonoBehaviour:
bottom
:
30
interval
:
10
elem
:
{
fileID
:
-7887652861602639447
,
guid
:
690fc32fa58083545a25ccbc922a4ea5
,
type
:
3
}
elemCount
:
20
elemCount
:
6
---
!u!1
&1335748695387864072
GameObject
:
m_ObjectHideFlags
:
0
...
...
Assets/Scripts/Logic/CardManager.cs
浏览文件 @
c14f7cec
...
...
@@ -56,7 +56,7 @@ public class CardManager : SingletonMono<CardManager>
if
(!
File
.
Exists
(
SeriesListPath
))
{
//尝试读取Resource包体自带
TextAsset
tx
=
Resources
.
Load
<
TextAsset
>(
"data/SeriesList
.json
"
);
TextAsset
tx
=
Resources
.
Load
<
TextAsset
>(
"data/SeriesList"
);
if
(
tx
==
null
)
return
;
else
...
...
Assets/Scripts/Logic/Data/Card.cs
浏览文件 @
c14f7cec
...
...
@@ -30,7 +30,7 @@ public class Card
}
get
{
if
(
_img
==
null
)
if
(
_img
==
null
)
{
LoadImg
();
}
...
...
Assets/Scripts/Logic/Data/Series.cs
浏览文件 @
c14f7cec
...
...
@@ -102,7 +102,7 @@ public class Series
if
(!
File
.
Exists
(
path
))
{
//尝试读取本地的
TextAsset
tx
=
Resources
.
Load
<
TextAsset
>(
$"data/
{
Name
.
Replace
(
"/"
,
""
)}
/Cards
.json
"
);
TextAsset
tx
=
Resources
.
Load
<
TextAsset
>(
$"data/
{
Name
.
Replace
(
"/"
,
""
)}
/Cards"
);
if
(
tx
==
null
)
return
;
else
...
...
@@ -120,7 +120,7 @@ public class Series
for
(
int
i
=
0
;
i
<
data
.
Count
;
i
++)
{
Card
card
=
new
Card
(
data
[
i
]);
card
.
CheckImgFile
();
//
card.CheckImgFile();
AddCard
(
card
);
}
}
...
...
Assets/Scripts/Logic/DownloadData.cs
浏览文件 @
c14f7cec
...
...
@@ -165,16 +165,20 @@ public class DownloadData : SingletonMono<DownloadData>
if
(
retry
<
5
)
{
Debug
.
Log
(
$"重新尝试:
{
url
}
- 次数
{
retry
}
"
);
webRequest
.
Dispose
();
yield
return
StartCoroutine
(
DownloadText
(
url
,
success
,
fail
,
retry
+
1
));
}
else
{
fail
?.
Invoke
(
webRequest
.
error
);
webRequest
.
Dispose
();
}
yield
break
;
}
// 从网络请求中获取文本内容
string
text
=
webRequest
.
downloadHandler
.
text
;
webRequest
.
Dispose
();
success
?.
Invoke
(
text
);
...
...
Assets/Scripts/Logic/DownloadImage.cs
浏览文件 @
c14f7cec
...
...
@@ -16,7 +16,7 @@ public class DownlaodImage : SingletonMono<DownlaodImage>
Queue
<
Card
>
DownloadQueue
=
new
Queue
<
Card
>();
bool
downloading
;
Texture2D
RebirthBG
;
static
Texture2D
RebirthBG
;
/// <summary>
/// 获取一个图片
...
...
@@ -29,8 +29,8 @@ public class DownlaodImage : SingletonMono<DownlaodImage>
if
(
texture2D
==
null
)
{
texture2D
=
(
RebirthBG
==
null
)
?
LoadRebirthBG
()
:
RebirthBG
;
DownloadQueue
.
Enqueue
(
card
);
if
(!
downloading
)
StartCoroutine
(
DownLoadQueue
());
//
DownloadQueue.Enqueue(card);
//
if (!downloading) StartCoroutine(DownLoadQueue());
}
return
texture2D
;
...
...
@@ -146,6 +146,7 @@ public class DownlaodImage : SingletonMono<DownlaodImage>
downloading
=
true
;
while
(
DownloadQueue
.
TryDequeue
(
out
Card
card
))
{
//Logger.Log($"DownloadQueue:{DownloadQueue.Count}");
//尝试在Resource下加载
string
path
=
""
;
var
resq
=
Resources
.
LoadAsync
<
Texture2D
>(
path
);
...
...
@@ -161,6 +162,9 @@ public class DownlaodImage : SingletonMono<DownlaodImage>
else
//没有则下载
yield
return
StartCoroutine
(
DownloadingImg
(
card
));
yield
return
null
;
}
downloading
=
false
;
}
...
...
@@ -182,10 +186,11 @@ public class DownlaodImage : SingletonMono<DownlaodImage>
Debug
.
Log
(
$"重新尝试:
{
card
.
Num
}
- 次数
{
retry
}
"
);
yield
return
StartCoroutine
(
DownloadingImg
(
card
,
retry
+
1
));
}
webRequest
.
Dispose
();
yield
break
;
}
byte
[]
bytes
=
webRequest
.
downloadHandler
.
data
;
webRequest
.
Dispose
();
Texture2D
texture
=
null
;
if
(
card
.
Type
==
CardType
.
Rebirth
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录