Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
YGOProUnity_V2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fallenstardust
YGOProUnity_V2
Commits
8da46df5
Commit
8da46df5
authored
Sep 25, 2023
by
mercury233
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update pic.LoadImage
parent
587fe386
Pipeline
#23956
failed with stages
in 3 minutes and 28 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
11 deletions
+7
-11
Assets/SibylSystem/MonoHelpers/UIHelper.cs
Assets/SibylSystem/MonoHelpers/UIHelper.cs
+6
-11
ProjectSettings/TimelineSettings.asset
ProjectSettings/TimelineSettings.asset
+1
-0
No files found.
Assets/SibylSystem/MonoHelpers/UIHelper.cs
View file @
8da46df5
...
@@ -734,10 +734,10 @@ public static class UIHelper
...
@@ -734,10 +734,10 @@ public static class UIHelper
}
}
public
static
Texture2D
GetTexture2D
(
string
path
)
public
static
Texture2D
GetTexture2D
(
string
path
)
{
{
if
(!
File
.
Exists
(
path
))
if
(!
File
.
Exists
(
path
))
{
{
return
null
;
return
null
;
}
}
var
pic
=
new
Texture2D
(
0
,
0
);
var
pic
=
new
Texture2D
(
0
,
0
);
pic
.
LoadImage
(
File
.
ReadAllBytes
(
path
));
pic
.
LoadImage
(
File
.
ReadAllBytes
(
path
));
...
@@ -747,13 +747,7 @@ public static class UIHelper
...
@@ -747,13 +747,7 @@ public static class UIHelper
public
static
async
Task
<
Texture2D
>
GetTexture2DAsync
(
string
path
)
public
static
async
Task
<
Texture2D
>
GetTexture2DAsync
(
string
path
)
{
{
var
pic
=
new
Texture2D
(
0
,
0
);
var
pic
=
new
Texture2D
(
0
,
0
);
// Unity < 2021.2
pic
.
LoadImage
(
await
File
.
ReadAllBytesAsync
(
path
));
var
stream
=
new
FileStream
(
path
,
FileMode
.
Open
,
FileAccess
.
Read
,
FileShare
.
Read
,
4096
,
true
);
var
data
=
new
byte
[
stream
.
Length
];
await
stream
.
ReadAsync
(
data
,
0
,
(
int
)
stream
.
Length
);
pic
.
LoadImage
(
data
);
// Unity >= 2021.2
// pic.LoadImage(await File.ReadAllBytesAsync(path));
return
pic
;
return
pic
;
}
}
...
@@ -764,6 +758,7 @@ public static class UIHelper
...
@@ -764,6 +758,7 @@ public static class UIHelper
ZipEntry
entry
=
zip
[
file
];
ZipEntry
entry
=
zip
[
file
];
entry
.
Extract
(
stream
);
entry
.
Extract
(
stream
);
//await Task.Run(() => { entry.Extract(stream); });
//await Task.Run(() => { entry.Extract(stream); });
//并不能这样写,这个zip库好像不支持多线程
pic
.
LoadImage
(
stream
.
ToArray
());
pic
.
LoadImage
(
stream
.
ToArray
());
return
pic
;
return
pic
;
}
}
...
...
ProjectSettings/TimelineSettings.asset
View file @
8da46df5
...
@@ -13,3 +13,4 @@ MonoBehaviour:
...
@@ -13,3 +13,4 @@ MonoBehaviour:
m_Name
:
m_Name
:
m_EditorClassIdentifier
:
m_EditorClassIdentifier
:
assetDefaultFramerate
:
60
assetDefaultFramerate
:
60
m_DefaultFrameRate
:
60
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment