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
af0f2863
Commit
af0f2863
authored
Mar 15, 2019
by
Unicorn369
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Modify notes
parent
484a29ad
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
37 deletions
+25
-37
.gitignore
.gitignore
+1
-0
Assets/SibylSystem/ResourceManagers/GameTextureManager.cs
Assets/SibylSystem/ResourceManagers/GameTextureManager.cs
+24
-31
Assets/SibylSystem/ResourceManagers/HttpDldFile.cs
Assets/SibylSystem/ResourceManagers/HttpDldFile.cs
+0
-6
No files found.
.gitignore
View file @
af0f2863
...
...
@@ -40,6 +40,7 @@ AI_core_vs2017solution/bin/
AI_core_vs2017solution/obj/
AI_core_vs2017solution/build/android/libs/
AI_core_vs2017solution/build/android/obj/
Assets/Plugins/Android/libs/x86*
# ygopro
cdb/
...
...
Assets/SibylSystem/ResourceManagers/GameTextureManager.cs
View file @
af0f2863
...
...
@@ -25,7 +25,6 @@ public class GameTextureManager
static
HttpDldFile
df
=
new
HttpDldFile
();
private
static
readonly
Semaphore
_sem
=
new
Semaphore
(
30
,
30
);
public
class
BitmapHelper
{
public
System
.
Drawing
.
Color
[,]
colors
=
null
;
...
...
@@ -228,18 +227,15 @@ public class GameTextureManager
}
if
(
pic
.
type
==
GameTextureType
.
card_feature
)
{
_sem
.
WaitOne
();
new
Thread
(()
=>
ProcessingCardFeature
(
pic
)).
Start
();
ProcessingCardFeature
(
pic
);
}
if
(
pic
.
type
==
GameTextureType
.
card_picture
)
{
_sem
.
WaitOne
();
new
Thread
(()
=>
ProcessingCardPicture
(
pic
)).
Start
();
ProcessingCardPicture
(
pic
);
}
if
(
pic
.
type
==
GameTextureType
.
card_verticle_drawing
)
{
_sem
.
WaitOne
();
new
Thread
(()
=>
ProcessingVerticleDrawing
(
pic
)).
Start
();
ProcessingVerticleDrawing
(
pic
);
}
}
}
...
...
@@ -258,6 +254,10 @@ public class GameTextureManager
if
(
File
.
Exists
(
"picture/closeup/"
+
pic
.
code
.
ToString
()
+
".png"
))
{
string
path
=
"picture/closeup/"
+
pic
.
code
.
ToString
()
+
".png"
;
/*
* Nonsupport Android x86、Only Support Android 5.0+
* https://github.com/Unicorn369/libgdiplus-Android
*/
#if UNITY_EDITOR || UNITY_STANDALONE_WIN || UNITY_ANDROID //编译器、Windows、Android
BitmapHelper
bitmap
=
new
BitmapHelper
(
path
);
int
left
;
...
...
@@ -290,11 +290,10 @@ public class GameTextureManager
caculateK
(
pic
);
/*
* 以上处理iOS平台无法正常使用
* Android已成功编译 libgdiplus.so (https://github.com/Unicorn369/libgdiplus-Android.git)
* 以上处理移动平台无法正常使用
* 暂时只能直接贴图,以后再处理
*
*/
#elif UNITY_IPHONE //
iPhone
*/
#elif UNITY_IPHONE //
|| UNITY_ANDROID //Mobile Platform
byte
[]
data
;
using
(
FileStream
file
=
new
FileStream
(
path
,
FileMode
.
Open
,
FileAccess
.
Read
))
{
...
...
@@ -392,10 +391,6 @@ public class GameTextureManager
{
Debug
.
Log
(
"e 1"
+
e
.
ToString
());
}
finally
{
_sem
.
Release
();
}
}
private
static
void
caculateK
(
PictureResource
pic
)
...
...
@@ -594,6 +589,10 @@ public class GameTextureManager
string
path
=
"picture/closeup/"
+
pic
.
code
.
ToString
()
+
".png"
;
if
(!
File
.
Exists
(
path
))
{
/*
* Nonsupport Android x86、Only Support Android 5.0+
* https://github.com/Unicorn369/libgdiplus-Android
*/
#if UNITY_EDITOR || UNITY_STANDALONE_WIN || UNITY_ANDROID //编译器、Windows、Android
path
=
"picture/card/"
+
pic
.
code
.
ToString
()
+
".png"
;
if
(!
File
.
Exists
(
path
))
...
...
@@ -630,11 +629,10 @@ public class GameTextureManager
//pic.autoMade = true;
/*
* 以上处理iOS平台无法正常使用
* Android已成功编译libgdiplus.so (https://github.com/Unicorn369/libgdiplus-Android.git)
* 以上处理移动平台无法正常使用
* 暂时只能直接贴图,以后再处理
*
*/
#elif UNITY_IPHONE //
iPhone
*/
#elif UNITY_IPHONE //
|| UNITY_ANDROID //Mobile Platform
path
=
"picture/null.png"
;
byte
[]
data
;
...
...
@@ -649,6 +647,10 @@ public class GameTextureManager
}
else
{
/*
* Nonsupport Android x86、Only Support Android 5.0+
* https://github.com/Unicorn369/libgdiplus-Android
*/
#if UNITY_EDITOR || UNITY_STANDALONE_WIN || UNITY_ANDROID //编译器、Windows、Android
BitmapHelper
bitmap
=
new
BitmapHelper
(
path
);
int
left
;
...
...
@@ -703,11 +705,10 @@ public class GameTextureManager
caculateK
(
pic
);
/*
* 以上处理iOS平台无法正常使用
* Android已成功编译libgdiplus.so (https://github.com/Unicorn369/libgdiplus-Android.git)
* 以上处理移动平台无法正常使用
* 暂时只能直接贴图,以后再处理
*
*/
#elif UNITY_IPHONE //
iPhone
*/
#elif UNITY_IPHONE //
|| UNITY_ANDROID //Mobile Platform
byte
[]
data
;
using
(
FileStream
file
=
new
FileStream
(
path
,
FileMode
.
Open
,
FileAccess
.
Read
))
{
...
...
@@ -728,10 +729,6 @@ public class GameTextureManager
{
Debug
.
Log
(
"e 3"
+
e
.
ToString
());
}
finally
{
_sem
.
Release
();
}
}
private
static
void
softVtype
(
PictureResource
pic
,
float
si
)
...
...
@@ -851,10 +848,6 @@ public class GameTextureManager
catch
(
Exception
e
)
{
Debug
.
Log
(
"e 2"
+
e
.
ToString
());
}
finally
{
_sem
.
Release
();
}
}
...
...
Assets/SibylSystem/ResourceManagers/HttpDldFile.cs
View file @
af0f2863
...
...
@@ -10,7 +10,6 @@ using UnityEngine;
public
class
HttpDldFile
{
private
readonly
System
.
Threading
.
Semaphore
semaphore
=
new
System
.
Threading
.
Semaphore
(
6
,
6
);
public
bool
Download
(
string
url
,
string
filename
)
{
bool
flag
=
false
;
...
...
@@ -33,7 +32,6 @@ public class HttpDldFile
{
client
.
Timeout
=
3500
;
}
semaphore
.
WaitOne
();
client
.
DownloadFile
(
new
Uri
(
url
),
filename
+
".tmp"
);
}
flag
=
true
;
...
...
@@ -47,10 +45,6 @@ public class HttpDldFile
{
flag
=
false
;
}
finally
{
semaphore
.
Release
();
}
return
flag
;
}
public
static
bool
MyRemoteCertificateValidationCallback
(
System
.
Object
sender
,
...
...
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