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
1
Issues
1
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
hex
ygopro2
Commits
4694efba
Commit
4694efba
authored
Jun 14, 2025
by
hex
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
set default resolution to 1600x900
parent
b8b5d27a
Pipeline
#37628
failed
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
309 additions
and
171 deletions
+309
-171
Assets/SibylSystem/CardDescription/CardDescription.cs
Assets/SibylSystem/CardDescription/CardDescription.cs
+60
-42
Assets/SibylSystem/ResourceManagers/GameTextureManager.cs
Assets/SibylSystem/ResourceManagers/GameTextureManager.cs
+119
-81
Assets/SibylSystem/ResourceManagers/UnityFileDownloader.cs
Assets/SibylSystem/ResourceManagers/UnityFileDownloader.cs
+0
-2
Assets/SibylSystem/Setting/Setting.cs
Assets/SibylSystem/Setting/Setting.cs
+130
-46
No files found.
Assets/SibylSystem/CardDescription/CardDescription.cs
View file @
4694efba
using
UnityEngine
;
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
UnityEngine
;
using
YGOSharp.OCGWrapper.Enums
;
using
YGOSharp.OCGWrapper.Enums
;
public
class
CardDescription
:
Servant
public
class
CardDescription
:
Servant
...
@@ -20,14 +20,13 @@ public class CardDescription : Servant
...
@@ -20,14 +20,13 @@ public class CardDescription : Servant
public
override
void
initialize
()
public
override
void
initialize
()
{
{
gameObject
=
create
gameObject
=
create
(
(
Program
.
I
().
new_ui_cardDescription
,
Program
.
I
().
new_ui_cardDescription
,
Program
.
camera_main_2d
.
ScreenToWorldPoint
(
new
Vector3
(-
256
,
Screen
.
height
/
2
,
600
)),
Program
.
camera_main_2d
.
ScreenToWorldPoint
(
new
Vector3
(-
256
,
Screen
.
height
/
2
,
600
)),
new
Vector3
(
0
,
0
,
0
),
new
Vector3
(
0
,
0
,
0
),
true
,
true
,
Program
.
ui_back_ground_2d
Program
.
ui_back_ground_2d
);
);
picLoader
=
gameObject
.
AddComponent
<
cardPicLoader
>();
picLoader
=
gameObject
.
AddComponent
<
cardPicLoader
>();
picLoader
.
code
=
0
;
picLoader
.
code
=
0
;
picLoader
.
uiTexture
=
UIHelper
.
getByName
<
UITexture
>(
gameObject
,
"pic_"
);
picLoader
.
uiTexture
=
UIHelper
.
getByName
<
UITexture
>(
gameObject
,
"pic_"
);
...
@@ -39,19 +38,17 @@ public class CardDescription : Servant
...
@@ -39,19 +38,17 @@ public class CardDescription : Servant
monitor
=
UIHelper
.
getByName
<
UIPanel
>(
gameObject
,
"monitor"
);
monitor
=
UIHelper
.
getByName
<
UIPanel
>(
gameObject
,
"monitor"
);
deckPanel
=
gameObject
.
GetComponentInChildren
<
UIDeckPanel
>();
deckPanel
=
gameObject
.
GetComponentInChildren
<
UIDeckPanel
>();
line
=
UIHelper
.
getByName
(
gameObject
,
"line"
);
line
=
UIHelper
.
getByName
(
gameObject
,
"line"
);
UIHelper
.
registEvent
(
gameObject
,
"pre_"
,
onPre
);
UIHelper
.
registEvent
(
gameObject
,
"pre_"
,
onPre
);
UIHelper
.
registEvent
(
gameObject
,
"next_"
,
onNext
);
UIHelper
.
registEvent
(
gameObject
,
"next_"
,
onNext
);
UIHelper
.
registEvent
(
gameObject
,
"big_"
,
onb
);
UIHelper
.
registEvent
(
gameObject
,
"big_"
,
onb
);
UIHelper
.
registEvent
(
gameObject
,
"small_"
,
ons
);
UIHelper
.
registEvent
(
gameObject
,
"small_"
,
ons
);
picSprite
=
UIHelper
.
getByName
<
UITexture
>(
gameObject
,
"pic_"
);
picSprite
=
UIHelper
.
getByName
<
UITexture
>(
gameObject
,
"pic_"
);
lineSprite
=
UIHelper
.
getByName
<
UISprite
>(
gameObject
,
"line"
);
lineSprite
=
UIHelper
.
getByName
<
UISprite
>(
gameObject
,
"line"
);
try
try
{
{
description
.
textLabel
.
fontSize
=
int
.
Parse
(
Config
.
Get
(
"fontSize"
,
"24"
));
description
.
textLabel
.
fontSize
=
int
.
Parse
(
Config
.
Get
(
"fontSize"
,
"24"
));
}
catch
(
System
.
Exception
e
)
{
}
}
catch
(
System
.
Exception
e
)
{
}
read
();
read
();
myGraveStr
=
InterString
.
Get
(
"我方墓地:"
);
myGraveStr
=
InterString
.
Get
(
"我方墓地:"
);
myExtraStr
=
InterString
.
Get
(
"我方额外:"
);
myExtraStr
=
InterString
.
Get
(
"我方额外:"
);
...
@@ -103,7 +100,13 @@ public class CardDescription : Servant
...
@@ -103,7 +100,13 @@ public class CardDescription : Servant
if
(
gameObject
!=
null
)
if
(
gameObject
!=
null
)
{
{
underSprite
.
height
=
Screen
.
height
+
4
;
underSprite
.
height
=
Screen
.
height
+
4
;
iTween
.
MoveTo
(
gameObject
,
Program
.
camera_main_2d
.
ScreenToWorldPoint
(
new
Vector3
(-
underSprite
.
width
-
20
,
Screen
.
height
/
2
,
0
)),
1.2f
);
iTween
.
MoveTo
(
gameObject
,
Program
.
camera_main_2d
.
ScreenToWorldPoint
(
new
Vector3
(-
underSprite
.
width
-
20
,
Screen
.
height
/
2
,
0
)
),
1.2f
);
setTitle
(
""
);
setTitle
(
""
);
resizer
.
gameObject
.
GetComponent
<
BoxCollider
>().
enabled
=
false
;
resizer
.
gameObject
.
GetComponent
<
BoxCollider
>().
enabled
=
false
;
}
}
...
@@ -114,7 +117,11 @@ public class CardDescription : Servant
...
@@ -114,7 +117,11 @@ public class CardDescription : Servant
if
(
gameObject
!=
null
)
if
(
gameObject
!=
null
)
{
{
underSprite
.
height
=
Screen
.
height
+
4
;
underSprite
.
height
=
Screen
.
height
+
4
;
iTween
.
MoveTo
(
gameObject
,
Program
.
camera_main_2d
.
ScreenToWorldPoint
(
new
Vector3
(-
2
,
Screen
.
height
/
2
,
0
)),
1.2f
);
iTween
.
MoveTo
(
gameObject
,
Program
.
camera_main_2d
.
ScreenToWorldPoint
(
new
Vector3
(-
2
,
Screen
.
height
/
2
,
0
)),
1.2f
);
resizer
.
gameObject
.
GetComponent
<
BoxCollider
>().
enabled
=
true
;
resizer
.
gameObject
.
GetComponent
<
BoxCollider
>().
enabled
=
true
;
}
}
}
}
...
@@ -132,11 +139,9 @@ public class CardDescription : Servant
...
@@ -132,11 +139,9 @@ public class CardDescription : Servant
ca
=
(
int
)(
cb
*
0.68
)
+
50
;
ca
=
(
int
)(
cb
*
0.68
)
+
50
;
}
}
underSprite
.
width
=
ca
;
underSprite
.
width
=
ca
;
picSprite
.
height
=
cb
;
picSprite
.
height
=
cb
;
}
catch
(
System
.
Exception
e
)
{
}
}
catch
(
System
.
Exception
e
)
{
}
}
}
public
void
save
()
public
void
save
()
...
@@ -176,7 +181,7 @@ public class CardDescription : Servant
...
@@ -176,7 +181,7 @@ public class CardDescription : Servant
YGOSharp
.
Card
currentCard
=
null
;
YGOSharp
.
Card
currentCard
=
null
;
public
bool
ifShowingThisCard
(
YGOSharp
.
Card
card
)
public
bool
ifShowingThisCard
(
YGOSharp
.
Card
card
)
{
{
return
currentCard
==
card
;
return
currentCard
==
card
;
}
}
...
@@ -210,7 +215,13 @@ public class CardDescription : Servant
...
@@ -210,7 +215,13 @@ public class CardDescription : Servant
picLoader
.
loaded_code
=
-
1
;
picLoader
.
loaded_code
=
-
1
;
currentCard
=
card
;
currentCard
=
card
;
shiftCardShower
(
true
);
shiftCardShower
(
true
);
Program
.
go
(
50
,
()
=>
{
shiftCardShower
(
true
);
});
Program
.
go
(
50
,
()
=>
{
shiftCardShower
(
true
);
}
);
}
}
public
void
shiftCardShower
(
bool
show
)
public
void
shiftCardShower
(
bool
show
)
...
@@ -244,7 +255,6 @@ public class CardDescription : Servant
...
@@ -244,7 +255,6 @@ public class CardDescription : Servant
string
opExtraStr
=
""
;
string
opExtraStr
=
""
;
string
opBanishedStr
=
""
;
string
opBanishedStr
=
""
;
public
void
realizeMonitor
()
public
void
realizeMonitor
()
{
{
if
(
monitor
.
gameObject
.
activeInHierarchy
)
if
(
monitor
.
gameObject
.
activeInHierarchy
)
...
@@ -322,14 +332,18 @@ public class CardDescription : Servant
...
@@ -322,14 +332,18 @@ public class CardDescription : Servant
int
eachLine
=
0
;
int
eachLine
=
0
;
float
monitorHeight
=
0
;
float
monitorHeight
=
0
;
void
handleMonitorArea
(
List
<
gameCard
>
list
,
string
hint
)
void
handleMonitorArea
(
List
<
gameCard
>
list
,
string
hint
)
{
{
if
(
list
.
Count
>
0
)
if
(
list
.
Count
>
0
)
{
{
deckPanel
.
labs
[
currentLabelIndex
].
gameObject
.
SetActive
(
true
);
deckPanel
.
labs
[
currentLabelIndex
].
gameObject
.
SetActive
(
true
);
deckPanel
.
labs
[
currentLabelIndex
].
text
=
hint
;
deckPanel
.
labs
[
currentLabelIndex
].
text
=
hint
;
deckPanel
.
labs
[
currentLabelIndex
].
width
=
(
int
)(
monitor
.
width
-
12
);
deckPanel
.
labs
[
currentLabelIndex
].
width
=
(
int
)(
monitor
.
width
-
12
);
deckPanel
.
labs
[
currentLabelIndex
].
transform
.
localPosition
=
new
Vector3
(
monitor
.
width
/
2
,
(
monitor
.
height
-
8
)
/
2
-
12
-
currentHeight
,
0
);
deckPanel
.
labs
[
currentLabelIndex
].
transform
.
localPosition
=
new
Vector3
(
monitor
.
width
/
2
,
(
monitor
.
height
-
8
)
/
2
-
12
-
currentHeight
,
0
);
currentLabelIndex
++;
currentLabelIndex
++;
currentHeight
+=
24
;
currentHeight
+=
24
;
float
beginX
=
6
+
22
;
float
beginX
=
6
+
22
;
...
@@ -339,7 +353,11 @@ public class CardDescription : Servant
...
@@ -339,7 +353,11 @@ public class CardDescription : Servant
{
{
var
gp
=
UIHelper
.
get_hang_lie
(
i
,
eachLine
);
var
gp
=
UIHelper
.
get_hang_lie
(
i
,
eachLine
);
quickCards
[
currentCardIndex
].
reCode
(
list
[
i
].
get_data
().
Id
);
quickCards
[
currentCardIndex
].
reCode
(
list
[
i
].
get_data
().
Id
);
quickCards
[
currentCardIndex
].
transform
.
localPosition
=
new
Vector3
(
beginX
+
44
*
gp
.
y
,
beginY
-
60
*
gp
.
x
,
0
);
quickCards
[
currentCardIndex
].
transform
.
localPosition
=
new
Vector3
(
beginX
+
44
*
gp
.
y
,
beginY
-
60
*
gp
.
x
,
0
);
currentCardIndex
++;
currentCardIndex
++;
}
}
int
hangshu
=
list
.
Count
/
eachLine
;
int
hangshu
=
list
.
Count
/
eachLine
;
...
@@ -351,7 +369,7 @@ public class CardDescription : Servant
...
@@ -351,7 +369,7 @@ public class CardDescription : Servant
currentHeight
+=
60
*
hangshu
;
currentHeight
+=
60
*
hangshu
;
}
}
}
}
public
void
onResized
()
public
void
onResized
()
{
{
if
(
monitor
.
gameObject
.
activeInHierarchy
)
if
(
monitor
.
gameObject
.
activeInHierarchy
)
...
@@ -366,9 +384,9 @@ public class CardDescription : Servant
...
@@ -366,9 +384,9 @@ public class CardDescription : Servant
}
}
}
}
public
void
setData
(
YGOSharp
.
Card
card
,
Texture2D
def
,
string
tail
=
""
,
bool
force
=
false
)
public
void
setData
(
YGOSharp
.
Card
card
,
Texture2D
def
,
string
tail
=
""
,
bool
force
=
false
)
{
{
if
(
cardShowerWidget
.
alpha
==
0
&&
force
==
false
)
if
(
cardShowerWidget
.
alpha
==
0
&&
force
==
false
)
{
{
return
;
return
;
}
}
...
@@ -378,7 +396,7 @@ public class CardDescription : Servant
...
@@ -378,7 +396,7 @@ public class CardDescription : Servant
}
}
if
(
card
.
Id
==
0
)
if
(
card
.
Id
==
0
)
{
{
apply
(
card
,
def
,
tail
);
apply
(
card
,
def
,
tail
);
return
;
return
;
}
}
if
(
datas
.
Count
>
0
)
if
(
datas
.
Count
>
0
)
...
@@ -389,7 +407,7 @@ public class CardDescription : Servant
...
@@ -389,7 +407,7 @@ public class CardDescription : Servant
{
{
card
=
card
,
card
=
card
,
def
=
def
,
def
=
def
,
tail
=
tail
tail
=
tail
,
};
};
if
(
datas
.
Count
>
300
)
if
(
datas
.
Count
>
300
)
{
{
...
@@ -400,13 +418,15 @@ public class CardDescription : Servant
...
@@ -400,13 +418,15 @@ public class CardDescription : Servant
return
;
return
;
}
}
}
}
datas
.
Add
(
new
data
datas
.
Add
(
{
new
data
card
=
card
,
{
def
=
def
,
card
=
card
,
tail
=
tail
def
=
def
,
});
tail
=
tail
,
if
(
datas
.
Count
>
300
)
}
);
if
(
datas
.
Count
>
300
)
{
{
datas
.
RemoveAt
(
0
);
datas
.
RemoveAt
(
0
);
}
}
...
@@ -416,7 +436,7 @@ public class CardDescription : Servant
...
@@ -416,7 +436,7 @@ public class CardDescription : Servant
public
void
setTitle
(
string
title
)
public
void
setTitle
(
string
title
)
{
{
UIHelper
.
trySetLableText
(
gameObject
,
"title_"
,
title
);
UIHelper
.
trySetLableText
(
gameObject
,
"title_"
,
title
);
}
}
List
<
string
>
Logs
=
new
List
<
string
>();
List
<
string
>
Logs
=
new
List
<
string
>();
...
@@ -442,7 +462,7 @@ public class CardDescription : Servant
...
@@ -442,7 +462,7 @@ public class CardDescription : Servant
void
clearOneLog
()
void
clearOneLog
()
{
{
if
(
Logs
.
Count
>
0
)
if
(
Logs
.
Count
>
0
)
{
{
Logs
.
RemoveAt
(
0
);
Logs
.
RemoveAt
(
0
);
string
all
=
""
;
string
all
=
""
;
...
@@ -454,17 +474,15 @@ public class CardDescription : Servant
...
@@ -454,17 +474,15 @@ public class CardDescription : Servant
{
{
all
=
all
.
Substring
(
0
,
all
.
Length
-
1
);
all
=
all
.
Substring
(
0
,
all
.
Length
-
1
);
}
}
catch
(
System
.
Exception
e
)
catch
(
System
.
Exception
e
)
{
}
{
}
UIHelper
.
trySetLableTextList
(
UIHelper
.
getByName
(
gameObject
,
"chat_"
),
all
);
UIHelper
.
trySetLableTextList
(
UIHelper
.
getByName
(
gameObject
,
"chat_"
),
all
);
}
}
else
else
{
{
UIHelper
.
trySetLableTextList
(
UIHelper
.
getByName
(
gameObject
,
"chat_"
),
""
);
UIHelper
.
trySetLableTextList
(
UIHelper
.
getByName
(
gameObject
,
"chat_"
),
""
);
}
}
}
}
public
void
clearAllLog
()
public
void
clearAllLog
()
{
{
Program
.
notGo
(
clearOneLog
);
Program
.
notGo
(
clearOneLog
);
...
...
Assets/SibylSystem/ResourceManagers/GameTextureManager.cs
View file @
4694efba
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.Drawing
;
using
System.Drawing
;
using
System.Drawing.Imaging
;
using
System.Drawing.Imaging
;
using
System.Collections.Generic
;
using
System.IO
;
using
System.IO
;
using
System.Threading
;
using
System.Threading
;
using
UnityEngine
;
using
UnityEngine
;
...
@@ -29,6 +29,7 @@ public class GameTextureManager
...
@@ -29,6 +29,7 @@ public class GameTextureManager
public
class
BitmapHelper
public
class
BitmapHelper
{
{
public
System
.
Drawing
.
Color
[,]
colors
=
null
;
public
System
.
Drawing
.
Color
[,]
colors
=
null
;
public
BitmapHelper
(
string
path
)
public
BitmapHelper
(
string
path
)
{
{
Bitmap
bitmap
;
Bitmap
bitmap
;
...
@@ -47,7 +48,11 @@ public class GameTextureManager
...
@@ -47,7 +48,11 @@ public class GameTextureManager
}
}
}
}
}
}
var
bmpData
=
bitmap
.
LockBits
(
new
Rectangle
(
0
,
0
,
bitmap
.
Width
,
bitmap
.
Height
),
ImageLockMode
.
ReadOnly
,
PixelFormat
.
Format32bppArgb
);
var
bmpData
=
bitmap
.
LockBits
(
new
Rectangle
(
0
,
0
,
bitmap
.
Width
,
bitmap
.
Height
),
ImageLockMode
.
ReadOnly
,
PixelFormat
.
Format32bppArgb
);
IntPtr
ptr
=
bmpData
.
Scan0
;
IntPtr
ptr
=
bmpData
.
Scan0
;
int
bytes
=
Math
.
Abs
(
bmpData
.
Stride
)
*
bitmap
.
Height
;
int
bytes
=
Math
.
Abs
(
bmpData
.
Stride
)
*
bitmap
.
Height
;
byte
[]
rgbValues
=
new
byte
[
bytes
];
byte
[]
rgbValues
=
new
byte
[
bytes
];
...
@@ -56,22 +61,21 @@ public class GameTextureManager
...
@@ -56,22 +61,21 @@ public class GameTextureManager
for
(
int
counter
=
0
;
counter
<
rgbValues
.
Length
;
counter
+=
4
)
for
(
int
counter
=
0
;
counter
<
rgbValues
.
Length
;
counter
+=
4
)
{
{
int
i_am
=
counter
/
4
;
int
i_am
=
counter
/
4
;
colors
[
i_am
%
bitmap
.
Width
,
i_am
/
bitmap
.
Width
]
colors
[
i_am
%
bitmap
.
Width
,
i_am
/
bitmap
.
Width
]
=
System
.
Drawing
.
Color
.
FromArgb
(
=
System
.
Drawing
.
Color
.
FromArgb
(
rgbValues
[
counter
+
3
],
rgbValues
[
counter
+
3
],
rgbValues
[
counter
+
2
],
rgbValues
[
counter
+
2
],
rgbValues
[
counter
+
1
],
rgbValues
[
counter
+
1
],
rgbValues
[
counter
+
0
]);
rgbValues
[
counter
+
0
]
);
}
}
bitmap
.
UnlockBits
(
bmpData
);
bitmap
.
UnlockBits
(
bmpData
);
bitmap
.
Dispose
();
bitmap
.
Dispose
();
}
}
public
System
.
Drawing
.
Color
GetPixel
(
int
a
,
int
b
)
public
System
.
Drawing
.
Color
GetPixel
(
int
a
,
int
b
)
{
{
return
colors
[
a
,
b
];
return
colors
[
a
,
b
];
}
}
}
}
public
static
void
clearUnloaded
()
public
static
void
clearUnloaded
()
...
@@ -120,11 +124,13 @@ public class GameTextureManager
...
@@ -120,11 +124,13 @@ public class GameTextureManager
public
long
code
;
public
long
code
;
public
bool
pCard
=
false
;
public
bool
pCard
=
false
;
public
float
k
=
1
;
public
float
k
=
1
;
//public bool autoMade = false;
//public bool autoMade = false;
public
byte
[]
data
=
null
;
public
byte
[]
data
=
null
;
public
float
[,,]
hashed_data
=
null
;
public
float
[,,]
hashed_data
=
null
;
public
Texture2D
u_data
=
null
;
public
Texture2D
u_data
=
null
;
public
Texture2D
nullReturen
=
null
;
public
Texture2D
nullReturen
=
null
;
public
PictureResource
(
GameTextureType
t
,
long
c
,
Texture2D
n
)
public
PictureResource
(
GameTextureType
t
,
long
c
,
Texture2D
n
)
{
{
type
=
t
;
type
=
t
;
...
@@ -172,7 +178,6 @@ public class GameTextureManager
...
@@ -172,7 +178,6 @@ public class GameTextureManager
public
static
Texture2D
LINK
=
null
;
public
static
Texture2D
LINK
=
null
;
public
static
Texture2D
LINKm
=
null
;
public
static
Texture2D
LINKm
=
null
;
public
static
Texture2D
nt
=
null
;
public
static
Texture2D
nt
=
null
;
public
static
Texture2D
bp
=
null
;
public
static
Texture2D
bp
=
null
;
...
@@ -187,8 +192,6 @@ public class GameTextureManager
...
@@ -187,8 +192,6 @@ public class GameTextureManager
public
static
Texture2D
sp
=
null
;
public
static
Texture2D
sp
=
null
;
public
static
Texture2D
phase
=
null
;
public
static
Texture2D
phase
=
null
;
public
static
bool
AutoPicDownload
;
public
static
bool
AutoPicDownload
;
...
@@ -220,7 +223,11 @@ public class GameTextureManager
...
@@ -220,7 +223,11 @@ public class GameTextureManager
pic
=
waitLoadStack
.
Pop
();
pic
=
waitLoadStack
.
Pop
();
try
try
{
{
pic
.
pCard
=
(
YGOSharp
.
CardsManager
.
Get
((
int
)
pic
.
code
).
Type
&
(
int
)
CardType
.
Pendulum
)
>
0
;
pic
.
pCard
=
(
YGOSharp
.
CardsManager
.
Get
((
int
)
pic
.
code
).
Type
&
(
int
)
CardType
.
Pendulum
)
>
0
;
}
}
catch
(
Exception
e
)
catch
(
Exception
e
)
{
{
...
@@ -261,7 +268,8 @@ public class GameTextureManager
...
@@ -261,7 +268,8 @@ public class GameTextureManager
if
(
File
.
Exists
(
"picture/closeup/"
+
pic
.
code
.
ToString
()
+
".png"
))
if
(
File
.
Exists
(
"picture/closeup/"
+
pic
.
code
.
ToString
()
+
".png"
))
{
{
string
path
=
"picture/closeup/"
+
pic
.
code
.
ToString
()
+
".png"
;
string
path
=
"picture/closeup/"
+
pic
.
code
.
ToString
()
+
".png"
;
if
(
Program
.
ANDROID_API_N
)
{
if
(
Program
.
ANDROID_API_N
)
{
BitmapHelper
bitmap
=
new
BitmapHelper
(
path
);
BitmapHelper
bitmap
=
new
BitmapHelper
(
path
);
int
left
;
int
left
;
int
right
;
int
right
;
...
@@ -280,10 +288,18 @@ public class GameTextureManager
...
@@ -280,10 +288,18 @@ public class GameTextureManager
{
{
System
.
Drawing
.
Color
color
=
bitmap
.
GetPixel
(
left
+
w
,
up
+
h
);
System
.
Drawing
.
Color
color
=
bitmap
.
GetPixel
(
left
+
w
,
up
+
h
);
float
a
=
(
float
)
color
.
A
/
255f
;
float
a
=
(
float
)
color
.
A
/
255f
;
if
(
w
<
40
)
if
(
a
>
(
float
)
w
/
(
float
)
40
)
a
=
(
float
)
w
/
(
float
)
40
;
if
(
w
<
40
)
if
(
w
>
(
width
-
40
))
if
(
a
>
1f
-
(
float
)(
w
-
(
width
-
40
))
/
(
float
)
40
)
a
=
1f
-
(
float
)(
w
-
(
width
-
40
))
/
(
float
)
40
;
if
(
a
>
(
float
)
w
/
(
float
)
40
)
if
(
h
<
40
)
if
(
a
>
(
float
)
h
/
(
float
)
40
)
a
=
(
float
)
h
/
(
float
)
40
;
a
=
(
float
)
w
/
(
float
)
40
;
if
(
h
>
(
height
-
40
))
if
(
a
>
1f
-
(
float
)(
h
-
(
height
-
40
))
/
(
float
)
40
)
a
=
1f
-
(
float
)(
h
-
(
height
-
40
))
/
(
float
)
40
;
if
(
w
>
(
width
-
40
))
if
(
a
>
1f
-
(
float
)(
w
-
(
width
-
40
))
/
(
float
)
40
)
a
=
1f
-
(
float
)(
w
-
(
width
-
40
))
/
(
float
)
40
;
if
(
h
<
40
)
if
(
a
>
(
float
)
h
/
(
float
)
40
)
a
=
(
float
)
h
/
(
float
)
40
;
if
(
h
>
(
height
-
40
))
if
(
a
>
1f
-
(
float
)(
h
-
(
height
-
40
))
/
(
float
)
40
)
a
=
1f
-
(
float
)(
h
-
(
height
-
40
))
/
(
float
)
40
;
pic
.
hashed_data
[
w
,
height
-
h
-
1
,
0
]
=
(
float
)
color
.
R
/
255f
;
pic
.
hashed_data
[
w
,
height
-
h
-
1
,
0
]
=
(
float
)
color
.
R
/
255f
;
pic
.
hashed_data
[
w
,
height
-
h
-
1
,
1
]
=
(
float
)
color
.
G
/
255f
;
pic
.
hashed_data
[
w
,
height
-
h
-
1
,
1
]
=
(
float
)
color
.
G
/
255f
;
pic
.
hashed_data
[
w
,
height
-
h
-
1
,
2
]
=
(
float
)
color
.
B
/
255f
;
pic
.
hashed_data
[
w
,
height
-
h
-
1
,
2
]
=
(
float
)
color
.
B
/
255f
;
...
@@ -291,7 +307,9 @@ public class GameTextureManager
...
@@ -291,7 +307,9 @@ public class GameTextureManager
}
}
}
}
caculateK
(
pic
);
caculateK
(
pic
);
}
else
{
}
else
{
byte
[]
data
;
byte
[]
data
;
using
(
FileStream
file
=
new
FileStream
(
path
,
FileMode
.
Open
,
FileAccess
.
Read
))
using
(
FileStream
file
=
new
FileStream
(
path
,
FileMode
.
Open
,
FileAccess
.
Read
))
{
{
...
@@ -350,7 +368,7 @@ public class GameTextureManager
...
@@ -350,7 +368,7 @@ public class GameTextureManager
}
}
else
else
{
{
pic
.
hashed_data
=
getCuttedPic
(
path
,
pic
.
pCard
,
Iam8
);
pic
.
hashed_data
=
getCuttedPic
(
path
,
pic
.
pCard
,
Iam8
);
int
width
=
pic
.
hashed_data
.
GetLength
(
0
);
int
width
=
pic
.
hashed_data
.
GetLength
(
0
);
int
height
=
pic
.
hashed_data
.
GetLength
(
1
);
int
height
=
pic
.
hashed_data
.
GetLength
(
1
);
int
size
=
(
int
)(
height
*
0.8
);
int
size
=
(
int
)(
height
*
0.8
);
...
@@ -456,7 +474,10 @@ public class GameTextureManager
...
@@ -456,7 +474,10 @@ public class GameTextureManager
private
static
float
[,,]
getCuttedPic
(
string
path
,
bool
pCard
,
bool
EightEdition
)
private
static
float
[,,]
getCuttedPic
(
string
path
,
bool
pCard
,
bool
EightEdition
)
{
{
BitmapHelper
bitmap
=
new
BitmapHelper
(
path
);
BitmapHelper
bitmap
=
new
BitmapHelper
(
path
);
int
left
=
0
,
top
=
0
,
right
=
bitmap
.
colors
.
GetLength
(
0
),
buttom
=
bitmap
.
colors
.
GetLength
(
1
);
int
left
=
0
,
top
=
0
,
right
=
bitmap
.
colors
.
GetLength
(
0
),
buttom
=
bitmap
.
colors
.
GetLength
(
1
);
//right is width and buttom is height now
//right is width and buttom is height now
if
(
EightEdition
)
if
(
EightEdition
)
{
{
...
@@ -497,7 +518,10 @@ public class GameTextureManager
...
@@ -497,7 +518,10 @@ public class GameTextureManager
{
{
for
(
int
h
=
0
;
h
<
buttom
-
top
;
h
++)
for
(
int
h
=
0
;
h
<
buttom
-
top
;
h
++)
{
{
System
.
Drawing
.
Color
color
=
bitmap
.
GetPixel
((
int
)(
left
+
w
),
(
int
)(
buttom
-
1
-
h
));
System
.
Drawing
.
Color
color
=
bitmap
.
GetPixel
(
(
int
)(
left
+
w
),
(
int
)(
buttom
-
1
-
h
)
);
returnValue
[
w
,
h
,
0
]
=
(
float
)
color
.
R
/
255f
;
returnValue
[
w
,
h
,
0
]
=
(
float
)
color
.
R
/
255f
;
returnValue
[
w
,
h
,
1
]
=
(
float
)
color
.
G
/
255f
;
returnValue
[
w
,
h
,
1
]
=
(
float
)
color
.
G
/
255f
;
returnValue
[
w
,
h
,
2
]
=
(
float
)
color
.
B
/
255f
;
returnValue
[
w
,
h
,
2
]
=
(
float
)
color
.
B
/
255f
;
...
@@ -559,7 +583,13 @@ public class GameTextureManager
...
@@ -559,7 +583,13 @@ public class GameTextureManager
return
up
;
return
up
;
}
}
private
static
void
CutTop
(
BitmapHelper
bitmap
,
out
int
left
,
out
int
right
,
out
int
up
,
out
int
down
)
private
static
void
CutTop
(
BitmapHelper
bitmap
,
out
int
left
,
out
int
right
,
out
int
up
,
out
int
down
)
{
{
///////切边算法
///////切边算法
left
=
0
;
left
=
0
;
...
@@ -587,7 +617,8 @@ public class GameTextureManager
...
@@ -587,7 +617,8 @@ public class GameTextureManager
string
path
=
"picture/closeup/"
+
pic
.
code
.
ToString
()
+
".png"
;
string
path
=
"picture/closeup/"
+
pic
.
code
.
ToString
()
+
".png"
;
if
(!
File
.
Exists
(
path
))
if
(!
File
.
Exists
(
path
))
{
{
if
(
Program
.
ANDROID_API_N
)
{
if
(
Program
.
ANDROID_API_N
)
{
path
=
"picture/card/"
+
pic
.
code
.
ToString
()
+
".png"
;
path
=
"picture/card/"
+
pic
.
code
.
ToString
()
+
".png"
;
if
(!
File
.
Exists
(
path
))
if
(!
File
.
Exists
(
path
))
{
{
...
@@ -610,7 +641,9 @@ public class GameTextureManager
...
@@ -610,7 +641,9 @@ public class GameTextureManager
path
=
"picture/cardIn8thEdition/"
+
pic
.
code
.
ToString
()
+
".jpg"
;
path
=
"picture/cardIn8thEdition/"
+
pic
.
code
.
ToString
()
+
".jpg"
;
}
}
LoadCloseupFromCardPicture
(
pic
,
path
,
Iam8
);
LoadCloseupFromCardPicture
(
pic
,
path
,
Iam8
);
}
else
{
}
else
{
path
=
"picture/null.png"
;
path
=
"picture/null.png"
;
byte
[]
data
;
byte
[]
data
;
using
(
FileStream
file
=
new
FileStream
(
path
,
FileMode
.
Open
,
FileAccess
.
Read
))
using
(
FileStream
file
=
new
FileStream
(
path
,
FileMode
.
Open
,
FileAccess
.
Read
))
...
@@ -648,7 +681,7 @@ public class GameTextureManager
...
@@ -648,7 +681,7 @@ public class GameTextureManager
}
}
if
(!
File
.
Exists
(
path
))
if
(!
File
.
Exists
(
path
))
{
{
path
=
"textures/unknown.jpg"
;
//YGOMobile Paths
path
=
"textures/unknown.jpg"
;
//YGOMobile Paths
}
}
pic
.
hashed_data
=
getCuttedPic
(
path
,
pic
.
pCard
,
Iam8
);
pic
.
hashed_data
=
getCuttedPic
(
path
,
pic
.
pCard
,
Iam8
);
softVtype
(
pic
,
0.5f
);
softVtype
(
pic
,
0.5f
);
...
@@ -658,18 +691,15 @@ public class GameTextureManager
...
@@ -658,18 +691,15 @@ public class GameTextureManager
loadedList
.
Add
(
hashPic
(
pic
.
code
,
pic
.
type
),
pic
);
loadedList
.
Add
(
hashPic
(
pic
.
code
,
pic
.
type
),
pic
);
}
}
}
}
catch
catch
{
}
{
}
}
}
private
static
void
LoadCloseupPicture
(
PictureResource
pic
,
string
path
)
private
static
void
LoadCloseupPicture
(
PictureResource
pic
,
string
path
)
{
{
try
try
{
{
if
(
Program
.
ANDROID_API_N
)
{
if
(
Program
.
ANDROID_API_N
)
{
BitmapHelper
bitmap
=
new
BitmapHelper
(
path
);
BitmapHelper
bitmap
=
new
BitmapHelper
(
path
);
int
left
;
int
left
;
int
right
;
int
right
;
...
@@ -721,7 +751,9 @@ public class GameTextureManager
...
@@ -721,7 +751,9 @@ public class GameTextureManager
softVtype
(
pic
,
0.7f
);
softVtype
(
pic
,
0.7f
);
}
}
caculateK
(
pic
);
caculateK
(
pic
);
}
else
{
}
else
{
byte
[]
data
;
byte
[]
data
;
using
(
FileStream
file
=
new
FileStream
(
path
,
FileMode
.
Open
,
FileAccess
.
Read
))
using
(
FileStream
file
=
new
FileStream
(
path
,
FileMode
.
Open
,
FileAccess
.
Read
))
{
{
...
@@ -737,11 +769,7 @@ public class GameTextureManager
...
@@ -737,11 +769,7 @@ public class GameTextureManager
loadedList
.
Add
(
hashPic
(
pic
.
code
,
pic
.
type
),
pic
);
loadedList
.
Add
(
hashPic
(
pic
.
code
,
pic
.
type
),
pic
);
}
}
}
}
catch
catch
{
}
{
}
}
}
private
static
void
softVtype
(
PictureResource
pic
,
float
si
)
private
static
void
softVtype
(
PictureResource
pic
,
float
si
)
...
@@ -762,7 +790,10 @@ public class GameTextureManager
...
@@ -762,7 +790,10 @@ public class GameTextureManager
if
(
h
<
height
/
2
)
if
(
h
<
height
/
2
)
{
{
float
l
=
(
float
)
Math
.
Sqrt
((
width
/
2
-
w
)
*
(
width
/
2
-
w
)
+
(
height
/
2
-
h
)
*
(
height
/
2
-
h
));
float
l
=
(
float
)
Math
.
Sqrt
(
(
width
/
2
-
w
)
*
(
width
/
2
-
w
)
+
(
height
/
2
-
h
)
*
(
height
/
2
-
h
)
);
l
-=
width
*
0.3f
;
l
-=
width
*
0.3f
;
if
(
l
<
0
)
if
(
l
<
0
)
{
{
...
@@ -818,7 +849,12 @@ public class GameTextureManager
...
@@ -818,7 +849,12 @@ public class GameTextureManager
if
(!
File
.
Exists
(
path
)
&&
pic
.
code
!=
0
&&
AutoPicDownload
)
if
(!
File
.
Exists
(
path
)
&&
pic
.
code
!=
0
&&
AutoPicDownload
)
{
{
//YGOMobile (177x254)
//YGOMobile (177x254)
df
.
Download
(
"http://cdn01.moestart.com/images/ygopro-images-zh-CN/"
+
pic
.
code
.
ToString
()
+
".jpg"
,
"picture/card/"
+
pic
.
code
.
ToString
()
+
".jpg"
);
df
.
Download
(
"http://cdn01.moestart.com/images/ygopro-images-zh-CN/"
+
pic
.
code
.
ToString
()
+
".jpg"
,
"picture/card/"
+
pic
.
code
.
ToString
()
+
".jpg"
);
path
=
"picture/card/"
+
pic
.
code
.
ToString
()
+
".jpg"
;
path
=
"picture/card/"
+
pic
.
code
.
ToString
()
+
".jpg"
;
}
}
/*if (!File.Exists(path) && pic.code != 0 && AutoPicDownload)
/*if (!File.Exists(path) && pic.code != 0 && AutoPicDownload)
...
@@ -917,7 +953,12 @@ public class GameTextureManager
...
@@ -917,7 +953,12 @@ public class GameTextureManager
{
{
for
(
int
w
=
0
;
w
<
width
;
w
++)
for
(
int
w
=
0
;
w
<
width
;
w
++)
{
{
cols
[
h
*
width
+
w
]
=
new
UnityEngine
.
Color
(
r
.
hashed_data
[
w
,
h
,
0
],
r
.
hashed_data
[
w
,
h
,
1
],
r
.
hashed_data
[
w
,
h
,
2
],
r
.
hashed_data
[
w
,
h
,
3
]);
cols
[
h
*
width
+
w
]
=
new
UnityEngine
.
Color
(
r
.
hashed_data
[
w
,
h
,
0
],
r
.
hashed_data
[
w
,
h
,
1
],
r
.
hashed_data
[
w
,
h
,
2
],
r
.
hashed_data
[
w
,
h
,
3
]
);
}
}
}
}
re
.
SetPixels
(
0
,
0
,
width
,
height
,
cols
);
re
.
SetPixels
(
0
,
0
,
width
,
height
,
cols
);
...
@@ -963,7 +1004,7 @@ public class GameTextureManager
...
@@ -963,7 +1004,7 @@ public class GameTextureManager
if
(
uiLoaded
==
false
)
if
(
uiLoaded
==
false
)
{
{
uiLoaded
=
true
;
uiLoaded
=
true
;
FileInfo
[]
fileInfos
=
(
new
DirectoryInfo
(
"textures/ui"
)).
GetFiles
();
//YGOMobile Paths
FileInfo
[]
fileInfos
=
(
new
DirectoryInfo
(
"textures/ui"
)).
GetFiles
();
//YGOMobile Paths
for
(
int
i
=
0
;
i
<
fileInfos
.
Length
;
i
++)
for
(
int
i
=
0
;
i
<
fileInfos
.
Length
;
i
++)
{
{
if
(
fileInfos
[
i
].
Name
.
Length
>
4
)
if
(
fileInfos
[
i
].
Name
.
Length
>
4
)
...
@@ -972,7 +1013,7 @@ public class GameTextureManager
...
@@ -972,7 +1013,7 @@ public class GameTextureManager
{
{
UIPictureResource
r
=
new
UIPictureResource
();
UIPictureResource
r
=
new
UIPictureResource
();
r
.
name
=
fileInfos
[
i
].
Name
.
Substring
(
0
,
fileInfos
[
i
].
Name
.
Length
-
4
);
r
.
name
=
fileInfos
[
i
].
Name
.
Substring
(
0
,
fileInfos
[
i
].
Name
.
Length
-
4
);
r
.
data
=
UIHelper
.
getTexture2D
(
"textures/ui/"
+
fileInfos
[
i
].
Name
);
//YGOMobile Paths
r
.
data
=
UIHelper
.
getTexture2D
(
"textures/ui/"
+
fileInfos
[
i
].
Name
);
//YGOMobile Paths
allUI
.
Add
(
r
);
allUI
.
Add
(
r
);
}
}
}
}
...
@@ -987,47 +1028,44 @@ public class GameTextureManager
...
@@ -987,47 +1028,44 @@ public class GameTextureManager
break
;
break
;
}
}
}
}
if
(
re
==
null
)
if
(
re
==
null
)
{
}
{
}
return
re
;
return
re
;
}
}
public
static
UnityEngine
.
Color
chainColor
=
UnityEngine
.
Color
.
white
;
public
static
UnityEngine
.
Color
chainColor
=
UnityEngine
.
Color
.
white
;
internal
static
void
initialize
()
internal
static
void
initialize
()
{
{
attack
=
UIHelper
.
getTexture2D
(
"textures/attack.png"
);
//YGOMobile Paths
attack
=
UIHelper
.
getTexture2D
(
"textures/attack.png"
);
//YGOMobile Paths
myBack
=
UIHelper
.
getTexture2D
(
"textures/cover.jpg"
);
//YGOMobile Paths
myBack
=
UIHelper
.
getTexture2D
(
"textures/cover.jpg"
);
//YGOMobile Paths
opBack
=
UIHelper
.
getTexture2D
(
"textures/cover2.jpg"
);
//YGOMobile Paths
opBack
=
UIHelper
.
getTexture2D
(
"textures/cover2.jpg"
);
//YGOMobile Paths
unknown
=
UIHelper
.
getTexture2D
(
"textures/unknown.jpg"
);
//YGOMobile Paths
unknown
=
UIHelper
.
getTexture2D
(
"textures/unknown.jpg"
);
//YGOMobile Paths
negated
=
UIHelper
.
getTexture2D
(
"textures/negated.png"
);
//YGOMobile Paths
negated
=
UIHelper
.
getTexture2D
(
"textures/negated.png"
);
//YGOMobile Paths
bar
=
UIHelper
.
getTexture2D
(
"textures/duel/healthBar/bg.png"
);
//YGOMobile Paths
bar
=
UIHelper
.
getTexture2D
(
"textures/duel/healthBar/bg.png"
);
//YGOMobile Paths
exBar
=
UIHelper
.
getTexture2D
(
"textures/duel/healthBar/excited.png"
);
//YGOMobile Paths
exBar
=
UIHelper
.
getTexture2D
(
"textures/duel/healthBar/excited.png"
);
//YGOMobile Paths
time
=
UIHelper
.
getTexture2D
(
"textures/duel/healthBar/t.png"
);
//YGOMobile Paths
time
=
UIHelper
.
getTexture2D
(
"textures/duel/healthBar/t.png"
);
//YGOMobile Paths
lp
=
UIHelper
.
getTexture2D
(
"textures/duel/healthBar/lp.png"
);
//YGOMobile Paths
lp
=
UIHelper
.
getTexture2D
(
"textures/duel/healthBar/lp.png"
);
//YGOMobile Paths
L
=
UIHelper
.
getTexture2D
(
"textures/duel/L.png"
);
//YGOMobile Paths
L
=
UIHelper
.
getTexture2D
(
"textures/duel/L.png"
);
//YGOMobile Paths
R
=
UIHelper
.
getTexture2D
(
"textures/duel/R.png"
);
//YGOMobile Paths
R
=
UIHelper
.
getTexture2D
(
"textures/duel/R.png"
);
//YGOMobile Paths
LINK
=
UIHelper
.
getTexture2D
(
"textures/duel/link.png"
);
//YGOMobile Paths
LINK
=
UIHelper
.
getTexture2D
(
"textures/duel/link.png"
);
//YGOMobile Paths
LINKm
=
UIHelper
.
getTexture2D
(
"textures/duel/linkMask.png"
);
//YGOMobile Paths
LINKm
=
UIHelper
.
getTexture2D
(
"textures/duel/linkMask.png"
);
//YGOMobile Paths
Chain
=
UIHelper
.
getTexture2D
(
"textures/chain.png"
);
//YGOMobile Paths
Chain
=
UIHelper
.
getTexture2D
(
"textures/chain.png"
);
//YGOMobile Paths
Mask
=
UIHelper
.
getTexture2D
(
"textures/mask.png"
);
//YGOMobile Paths
Mask
=
UIHelper
.
getTexture2D
(
"textures/mask.png"
);
//YGOMobile Paths
nt
=
UIHelper
.
getTexture2D
(
"textures/duel/phase/nt.png"
);
//YGOMobile Paths
nt
=
UIHelper
.
getTexture2D
(
"textures/duel/phase/nt.png"
);
//YGOMobile Paths
bp
=
UIHelper
.
getTexture2D
(
"textures/duel/phase/bp.png"
);
//YGOMobile Paths
bp
=
UIHelper
.
getTexture2D
(
"textures/duel/phase/bp.png"
);
//YGOMobile Paths
ep
=
UIHelper
.
getTexture2D
(
"textures/duel/phase/ep.png"
);
//YGOMobile Paths
ep
=
UIHelper
.
getTexture2D
(
"textures/duel/phase/ep.png"
);
//YGOMobile Paths
mp1
=
UIHelper
.
getTexture2D
(
"textures/duel/phase/mp1.png"
);
//YGOMobile Paths
mp1
=
UIHelper
.
getTexture2D
(
"textures/duel/phase/mp1.png"
);
//YGOMobile Paths
mp2
=
UIHelper
.
getTexture2D
(
"textures/duel/phase/mp2.png"
);
//YGOMobile Paths
mp2
=
UIHelper
.
getTexture2D
(
"textures/duel/phase/mp2.png"
);
//YGOMobile Paths
dp
=
UIHelper
.
getTexture2D
(
"textures/duel/phase/dp.png"
);
//YGOMobile Paths
dp
=
UIHelper
.
getTexture2D
(
"textures/duel/phase/dp.png"
);
//YGOMobile Paths
sp
=
UIHelper
.
getTexture2D
(
"textures/duel/phase/sp.png"
);
//YGOMobile Paths
sp
=
UIHelper
.
getTexture2D
(
"textures/duel/phase/sp.png"
);
//YGOMobile Paths
phase
=
UIHelper
.
getTexture2D
(
"textures/duel/phase/phase.png"
);
//YGOMobile Paths
phase
=
UIHelper
.
getTexture2D
(
"textures/duel/phase/phase.png"
);
//YGOMobile Paths
rs
=
UIHelper
.
getTexture2D
(
"textures/duel/phase/rs.png"
);
//YGOMobile Paths
rs
=
UIHelper
.
getTexture2D
(
"textures/duel/phase/rs.png"
);
//YGOMobile Paths
ts
=
UIHelper
.
getTexture2D
(
"textures/duel/phase/ts.png"
);
//YGOMobile Paths
ts
=
UIHelper
.
getTexture2D
(
"textures/duel/phase/ts.png"
);
//YGOMobile Paths
N
=
new
Texture2D
(
10
,
10
);
N
=
new
Texture2D
(
10
,
10
);
for
(
int
i
=
0
;
i
<
10
;
i
++)
for
(
int
i
=
0
;
i
<
10
;
i
++)
{
{
for
(
int
a
=
0
;
a
<
10
;
a
++)
for
(
int
a
=
0
;
a
<
10
;
a
++)
...
@@ -1038,12 +1076,12 @@ public class GameTextureManager
...
@@ -1038,12 +1076,12 @@ public class GameTextureManager
N
.
Apply
();
N
.
Apply
();
try
try
{
{
ColorUtility
.
TryParseHtmlString
(
File
.
ReadAllText
(
"textures/duel/chainColor.txt"
),
out
chainColor
);
//YGOMobile Paths
ColorUtility
.
TryParseHtmlString
(
}
File
.
ReadAllText
(
"textures/duel/chainColor.txt"
),
catch
(
Exception
)
out
chainColor
{
);
//YGOMobile Paths
}
}
catch
(
Exception
)
{
}
Thread
main
=
new
Thread
(
thread_run
);
Thread
main
=
new
Thread
(
thread_run
);
main
.
Start
();
main
.
Start
();
}
}
...
...
Assets/SibylSystem/ResourceManagers/UnityFileDownloader.cs
View file @
4694efba
...
@@ -51,7 +51,6 @@ public class UnityFileDownloader
...
@@ -51,7 +51,6 @@ public class UnityFileDownloader
File
.
Delete
(
filePath
);
File
.
Delete
(
filePath
);
}
}
File
.
Move
(
tempFilePath
,
filePath
);
File
.
Move
(
tempFilePath
,
filePath
);
// 使用 string.Format 替换了插值字符串
Debug
.
Log
(
string
.
Format
(
"下载成功: {0} -> {1}"
,
url
,
filePath
));
Debug
.
Log
(
string
.
Format
(
"下载成功: {0} -> {1}"
,
url
,
filePath
));
if
(
onComplete
!=
null
)
if
(
onComplete
!=
null
)
...
@@ -61,7 +60,6 @@ public class UnityFileDownloader
...
@@ -61,7 +60,6 @@ public class UnityFileDownloader
}
}
else
else
{
{
// 使用 string.Format 替换了插值字符串
Debug
.
LogError
(
string
.
Format
(
"下载失败: {0}\n错误信息: {1}"
,
url
,
uwr
.
error
));
Debug
.
LogError
(
string
.
Format
(
"下载失败: {0}\n错误信息: {1}"
,
url
,
uwr
.
error
));
if
(
File
.
Exists
(
tempFilePath
))
if
(
File
.
Exists
(
tempFilePath
))
{
{
...
...
Assets/SibylSystem/Setting/Setting.cs
View file @
4694efba
using
UnityEngine
;
using
System
;
using
System
;
using
UnityEngine
;
public
class
Setting
:
WindowServant2D
public
class
Setting
:
WindowServant2D
{
{
private
EventDelegate
onChange
;
private
EventDelegate
onChange
;
...
@@ -15,15 +16,31 @@ public class Setting : WindowServant2D
...
@@ -15,15 +16,31 @@ public class Setting : WindowServant2D
UIHelper
.
registEvent
(
gameObject
,
"full_"
,
resizeScreen
);
UIHelper
.
registEvent
(
gameObject
,
"full_"
,
resizeScreen
);
UIHelper
.
registEvent
(
gameObject
,
"resize_"
,
resizeScreen
);
UIHelper
.
registEvent
(
gameObject
,
"resize_"
,
resizeScreen
);
UIHelper
.
getByName
<
UIToggle
>(
gameObject
,
"full_"
).
value
=
Screen
.
fullScreen
;
UIHelper
.
getByName
<
UIToggle
>(
gameObject
,
"full_"
).
value
=
Screen
.
fullScreen
;
UIHelper
.
getByName
<
UIToggle
>(
gameObject
,
"ignoreWatcher_"
).
value
=
UIHelper
.
fromStringToBool
(
Config
.
Get
(
"ignoreWatcher_"
,
"0"
));
UIHelper
.
getByName
<
UIToggle
>(
gameObject
,
"ignoreWatcher_"
).
value
=
UIHelper
.
getByName
<
UIToggle
>(
gameObject
,
"ignoreOP_"
).
value
=
UIHelper
.
fromStringToBool
(
Config
.
Get
(
"ignoreOP_"
,
"0"
));
UIHelper
.
fromStringToBool
(
Config
.
Get
(
"ignoreWatcher_"
,
"0"
));
UIHelper
.
getByName
<
UIToggle
>(
gameObject
,
"smartSelect_"
).
value
=
UIHelper
.
fromStringToBool
(
Config
.
Get
(
"smartSelect_"
,
"1"
));
UIHelper
.
getByName
<
UIToggle
>(
gameObject
,
"ignoreOP_"
).
value
=
UIHelper
.
fromStringToBool
(
UIHelper
.
getByName
<
UIToggle
>(
gameObject
,
"autoChain_"
).
value
=
UIHelper
.
fromStringToBool
(
Config
.
Get
(
"autoChain_"
,
"1"
));
Config
.
Get
(
"ignoreOP_"
,
"0"
)
UIHelper
.
getByName
<
UIToggle
>(
gameObject
,
"handPosition_"
).
value
=
UIHelper
.
fromStringToBool
(
Config
.
Get
(
"handPosition_"
,
"1"
));
);
UIHelper
.
getByName
<
UIToggle
>(
gameObject
,
"handmPosition_"
).
value
=
UIHelper
.
fromStringToBool
(
Config
.
Get
(
"handmPosition_"
,
"1"
));
UIHelper
.
getByName
<
UIToggle
>(
gameObject
,
"smartSelect_"
).
value
=
UIHelper
.
fromStringToBool
(
UIHelper
.
getByName
<
UIToggle
>(
gameObject
,
"spyer_"
).
value
=
UIHelper
.
fromStringToBool
(
Config
.
Get
(
"spyer_"
,
"1"
));
Config
.
Get
(
"smartSelect_"
,
"1"
)
UIHelper
.
getByName
<
UIToggle
>(
gameObject
,
"resize_"
).
value
=
UIHelper
.
fromStringToBool
(
Config
.
Get
(
"resize_"
,
"0"
));
);
UIHelper
.
getByName
<
UIToggle
>(
gameObject
,
"longField_"
).
value
=
UIHelper
.
fromStringToBool
(
Config
.
Get
(
"longField_"
,
"0"
));
UIHelper
.
getByName
<
UIToggle
>(
gameObject
,
"autoChain_"
).
value
=
UIHelper
.
fromStringToBool
(
Config
.
Get
(
"autoChain_"
,
"1"
)
);
UIHelper
.
getByName
<
UIToggle
>(
gameObject
,
"handPosition_"
).
value
=
UIHelper
.
fromStringToBool
(
Config
.
Get
(
"handPosition_"
,
"1"
)
);
UIHelper
.
getByName
<
UIToggle
>(
gameObject
,
"handmPosition_"
).
value
=
UIHelper
.
fromStringToBool
(
Config
.
Get
(
"handmPosition_"
,
"1"
));
UIHelper
.
getByName
<
UIToggle
>(
gameObject
,
"spyer_"
).
value
=
UIHelper
.
fromStringToBool
(
Config
.
Get
(
"spyer_"
,
"1"
)
);
UIHelper
.
getByName
<
UIToggle
>(
gameObject
,
"resize_"
).
value
=
UIHelper
.
fromStringToBool
(
Config
.
Get
(
"resize_"
,
"0"
)
);
UIHelper
.
getByName
<
UIToggle
>(
gameObject
,
"longField_"
).
value
=
UIHelper
.
fromStringToBool
(
Config
.
Get
(
"longField_"
,
"0"
)
);
if
(
QualitySettings
.
GetQualityLevel
()
<
3
)
if
(
QualitySettings
.
GetQualityLevel
()
<
3
)
{
{
UIHelper
.
getByName
<
UIToggle
>(
gameObject
,
"high_"
).
value
=
false
;
UIHelper
.
getByName
<
UIToggle
>(
gameObject
,
"high_"
).
value
=
false
;
...
@@ -53,13 +70,22 @@ public class Setting : WindowServant2D
...
@@ -53,13 +70,22 @@ public class Setting : WindowServant2D
{
{
if
(
collection
[
i
].
name
.
Length
>
0
&&
collection
[
i
].
name
[
0
]
==
'*'
)
if
(
collection
[
i
].
name
.
Length
>
0
&&
collection
[
i
].
name
[
0
]
==
'*'
)
{
{
if
(
collection
[
i
].
name
==
"*mouseParticle"
||
collection
[
i
].
name
==
"*showOff"
||
collection
[
i
].
name
==
"*Efield"
||
collection
[
i
].
name
==
"*AutoPicDownload"
)
if
(
collection
[
i
].
name
==
"*mouseParticle"
||
collection
[
i
].
name
==
"*showOff"
||
collection
[
i
].
name
==
"*Efield"
||
collection
[
i
].
name
==
"*AutoPicDownload"
)
{
{
collection
[
i
].
value
=
UIHelper
.
fromStringToBool
(
Config
.
Get
(
collection
[
i
].
name
,
"1"
));
collection
[
i
].
value
=
UIHelper
.
fromStringToBool
(
Config
.
Get
(
collection
[
i
].
name
,
"1"
)
);
}
}
else
else
{
{
collection
[
i
].
value
=
UIHelper
.
fromStringToBool
(
Config
.
Get
(
collection
[
i
].
name
,
"0"
));
collection
[
i
].
value
=
UIHelper
.
fromStringToBool
(
Config
.
Get
(
collection
[
i
].
name
,
"0"
)
);
}
}
}
}
}
}
...
@@ -83,9 +109,12 @@ public class Setting : WindowServant2D
...
@@ -83,9 +109,12 @@ public class Setting : WindowServant2D
private
void
onchangeFPS
()
private
void
onchangeFPS
()
{
{
if
(
setting
.
LimFPS
.
value
==
"Auto"
)
{
if
(
setting
.
LimFPS
.
value
==
"Auto"
)
{
Application
.
targetFrameRate
=
-
1
;
Application
.
targetFrameRate
=
-
1
;
}
else
{
}
else
{
int
FPS
=
int
.
Parse
(
setting
.
LimFPS
.
value
);
int
FPS
=
int
.
Parse
(
setting
.
LimFPS
.
value
);
Application
.
targetFrameRate
=
FPS
;
Application
.
targetFrameRate
=
FPS
;
}
}
...
@@ -97,7 +126,9 @@ public class Setting : WindowServant2D
...
@@ -97,7 +126,9 @@ public class Setting : WindowServant2D
{
{
setting
.
sliderVolum
.
forceValue
(((
float
)(
int
.
Parse
(
Config
.
Get
(
"vol_"
,
"750"
))))
/
1000f
);
setting
.
sliderVolum
.
forceValue
(((
float
)(
int
.
Parse
(
Config
.
Get
(
"vol_"
,
"750"
))))
/
1000f
);
setting
.
sliderSize
.
forceValue
(((
float
)(
int
.
Parse
(
Config
.
Get
(
"size_"
,
"500"
))))
/
1000f
);
setting
.
sliderSize
.
forceValue
(((
float
)(
int
.
Parse
(
Config
.
Get
(
"size_"
,
"500"
))))
/
1000f
);
setting
.
sliderSizeDrawing
.
forceValue
(((
float
)(
int
.
Parse
(
Config
.
Get
(
"vSize_"
,
"500"
))))
/
1000f
);
setting
.
sliderSizeDrawing
.
forceValue
(
((
float
)(
int
.
Parse
(
Config
.
Get
(
"vSize_"
,
"500"
))))
/
1000f
);
//setting.sliderAlpha.forceValue(((float)(int.Parse(Config.Get("alpha_", "666")))) / 1000f);
//setting.sliderAlpha.forceValue(((float)(int.Parse(Config.Get("alpha_", "666")))) / 1000f);
onChangeAlpha
();
onChangeAlpha
();
onChangeSize
();
onChangeSize
();
...
@@ -128,7 +159,10 @@ public class Setting : WindowServant2D
...
@@ -128,7 +159,10 @@ public class Setting : WindowServant2D
public
void
setScreenSizeValue
()
public
void
setScreenSizeValue
()
{
{
//dontResizeTwice = 3;
//dontResizeTwice = 3;
UIHelper
.
getByName
<
UIPopupList
>(
gameObject
,
"screen_"
).
value
=
Screen
.
width
.
ToString
()
+
"*"
+
Screen
.
height
.
ToString
();
// UIHelper.getByName<UIPopupList>(gameObject, "screen_").value =
// Screen.width.ToString() + "*" + Screen.height.ToString();
string
res
=
Config
.
Get
(
"screen_"
,
"1600*900"
);
UIHelper
.
getByName
<
UIPopupList
>(
gameObject
,
"screen_"
).
value
=
res
;
}
}
void
onCP
()
void
onCP
()
...
@@ -137,12 +171,9 @@ public class Setting : WindowServant2D
...
@@ -137,12 +171,9 @@ public class Setting : WindowServant2D
{
{
Program
.
I
().
ocgcore
.
realize
(
true
);
Program
.
I
().
ocgcore
.
realize
(
true
);
}
}
catch
(
Exception
e
)
catch
(
Exception
e
)
{
}
{
}
}
}
public
void
onchangeCloseUp
()
public
void
onchangeCloseUp
()
{
{
if
(
setting
.
closeUp
.
value
==
false
)
if
(
setting
.
closeUp
.
value
==
false
)
...
@@ -170,22 +201,16 @@ public class Setting : WindowServant2D
...
@@ -170,22 +201,16 @@ public class Setting : WindowServant2D
{
{
atk
=
int
.
Parse
(
setting
.
showoffATK
.
value
);
atk
=
int
.
Parse
(
setting
.
showoffATK
.
value
);
}
}
catch
(
Exception
)
catch
(
Exception
)
{
}
{
}
try
try
{
{
star
=
int
.
Parse
(
setting
.
showoffStar
.
value
);
star
=
int
.
Parse
(
setting
.
showoffStar
.
value
);
}
}
catch
(
Exception
)
catch
(
Exception
)
{
}
{
}
}
}
UISlider
sliderAlpha
;
UISlider
sliderAlpha
;
void
onChangeAlpha
()
void
onChangeAlpha
()
{
{
if
(
sliderAlpha
!=
null
)
if
(
sliderAlpha
!=
null
)
...
@@ -202,6 +227,7 @@ public class Setting : WindowServant2D
...
@@ -202,6 +227,7 @@ public class Setting : WindowServant2D
}
}
UISlider
sliderVsize
;
UISlider
sliderVsize
;
void
onChangeVsize
()
void
onChangeVsize
()
{
{
if
(
sliderVsize
!=
null
)
if
(
sliderVsize
!=
null
)
...
@@ -211,6 +237,7 @@ public class Setting : WindowServant2D
...
@@ -211,6 +237,7 @@ public class Setting : WindowServant2D
}
}
UISlider
sliderSize
;
UISlider
sliderSize
;
void
onChangeSize
()
void
onChangeSize
()
{
{
if
(
sliderSize
!=
null
)
if
(
sliderSize
!=
null
)
...
@@ -245,21 +272,45 @@ public class Setting : WindowServant2D
...
@@ -245,21 +272,45 @@ public class Setting : WindowServant2D
//dontResizeTwice = 2;
//dontResizeTwice = 2;
if
(
UIHelper
.
isMaximized
())
if
(
UIHelper
.
isMaximized
())
UIHelper
.
RestoreWindow
();
UIHelper
.
RestoreWindow
();
string
[]
mats
=
UIHelper
.
getByName
<
UIPopupList
>(
gameObject
,
"screen_"
).
value
.
Split
(
new
string
[]
{
"*"
},
StringSplitOptions
.
RemoveEmptyEntries
);
string
[]
mats
=
UIHelper
.
getByName
<
UIPopupList
>(
gameObject
,
"screen_"
)
.
value
.
Split
(
new
string
[]
{
"*"
},
StringSplitOptions
.
RemoveEmptyEntries
);
if
(
mats
.
Length
==
2
)
if
(
mats
.
Length
==
2
)
{
{
Screen
.
SetResolution
(
int
.
Parse
(
mats
[
0
]),
int
.
Parse
(
mats
[
1
]),
UIHelper
.
getByName
<
UIToggle
>(
gameObject
,
"full_"
).
value
);
Screen
.
SetResolution
(
int
.
Parse
(
mats
[
0
]),
int
.
Parse
(
mats
[
1
]),
UIHelper
.
getByName
<
UIToggle
>(
gameObject
,
"full_"
).
value
);
}
}
Program
.
go
(
100
,
()
=>
{
Program
.
I
().
fixScreenProblems
();
});
Program
.
go
(
100
,
()
=>
{
Program
.
I
().
fixScreenProblems
();
}
);
}
}
public
void
saveWhenQuit
()
public
void
saveWhenQuit
()
{
{
Config
.
Set
(
"vol_"
,
((
int
)(
UIHelper
.
getByName
<
UISlider
>(
gameObject
,
"vol_"
).
value
*
1000
)).
ToString
());
Config
.
Set
(
Config
.
Set
(
"size_"
,
((
int
)(
UIHelper
.
getByName
<
UISlider
>(
gameObject
,
"size_"
).
value
*
1000
)).
ToString
());
"vol_"
,
Config
.
Set
(
"vSize_"
,
((
int
)(
UIHelper
.
getByName
<
UISlider
>(
gameObject
,
"vSize_"
).
value
*
1000
)).
ToString
());
((
int
)(
UIHelper
.
getByName
<
UISlider
>(
gameObject
,
"vol_"
).
value
*
1000
)).
ToString
()
);
Config
.
Set
(
"size_"
,
((
int
)(
UIHelper
.
getByName
<
UISlider
>(
gameObject
,
"size_"
).
value
*
1000
)).
ToString
()
);
Config
.
Set
(
"vSize_"
,
((
int
)(
UIHelper
.
getByName
<
UISlider
>(
gameObject
,
"vSize_"
).
value
*
1000
)).
ToString
()
);
//Config.Set("alpha_", ((int)(UIHelper.getByName<UISlider>(gameObject, "alpha_").value * 1000)).ToString());
//Config.Set("alpha_", ((int)(UIHelper.getByName<UISlider>(gameObject, "alpha_").value * 1000)).ToString());
Config
.
Set
(
"longField_"
,
UIHelper
.
fromBoolToString
(
UIHelper
.
getByName
<
UIToggle
>(
gameObject
,
"longField_"
).
value
));
Config
.
Set
(
"longField_"
,
UIHelper
.
fromBoolToString
(
UIHelper
.
getByName
<
UIToggle
>(
gameObject
,
"longField_"
).
value
)
);
var
collection
=
gameObject
.
GetComponentsInChildren
<
UIToggle
>();
var
collection
=
gameObject
.
GetComponentsInChildren
<
UIToggle
>();
for
(
int
i
=
0
;
i
<
collection
.
Length
;
i
++)
for
(
int
i
=
0
;
i
<
collection
.
Length
;
i
++)
{
{
...
@@ -271,19 +322,52 @@ public class Setting : WindowServant2D
...
@@ -271,19 +322,52 @@ public class Setting : WindowServant2D
Config
.
Set
(
"showoffATK"
,
setting
.
showoffATK
.
value
.
ToString
());
Config
.
Set
(
"showoffATK"
,
setting
.
showoffATK
.
value
.
ToString
());
Config
.
Set
(
"showoffStar"
,
setting
.
showoffStar
.
value
.
ToString
());
Config
.
Set
(
"showoffStar"
,
setting
.
showoffStar
.
value
.
ToString
());
Config
.
Set
(
"LimFPS"
,
setting
.
LimFPS
.
value
.
ToString
());
Config
.
Set
(
"LimFPS"
,
setting
.
LimFPS
.
value
.
ToString
());
Config
.
Set
(
"resize_"
,
UIHelper
.
fromBoolToString
(
UIHelper
.
getByName
<
UIToggle
>(
gameObject
,
"resize_"
).
value
));
Config
.
Set
(
"resize_"
,
UIHelper
.
fromBoolToString
(
UIHelper
.
getByName
<
UIToggle
>(
gameObject
,
"resize_"
).
value
)
);
Config
.
Set
(
"maximize_"
,
UIHelper
.
fromBoolToString
(
UIHelper
.
isMaximized
()));
Config
.
Set
(
"maximize_"
,
UIHelper
.
fromBoolToString
(
UIHelper
.
isMaximized
()));
Config
.
Set
(
"screen_"
,
UIHelper
.
getByName
<
UIPopupList
>(
gameObject
,
"screen_"
).
value
);
}
}
public
void
save
()
public
void
save
()
{
{
Config
.
Set
(
"ignoreWatcher_"
,
UIHelper
.
fromBoolToString
(
UIHelper
.
getByName
<
UIToggle
>(
gameObject
,
"ignoreWatcher_"
).
value
));
Config
.
Set
(
Config
.
Set
(
"ignoreOP_"
,
UIHelper
.
fromBoolToString
(
UIHelper
.
getByName
<
UIToggle
>(
gameObject
,
"ignoreOP_"
).
value
));
"ignoreWatcher_"
,
Config
.
Set
(
"smartSelect_"
,
UIHelper
.
fromBoolToString
(
UIHelper
.
getByName
<
UIToggle
>(
gameObject
,
"smartSelect_"
).
value
));
UIHelper
.
fromBoolToString
(
Config
.
Set
(
"autoChain_"
,
UIHelper
.
fromBoolToString
(
UIHelper
.
getByName
<
UIToggle
>(
gameObject
,
"autoChain_"
).
value
));
UIHelper
.
getByName
<
UIToggle
>(
gameObject
,
"ignoreWatcher_"
).
value
Config
.
Set
(
"handPosition_"
,
UIHelper
.
fromBoolToString
(
UIHelper
.
getByName
<
UIToggle
>(
gameObject
,
"handPosition_"
).
value
));
)
Config
.
Set
(
"handmPosition_"
,
UIHelper
.
fromBoolToString
(
UIHelper
.
getByName
<
UIToggle
>(
gameObject
,
"handmPosition_"
).
value
));
);
Config
.
Set
(
"spyer_"
,
UIHelper
.
fromBoolToString
(
UIHelper
.
getByName
<
UIToggle
>(
gameObject
,
"spyer_"
).
value
));
Config
.
Set
(
"ignoreOP_"
,
UIHelper
.
fromBoolToString
(
UIHelper
.
getByName
<
UIToggle
>(
gameObject
,
"ignoreOP_"
).
value
)
);
Config
.
Set
(
"smartSelect_"
,
UIHelper
.
fromBoolToString
(
UIHelper
.
getByName
<
UIToggle
>(
gameObject
,
"smartSelect_"
).
value
)
);
Config
.
Set
(
"autoChain_"
,
UIHelper
.
fromBoolToString
(
UIHelper
.
getByName
<
UIToggle
>(
gameObject
,
"autoChain_"
).
value
)
);
Config
.
Set
(
"handPosition_"
,
UIHelper
.
fromBoolToString
(
UIHelper
.
getByName
<
UIToggle
>(
gameObject
,
"handPosition_"
).
value
)
);
Config
.
Set
(
"handmPosition_"
,
UIHelper
.
fromBoolToString
(
UIHelper
.
getByName
<
UIToggle
>(
gameObject
,
"handmPosition_"
).
value
)
);
Config
.
Set
(
"spyer_"
,
UIHelper
.
fromBoolToString
(
UIHelper
.
getByName
<
UIToggle
>(
gameObject
,
"spyer_"
).
value
)
);
if
(
UIHelper
.
getByName
<
UIToggle
>(
gameObject
,
"high_"
).
value
)
if
(
UIHelper
.
getByName
<
UIToggle
>(
gameObject
,
"high_"
).
value
)
{
{
QualitySettings
.
SetQualityLevel
(
5
);
QualitySettings
.
SetQualityLevel
(
5
);
...
...
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