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
赤子奈落
YGOProUnity_V2
Commits
ab7b6822
Commit
ab7b6822
authored
Aug 22, 2020
by
mercury233
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update picture loading
parent
a0c8e33c
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
167 additions
and
118 deletions
+167
-118
Assets/SibylSystem/Ocgcore/OCGobjects/gameField.cs
Assets/SibylSystem/Ocgcore/OCGobjects/gameField.cs
+25
-27
Assets/SibylSystem/Program.cs
Assets/SibylSystem/Program.cs
+3
-1
Assets/SibylSystem/ResourceManagers/GameTextureManager.cs
Assets/SibylSystem/ResourceManagers/GameTextureManager.cs
+139
-90
No files found.
Assets/SibylSystem/Ocgcore/OCGobjects/gameField.cs
View file @
ab7b6822
...
...
@@ -2,6 +2,7 @@
using
System
;
using
System.Collections.Generic
;
using
System.IO
;
using
System.Text.RegularExpressions
;
using
UnityEngine
;
using
YGOSharp.OCGWrapper.Enums
;
...
...
@@ -424,38 +425,35 @@ public class GameField : OCGobject
fieldCode
[
player
]
=
code
;
if
(
code
>
0
)
{
Texture2D
tex
;
if
(
File
.
Exists
(
"picture/field/"
+
code
.
ToString
()
+
".png"
))
Texture2D
tex
=
null
;
bool
found
=
false
;
foreach
(
ZipFile
zip
in
GameZipManager
.
Zips
)
{
tex
=
UIHelper
.
getTexture2D
(
"picture/field/"
+
code
.
ToString
()
+
".png"
);
}
else
if
(
File
.
Exists
(
"picture/field/"
+
code
.
ToString
()
+
".jpg"
))
{
tex
=
UIHelper
.
getTexture2D
(
"picture/field/"
+
code
.
ToString
()
+
".jpg"
);
}
else
{
tex
=
null
;
bool
found
=
false
;
foreach
(
ZipFile
zip
in
GameZipManager
.
Zips
)
if
(
zip
.
Name
.
ToLower
().
EndsWith
(
"script.zip"
))
continue
;
foreach
(
string
file
in
zip
.
EntryFileNames
)
{
foreach
(
string
file
in
zip
.
EntryFileNames
)
if
(
Regex
.
IsMatch
(
file
.
ToLower
(),
"field/"
+
code
.
ToString
()
+
"\\.(jpg|png)$"
)
)
{
string
file1
=
file
.
ToLower
();
if
(
file1
.
EndsWith
(
code
.
ToString
()
+
".jpg"
)
&&
file1
.
Contains
(
"field"
))
{
MemoryStream
ms
=
new
MemoryStream
();
ZipEntry
e
=
zip
[
file
];
e
.
Extract
(
ms
);
tex
=
new
Texture2D
(
1024
,
600
);
tex
.
LoadImage
(
ms
.
ToArray
());
found
=
true
;
break
;
}
}
if
(
found
)
MemoryStream
ms
=
new
MemoryStream
();
ZipEntry
e
=
zip
[
file
];
e
.
Extract
(
ms
);
tex
=
new
Texture2D
(
1024
,
600
);
tex
.
LoadImage
(
ms
.
ToArray
());
found
=
true
;
break
;
}
}
if
(
found
)
break
;
}
if
(
tex
==
null
)
{
tex
=
UIHelper
.
getTexture2D
(
"picture/field/"
+
code
.
ToString
()
+
".png"
);
}
if
(
tex
==
null
)
{
tex
=
UIHelper
.
getTexture2D
(
"picture/field/"
+
code
.
ToString
()
+
".jpg"
);
}
if
(
tex
!=
null
)
{
...
...
Assets/SibylSystem/Program.cs
View file @
ab7b6822
...
...
@@ -287,7 +287,7 @@ public class Program : MonoBehaviour
});
go
(
300
,
()
=>
{
InterString
.
initialize
(
"config/translation.conf"
);
InterString
.
initialize
(
"config/translation.conf"
);
GameTextureManager
.
initialize
();
Config
.
initialize
(
"config/config.conf"
);
...
...
@@ -324,6 +324,8 @@ public class Program : MonoBehaviour
foreach
(
ZipFile
zip
in
GameZipManager
.
Zips
)
{
if
(
zip
.
Name
.
ToLower
().
EndsWith
(
"script.zip"
))
continue
;
foreach
(
string
file
in
zip
.
EntryFileNames
)
{
if
(
file
.
ToLower
().
EndsWith
(
".conf"
))
...
...
Assets/SibylSystem/ResourceManagers/GameTextureManager.cs
View file @
ab7b6822
This diff is collapsed.
Click to expand it.
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