Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro2
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
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
nanahira
ygopro2
Commits
e6bc3153
Commit
e6bc3153
authored
Jan 16, 2019
by
Unicorn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
临时解决立绘无法使用问题
parent
286b1a3f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
66 additions
and
6 deletions
+66
-6
Assets/SibylSystem/ResourceManagers/GameTextureManager.cs
Assets/SibylSystem/ResourceManagers/GameTextureManager.cs
+66
-6
No files found.
Assets/SibylSystem/ResourceManagers/GameTextureManager.cs
View file @
e6bc3153
...
...
@@ -273,6 +273,7 @@ public class GameTextureManager
if
(
File
.
Exists
(
"picture/closeup/"
+
pic
.
code
.
ToString
()
+
".png"
))
{
string
path
=
"picture/closeup/"
+
pic
.
code
.
ToString
()
+
".png"
;
#
if
UNITY_EDITOR
||
UNITY_STANDALONE_WIN
//编译器、Windows
BitmapHelper
bitmap
=
new
BitmapHelper
(
path
);
int
left
;
int
right
;
...
...
@@ -303,6 +304,21 @@ public class GameTextureManager
}
caculateK
(
pic
);
/*
* 以上处理其他平台无法正常使用
* 暂时只能直接贴图,以后再处理
*/
#
elif
UNITY_ANDROID
||
UNITY_IPHONE
//Android、iPhone
byte
[]
data
;
using
(
FileStream
file
=
new
FileStream
(
path
,
FileMode
.
Open
,
FileAccess
.
Read
))
{
file
.
Seek
(
0
,
SeekOrigin
.
Begin
);
data
=
new
byte
[
file
.
Length
];
file
.
Read
(
data
,
0
,
(
int
)
file
.
Length
);
}
pic
.
data
=
data
;
#
endif
if
(!
loadedList
.
ContainsKey
(
hashPic
(
pic
.
code
,
pic
.
type
)))
{
loadedList
.
Add
(
hashPic
(
pic
.
code
,
pic
.
type
),
pic
);
...
...
@@ -581,6 +597,7 @@ public class GameTextureManager
string
path
=
"picture/closeup/"
+
pic
.
code
.
ToString
()
+
".png"
;
if
(!
File
.
Exists
(
path
))
{
#
if
UNITY_EDITOR
||
UNITY_STANDALONE_WIN
//编译器、Windows
path
=
"picture/card/"
+
pic
.
code
.
ToString
()
+
".png"
;
if
(!
File
.
Exists
(
path
))
{
...
...
@@ -614,9 +631,31 @@ public class GameTextureManager
softVtype
(
pic
,
0.5f
);
pic
.
k
=
1
;
//pic.autoMade = true;
/*
* 以上处理其他平台无法正常使用
* 暂时只能直接贴图,以后再处理
*/
#
elif
UNITY_ANDROID
||
UNITY_IPHONE
//Android、iPhone
path
=
"picture/null/"
+
pic
.
code
.
ToString
()
+
".png"
;
if
(!
File
.
Exists
(
path
))
{
path
=
"picture/null.png"
;
}
byte
[]
data
;
using
(
FileStream
file
=
new
FileStream
(
path
,
FileMode
.
Open
,
FileAccess
.
Read
))
{
file
.
Seek
(
0
,
SeekOrigin
.
Begin
);
data
=
new
byte
[
file
.
Length
];
file
.
Read
(
data
,
0
,
(
int
)
file
.
Length
);
}
pic
.
data
=
data
;
#
endif
}
else
{
#
if
UNITY_EDITOR
||
UNITY_STANDALONE_WIN
//编译器、Windows
BitmapHelper
bitmap
=
new
BitmapHelper
(
path
);
int
left
;
int
right
;
...
...
@@ -668,6 +707,21 @@ public class GameTextureManager
softVtype
(
pic
,
0.7f
);
}
caculateK
(
pic
);
/*
* 以上处理其他平台无法正常使用
* 暂时只能直接贴图,以后再处理
*/
#
elif
UNITY_ANDROID
||
UNITY_IPHONE
//Android、iPhone
byte
[]
data
;
using
(
FileStream
file
=
new
FileStream
(
path
,
FileMode
.
Open
,
FileAccess
.
Read
))
{
file
.
Seek
(
0
,
SeekOrigin
.
Begin
);
data
=
new
byte
[
file
.
Length
];
file
.
Read
(
data
,
0
,
(
int
)
file
.
Length
);
}
pic
.
data
=
data
;
#
endif
}
if
(!
loadedList
.
ContainsKey
(
hashPic
(
pic
.
code
,
pic
.
type
)))
...
...
@@ -708,7 +762,7 @@ public class GameTextureManager
if
(
a
>
alpha
)
a
=
alpha
;
}
if
(
w
<
empWidth
)
if
(
a
>
((
float
)
w
)
/
(
float
)
empWidth
)
a
=
((
float
)
w
)
/
(
float
)
empWidth
;
...
...
@@ -755,15 +809,21 @@ public class GameTextureManager
}
if
(!
File
.
Exists
(
path
)
&&
pic
.
code
!=
0
)
{
//下载卡图
df
.
Download
(
"http://
update.ygopro.win/ygopro2-data/picture/card
/"
+
pic
.
code
.
ToString
()
+
".jpg"
,
"expansions/pics/"
+
pic
.
code
.
ToString
()
+
".jpg"
);
//下载卡图
(177x254)
df
.
Download
(
"http://
android.ygopro.win/YGOMobile/pics
/"
+
pic
.
code
.
ToString
()
+
".jpg"
,
"expansions/pics/"
+
pic
.
code
.
ToString
()
+
".jpg"
);
path
=
"expansions/pics/"
+
pic
.
code
.
ToString
()
+
".jpg"
;
}
if
(!
File
.
Exists
(
path
)
&&
pic
.
code
!=
0
)
{
//下载先行卡卡图
df
.
Download
(
"http://update.ygopro.win/ygopro2-data/expansions/pics/"
+
pic
.
code
.
ToString
()
+
".jpg"
,
"expansions/pics/"
+
pic
.
code
.
ToString
()
+
".jpg"
);
path
=
"expansions/pics/"
+
pic
.
code
.
ToString
()
+
".jpg"
;
//下载卡图(421x614)
df
.
Download
(
"http://update.ygopro.win/ygopro2-data/picture/card/"
+
pic
.
code
.
ToString
()
+
".jpg"
,
"picture/card/"
+
pic
.
code
.
ToString
()
+
".jpg"
);
path
=
"picture/card/"
+
pic
.
code
.
ToString
()
+
".jpg"
;
}
if
(!
File
.
Exists
(
path
)
&&
pic
.
code
!=
0
)
{
//下载先行卡卡图(336x490)
df
.
Download
(
"http://update.ygopro.win/ygopro2-data/expansions/pics/"
+
pic
.
code
.
ToString
()
+
".jpg"
,
"picture/cardIn8thEdition/"
+
pic
.
code
.
ToString
()
+
".jpg"
);
path
=
"picture/cardIn8thEdition/"
+
pic
.
code
.
ToString
()
+
".jpg"
;
}
if
(!
File
.
Exists
(
path
))
{
...
...
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