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
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
2
Merge Requests
2
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
MyCard
YGOProUnity_V2
Commits
edfd3f53
Commit
edfd3f53
authored
Sep 06, 2021
by
nanahira
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'texture-manager' of git.mycard.moe:mycard/YGOProUnity_V2
parents
d2f2ec91
82690ab4
Pipeline
#5343
passed with stages
in 34 minutes and 27 seconds
Changes
31
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
31 changed files
with
472 additions
and
1267 deletions
+472
-1267
Assets/ArtSystem/deckManager/MonoCardInDeckManager.cs
Assets/ArtSystem/deckManager/MonoCardInDeckManager.cs
+16
-14
Assets/ArtSystem/deckManager/cardPicLoader.cs
Assets/ArtSystem/deckManager/cardPicLoader.cs
+24
-35
Assets/ArtSystem/gameInfo/gameInfo.cs
Assets/ArtSystem/gameInfo/gameInfo.cs
+10
-10
Assets/ArtSystem/picShower/handShower.cs
Assets/ArtSystem/picShower/handShower.cs
+3
-3
Assets/ArtSystem/remaster/lazyPlayer.cs
Assets/ArtSystem/remaster/lazyPlayer.cs
+6
-12
Assets/NGUI/Scripts/Editor/UITextureInspector.cs
Assets/NGUI/Scripts/Editor/UITextureInspector.cs
+1
-1
Assets/NGUI/Scripts/Interaction/UIButton.cs
Assets/NGUI/Scripts/Interaction/UIButton.cs
+2
-2
Assets/NGUI/Scripts/UI/UITexture.cs
Assets/NGUI/Scripts/UI/UITexture.cs
+1
-4
Assets/Plugins/System.Drawing.dll
Assets/Plugins/System.Drawing.dll
+0
-0
Assets/Plugins/System.Drawing.dll.meta
Assets/Plugins/System.Drawing.dll.meta
+0
-34
Assets/Scripts/BackgroundLoader.cs.meta
Assets/Scripts/BackgroundLoader.cs.meta
+1
-1
Assets/Scripts/MyCard.cs
Assets/Scripts/MyCard.cs
+26
-0
Assets/Scripts/MyCard.cs.meta
Assets/Scripts/MyCard.cs.meta
+3
-0
Assets/SibylSystem/BackGroundPic/BackGroundPic.cs
Assets/SibylSystem/BackGroundPic/BackGroundPic.cs
+3
-16
Assets/SibylSystem/CardDescription/CardDescription.cs
Assets/SibylSystem/CardDescription/CardDescription.cs
+1
-2
Assets/SibylSystem/MonoHelpers/UIHelper.cs
Assets/SibylSystem/MonoHelpers/UIHelper.cs
+18
-21
Assets/SibylSystem/Ocgcore/OCGobjects/gameCard.cs
Assets/SibylSystem/Ocgcore/OCGobjects/gameCard.cs
+118
-197
Assets/SibylSystem/Ocgcore/OCGobjects/gameField.cs
Assets/SibylSystem/Ocgcore/OCGobjects/gameField.cs
+5
-7
Assets/SibylSystem/Ocgcore/Ocgcore.cs
Assets/SibylSystem/Ocgcore/Ocgcore.cs
+19
-33
Assets/SibylSystem/ResourceManagers/GameTextureManager.cs
Assets/SibylSystem/ResourceManagers/GameTextureManager.cs
+64
-850
Assets/SibylSystem/Room/Room.cs
Assets/SibylSystem/Room/Room.cs
+1
-1
Assets/SibylSystem/SelectDeck/selectDeck.cs
Assets/SibylSystem/SelectDeck/selectDeck.cs
+4
-4
Assets/SibylSystem/Servant.cs
Assets/SibylSystem/Servant.cs
+9
-7
Assets/SibylSystem/deckManager/DeckManager.cs
Assets/SibylSystem/deckManager/DeckManager.cs
+10
-11
Assets/old/Deck_manager/mats/ban_icon.cs
Assets/old/Deck_manager/mats/ban_icon.cs
+2
-2
Assets/old/Ocgcore/button/all_button.png.meta
Assets/old/Ocgcore/button/all_button.png.meta
+14
-0
Assets/old/Ocgcore/numbers/num.png.meta
Assets/old/Ocgcore/numbers/num.png.meta
+42
-0
Assets/old/Ocgcore/numbers/num2.png.meta
Assets/old/Ocgcore/numbers/num2.png.meta
+22
-0
Assets/old/UiverseAssests/TextMesh Pro/Resources/Sprites/Default Sprite Atlas.psd.meta
...tMesh Pro/Resources/Sprites/Default Sprite Atlas.psd.meta
+12
-0
ProjectSettings/MemorySettings.asset
ProjectSettings/MemorySettings.asset
+35
-0
ProjectSettings/boot.config
ProjectSettings/boot.config
+0
-0
No files found.
Assets/ArtSystem/deckManager/MonoCardInDeckManager.cs
View file @
edfd3f53
...
...
@@ -7,33 +7,35 @@ public class MonoCardInDeckManager : MonoBehaviour
public
bool
dying
;
private
bool
bool_physicalON
;
p
ublic
Card
cardData
=
new
Card
();
p
rivate
Card
_
cardData
=
new
Card
();
private
bool
died
;
private
bool
isDraging
;
private
Banlist
loaded_banlist
;
private
int
loadedPicCode
;
p
rivate
void
Update
()
p
ublic
Card
cardData
{
if
(
loadedPicCode
!=
cardData
.
Id
)
get
=>
_cardData
;
set
{
var
pic
=
GameTextureManager
.
get
(
cardData
.
Id
,
GameTextureType
.
card_picture
);
if
(
pic
!=
null
)
{
loadedPicCode
=
cardData
.
Id
;
gameObject
.
transform
.
Find
(
"face"
).
GetComponent
<
Renderer
>().
material
.
mainTexture
=
pic
;
}
_cardData
=
value
;
LoadCard
();
}
}
private
async
void
LoadCard
()
{
gameObject
.
transform
.
Find
(
"face"
).
GetComponent
<
Renderer
>().
material
.
mainTexture
=
await
GameTextureManager
.
GetCardPicture
(
_cardData
.
Id
);
}
private
void
Update
()
{
if
(
Program
.
I
().
deckManager
.
currentBanlist
!=
loaded_banlist
)
{
var
ico
=
GetComponentInChildren
<
ban_icon
>();
loaded_banlist
=
Program
.
I
().
deckManager
.
currentBanlist
;
if
(
loaded_banlist
!=
null
)
ico
.
show
(
loaded_banlist
.
GetQuantity
(
cardData
.
Id
));
else
ico
.
show
(
3
);
ico
.
show
(
loaded_banlist
?.
GetQuantity
(
_cardData
.
Id
)
??
3
);
}
if
(
isDraging
)
gameObject
.
transform
.
position
+=
(
getGoodPosition
(
4
)
-
gameObject
.
transform
.
position
)
*
0.3f
;
...
...
Assets/ArtSystem/deckManager/cardPicLoader.cs
View file @
edfd3f53
...
...
@@ -3,43 +3,39 @@ using YGOSharp;
public
class
cardPicLoader
:
MonoBehaviour
{
public
int
loaded_code
=
-
1
;
public
int
code
;
private
int
_code
;
public
Texture2D
defaults
;
public
ban_icon
ico
;
public
Collider
coli
;
public
UITexture
uiTexture
;
public
Banlist
loaded_banlist
;
public
Card
data
{
get
;
set
;
}
public
int
code
{
get
=>
_code
;
set
{
_code
=
value
;
LoadCard
();
}
}
private
async
void
LoadCard
()
{
uiTexture
.
mainTexture
=
await
GameTextureManager
.
GetCardPicture
(
code
);
if
(
uiTexture
.
mainTexture
==
null
)
return
;
uiTexture
.
aspectRatio
=
(
float
)
uiTexture
.
mainTexture
.
width
/
uiTexture
.
mainTexture
.
height
;
uiTexture
.
forceWidth
((
int
)
(
uiTexture
.
height
*
uiTexture
.
aspectRatio
));
loaded_banlist
=
null
;
}
private
void
Update
()
{
if
(
coli
!=
null
)
if
(
Program
.
InputGetMouseButtonDown_0
)
if
(
Program
.
pointedCollider
==
coli
)
Program
.
I
().
cardDescription
.
setData
(
CardsManager
.
Get
(
code
),
GameTextureManager
.
myBack
,
""
,
true
);
if
(
coli
!=
null
&&
Program
.
InputGetMouseButtonDown_0
&&
Program
.
pointedCollider
==
coli
)
Program
.
I
().
cardDescription
.
setData
(
CardsManager
.
Get
(
_code
),
GameTextureManager
.
myBack
,
""
,
true
);
if
(
Program
.
I
().
deckManager
!=
null
)
{
if
(
loaded_code
!=
code
)
{
var
t
=
GameTextureManager
.
get
(
code
,
GameTextureType
.
card_picture
,
defaults
);
if
(
t
!=
null
)
{
uiTexture
.
mainTexture
=
t
;
uiTexture
.
aspectRatio
=
t
.
width
/
(
float
)
t
.
height
;
uiTexture
.
forceWidth
((
int
)
(
uiTexture
.
height
*
uiTexture
.
aspectRatio
));
loaded_code
=
code
;
loaded_banlist
=
null
;
}
}
if
(
loaded_banlist
!=
Program
.
I
().
deckManager
.
currentBanlist
)
{
loaded_banlist
=
Program
.
I
().
deckManager
.
currentBanlist
;
...
...
@@ -51,7 +47,7 @@ public class cardPicLoader : MonoBehaviour
return
;
}
ico
.
show
(
loaded_banlist
.
GetQuantity
(
code
));
ico
.
show
(
loaded_banlist
.
GetQuantity
(
_
code
));
}
}
}
...
...
@@ -59,18 +55,11 @@ public class cardPicLoader : MonoBehaviour
public
void
clear
()
{
loaded_code
=
0
;
code
=
0
;
_code
=
0
;
ico
.
show
(
3
);
uiTexture
.
mainTexture
=
null
;
}
public
void
reCode
(
int
c
)
{
loaded_code
=
0
;
code
=
c
;
}
public
void
relayer
(
int
l
)
{
uiTexture
.
depth
=
50
+
l
*
2
;
...
...
Assets/ArtSystem/gameInfo/gameInfo.cs
View file @
edfd3f53
using
System
;
using
System.Collections.Generic
;
using
DefaultNamespace
;
using
DG.Tweening
;
using
UnityEngine
;
public
class
gameUIbutton
...
...
@@ -338,18 +340,16 @@ public class gameInfo : MonoBehaviour
((
float
)
Program
.
I
().
ocgcore
.
life_1
>
0
?
Program
.
I
().
ocgcore
.
life_1
:
0
).
ToString
();
me
.
api_name
.
text
=
Program
.
I
().
ocgcore
.
name_0_c
;
opponent
.
api_name
.
text
=
Program
.
I
().
ocgcore
.
name_1_c
;
me
.
api_face
.
mainTexture
=
UIHelper
.
getFace
(
Program
.
I
().
ocgcore
.
name_0_c
);
opponent
.
api_face
.
mainTexture
=
UIHelper
.
getFace
(
Program
.
I
().
ocgcore
.
name_1_c
);
iTween
.
MoveToLocal
(
me
.
api_healthBar
.
gameObject
,
new
Vector3
(
MyCard
.
LoadAvatar
(
Program
.
I
().
ocgcore
.
name_0_c
,
texture
=>
me
.
api_face
.
mainTexture
=
texture
);
MyCard
.
LoadAvatar
(
Program
.
I
().
ocgcore
.
name_1_c
,
texture
=>
opponent
.
api_face
.
mainTexture
=
texture
);
me
.
api_healthBar
.
transform
.
DOLocalMoveX
(
me
.
api_healthBar
.
width
-
getRealLife
(
Program
.
I
().
ocgcore
.
life_0
)
/
Program
.
I
().
ocgcore
.
lpLimit
*
me
.
api_healthBar
.
width
,
me
.
api_healthBar
.
gameObject
.
transform
.
localPosition
.
y
,
me
.
api_healthBar
.
gameObject
.
transform
.
localPosition
.
z
),
1f
);
iTween
.
MoveToLocal
(
opponent
.
api_healthBar
.
gameObject
,
new
Vector3
(
me
.
api_healthBar
.
width
,
1f
);
opponent
.
api_healthBar
.
transform
.
DOLocalMoveX
(
opponent
.
api_healthBar
.
width
-
getRealLife
(
Program
.
I
().
ocgcore
.
life_1
)
/
Program
.
I
().
ocgcore
.
lpLimit
*
opponent
.
api_healthBar
.
width
,
opponent
.
api_healthBar
.
gameObject
.
transform
.
localPosition
.
y
,
opponent
.
api_healthBar
.
gameObject
.
transform
.
localPosition
.
z
),
1f
);
opponent
.
api_healthBar
.
width
,
1f
);
instance_lab
.
Clear
();
if
(
Program
.
I
().
ocgcore
.
confirmedCards
.
Count
>
0
)
instance_lab
.
Add
(
GameStringHelper
.
yijingqueren
);
foreach
(
var
item
in
Program
.
I
().
ocgcore
.
confirmedCards
)
instance_lab
.
Add
(
item
);
...
...
Assets/ArtSystem/picShower/handShower.cs
View file @
edfd3f53
...
...
@@ -12,9 +12,9 @@ public class handShower : MonoBehaviour
private
void
Start
()
{
pics
[
0
]
=
GameTextureManager
.
get
(
"jiandao"
);
pics
[
1
]
=
GameTextureManager
.
get
(
"shitou"
);
pics
[
2
]
=
GameTextureManager
.
get
(
"bu"
);
pics
[
0
]
=
GameTextureManager
.
GetUI
(
"jiandao"
);
pics
[
1
]
=
GameTextureManager
.
GetUI
(
"shitou"
);
pics
[
2
]
=
GameTextureManager
.
GetUI
(
"bu"
);
texture_0
.
mainTexture
=
pics
[
me
];
texture_1
.
mainTexture
=
pics
[
op
];
GameObject_0
.
transform
.
position
=
Program
.
I
().
camera_main_2d
...
...
Assets/ArtSystem/remaster/lazyPlayer.cs
View file @
edfd3f53
using
System
;
using
DefaultNamespace
;
using
UnityEngine
;
public
class
lazyPlayer
:
MonoBehaviour
...
...
@@ -55,7 +56,7 @@ public class lazyPlayer : MonoBehaviour
setIfMe
(
false
);
SetNotNull
(
false
);
SetIFcanKick
(
false
);
s
etName
(
""
);
S
etName
(
""
);
}
private
void
OnPrepClicked
()
...
...
@@ -126,18 +127,11 @@ public class lazyPlayer : MonoBehaviour
return
mIfMe
;
}
public
void
setName
(
string
name_
)
public
void
SetName
(
string
name
)
{
mName
=
name_
;
UILabel_name
.
text
=
name_
;
try
{
face
.
mainTexture
=
UIHelper
.
getFace
(
name_
);
}
catch
(
Exception
)
{
Debug
.
LogError
(
"setName"
);
}
mName
=
name
;
UILabel_name
.
text
=
name
;
MyCard
.
LoadAvatar
(
name
,
texture
=>
face
.
mainTexture
=
texture
);
}
public
string
getName
()
...
...
Assets/NGUI/Scripts/Editor/UITextureInspector.cs
View file @
edfd3f53
...
...
@@ -33,7 +33,7 @@ public class UITextureInspector : UIBasicSpriteEditor
startPath
=
sp2
.
stringValue
;
if
(
startPath
!=
""
)
{
mTex
.
mainTexture
=
UIHelper
.
g
etTexture2D
(
"texture/ui/"
+
startPath
+
".png"
);
mTex
.
mainTexture
=
UIHelper
.
G
etTexture2D
(
"texture/ui/"
+
startPath
+
".png"
);
}
Debug
.
Log
(
"force delay read"
);
}
...
...
Assets/NGUI/Scripts/Interaction/UIButton.cs
View file @
edfd3f53
...
...
@@ -329,14 +329,14 @@ public class UIButton : UIButtonColor
case
State
.
Normal
:
if
(
mTextureOutNormal
!=
""
)
{
texure2d
.
mainTexture
=
GameTextureManager
.
get
(
mTextureOutNormal
);
texure2d
.
mainTexture
=
GameTextureManager
.
GetUI
(
mTextureOutNormal
);
}
break
;
case
State
.
Hover
:
case
State
.
Pressed
:
if
(
mTextureOutPressed
!=
""
)
{
texure2d
.
mainTexture
=
GameTextureManager
.
get
(
mTextureOutPressed
);
texure2d
.
mainTexture
=
GameTextureManager
.
GetUI
(
mTextureOutPressed
);
}
break
;
}
...
...
Assets/NGUI/Scripts/UI/UITexture.cs
View file @
edfd3f53
...
...
@@ -46,10 +46,7 @@ public class UITexture : UIBasicSprite
protected
override
void
OnStart
()
{
base
.
OnStart
();
if
(
mOutPath
!=
""
)
{
mainTexture
=
GameTextureManager
.
get
(
mOutPath
);
}
if
(!
string
.
IsNullOrEmpty
(
mOutPath
))
mainTexture
=
GameTextureManager
.
GetUI
(
mOutPath
);
}
public
override
Texture
mainTexture
...
...
Assets/Plugins/System.Drawing.dll
deleted
100644 → 0
View file @
d2f2ec91
File deleted
Assets/Plugins/System.Drawing.dll.meta
deleted
100644 → 0
View file @
d2f2ec91
fileFormatVersion: 2
guid: f53581fb80be96f46b0cb1a267158562
timeCreated: 1480605668
licenseType: Pro
PluginImporter:
serializedVersion: 2
iconMap: {}
executionOrder: {}
isPreloaded: 0
isOverridable: 0
platformData:
data:
first:
Any:
second:
enabled: 1
settings: {}
data:
first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
data:
first:
Windows Store Apps: WindowsStoreApps
second:
enabled: 0
settings:
CPU: AnyCPU
userData:
assetBundleName:
assetBundleVariant:
Assets/Scripts/BackgroundLoader.cs.meta
View file @
edfd3f53
...
...
@@ -4,7 +4,7 @@ MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder:
-110
0
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
...
...
Assets/Scripts/MyCard.cs
0 → 100644
View file @
edfd3f53
using
System
;
using
UnityEngine
;
using
UnityEngine.Networking
;
namespace
DefaultNamespace
{
public
class
MyCard
{
public
static
void
LoadAvatar
(
string
username
,
Action
<
Texture2D
>
callback
)
{
var
request
=
UnityWebRequestTexture
.
GetTexture
(
$"https://sapi.moecube.com:444/accounts/users/
{
username
}
.png"
);
var
operation
=
request
.
SendWebRequest
();
operation
.
completed
+=
_
=>
{
if
(
request
.
error
!=
null
)
{
Debug
.
LogWarning
(
$"
{
request
.
url
}
:
{
request
.
error
}
"
);
return
;
}
callback
(((
DownloadHandlerTexture
)
request
.
downloadHandler
).
texture
);
};
}
}
}
\ No newline at end of file
Assets/Scripts/MyCard.cs.meta
0 → 100644
View file @
edfd3f53
fileFormatVersion: 2
guid: e23192c6a90f4880a6558e4dad535f94
timeCreated: 1630859585
\ No newline at end of file
Assets/SibylSystem/BackGroundPic/BackGroundPic.cs
View file @
edfd3f53
...
...
@@ -8,22 +8,9 @@ public class BackGroundPic : Servant
public
override
void
initialize
()
{
backGround
=
Program
.
I
().
mod_simple_ngui_background_texture
;
if
(!
File
.
Exists
(
"texture/common/desk.jpg"
))
{
backGround
.
SetActive
(
false
);
return
;
}
var
file
=
new
FileStream
(
"texture/common/desk.jpg"
,
FileMode
.
Open
,
FileAccess
.
Read
);
file
.
Seek
(
0
,
SeekOrigin
.
Begin
);
var
data
=
new
byte
[
file
.
Length
];
file
.
Read
(
data
,
0
,
(
int
)
file
.
Length
);
file
.
Close
();
file
.
Dispose
();
file
=
null
;
var
pic
=
new
Texture2D
(
1920
,
1080
);
pic
.
LoadImage
(
data
);
backGround
.
GetComponent
<
UITexture
>().
mainTexture
=
pic
;
if
(!
File
.
Exists
(
"texture/common/desk.jpg"
))
return
;
backGround
.
SetActive
(
true
);
backGround
.
GetComponent
<
UITexture
>().
mainTexture
=
UIHelper
.
GetTexture2D
(
"texture/common/desk.jpg"
);
backGround
.
GetComponent
<
UITexture
>().
depth
=
-
100
;
}
...
...
Assets/SibylSystem/CardDescription/CardDescription.cs
View file @
edfd3f53
...
...
@@ -211,7 +211,6 @@ public class CardDescription : Servant
picLoader
.
code
=
card
.
Id
;
picLoader
.
defaults
=
def
;
picLoader
.
loaded_code
=
-
1
;
currentCard
=
card
;
shiftCardShower
(
true
);
Program
.
go
(
50
,
()
=>
{
shiftCardShower
(
true
);
});
...
...
@@ -310,7 +309,7 @@ public class CardDescription : Servant
for
(
var
i
=
0
;
i
<
list
.
Count
;
i
++)
{
var
gp
=
UIHelper
.
get_hang_lie
(
i
,
eachLine
);
quickCards
[
currentCardIndex
].
reCode
(
list
[
i
].
get_data
().
Id
)
;
quickCards
[
currentCardIndex
].
code
=
list
[
i
].
get_data
().
Id
;
quickCards
[
currentCardIndex
].
transform
.
localPosition
=
new
Vector3
(
beginX
+
44
*
gp
.
y
,
beginY
-
60
*
gp
.
x
,
0
);
currentCardIndex
++;
...
...
Assets/SibylSystem/MonoHelpers/UIHelper.cs
View file @
edfd3f53
...
...
@@ -3,8 +3,10 @@ using System.Collections.Generic;
using
System.Diagnostics
;
using
System.Globalization
;
using
System.IO
;
using
System.Linq
;
using
System.Runtime.InteropServices
;
using
System.Text
;
using
System.Threading.Tasks
;
using
UnityEngine
;
using
UnityEngine.Rendering
;
using
YGOSharp.OCGWrapper.Enums
;
...
...
@@ -703,7 +705,7 @@ public static class UIHelper
if
(!
faces
.
ContainsKey
(
name
))
try
{
faces
.
Add
(
name
,
g
etTexture2D
(
"texture/face/"
+
fileInfos
[
i
].
Name
));
faces
.
Add
(
name
,
G
etTexture2D
(
"texture/face/"
+
fileInfos
[
i
].
Name
));
}
catch
(
Exception
e
)
{
...
...
@@ -730,30 +732,25 @@ public static class UIHelper
return
Program
.
I
().
face
.
faces
[
sum
];
}
public
static
Texture2D
g
etTexture2D
(
string
path
)
public
static
Texture2D
G
etTexture2D
(
string
path
)
{
Texture2D
pic
=
null
;
try
{
if
(!
File
.
Exists
(
path
))
return
null
;
var
file
=
new
FileStream
(
path
,
FileMode
.
Open
,
FileAccess
.
Read
);
file
.
Seek
(
0
,
SeekOrigin
.
Begin
);
var
data
=
new
byte
[
file
.
Length
];
file
.
Read
(
data
,
0
,
(
int
)
file
.
Length
);
file
.
Close
();
file
.
Dispose
();
file
=
null
;
pic
=
new
Texture2D
(
1024
,
600
);
pic
.
LoadImage
(
data
);
}
catch
(
Exception
e
)
{
Debug
.
Log
(
e
);
}
var
pic
=
new
Texture2D
(
0
,
0
);
pic
.
LoadImage
(
File
.
ReadAllBytes
(
path
));
return
pic
;
}
public
static
async
Task
<
Texture2D
>
GetTexture2DAsync
(
string
path
)
{
var
pic
=
new
Texture2D
(
0
,
0
);
// Unity < 2021.2
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
;
}
internal
static
void
shiftButton
(
UIButton
btn
,
bool
enabled
)
{
...
...
Assets/SibylSystem/Ocgcore/OCGobjects/gameCard.cs
View file @
edfd3f53
...
...
@@ -2,6 +2,7 @@
using
System.Collections
;
using
System.Collections.Generic
;
using
System.IO
;
using
DG.Tweening
;
using
TMPro
;
using
UnityEngine
;
using
YGOSharp
;
...
...
@@ -228,7 +229,6 @@ public class gameCard : OCGobject
loaded_cardCode
=
-
1
;
loaded_back
=
-
1
;
loaded_specialHint
=
-
1
;
loaded_verticalDrawingCode
=
-
1
;
loaded_verticalDrawingReal
=
Program
.
getVerticalTransparency
()
>
0.5f
;
loaded_verticalDrawingNumber
=
-
1
;
loaded_verticalOverAttribute
=
-
1
;
...
...
@@ -666,7 +666,7 @@ public class gameCard : OCGobject
var
screen_vector_to_move
=
screen
+
new
Vector3
(
pianyi
+
60f
*
(
overlayed_cards
.
Count
-
overlayed_cards
[
x
].
p
.
position
-
1
),
0
,
overlayed_cards
[
x
].
p
.
position
-
1
),
0
,
12f
+
2f
*
(
overlayed_cards
.
Count
-
overlayed_cards
[
x
].
p
.
position
-
1
));
overlayed_cards
[
x
].
flash_line_on
();
overlayed_cards
[
x
].
TweenTo
(
Camera
.
main
.
ScreenToWorldPoint
(
screen_vector_to_move
),
...
...
@@ -989,7 +989,6 @@ public class gameCard : OCGobject
Debug
.
Log
(
e
);
}
loaded_verticalDrawingCode
=
0
;
loaded_verticalDrawingNumber
=
-
1
;
loaded_verticalOverAttribute
=
-
1
;
loaded_verticalatk
=
-
1
;
...
...
@@ -1100,12 +1099,8 @@ public class gameCard : OCGobject
}
}
private
int
loaded_verticalDrawingCode
=
-
1
;
private
bool
loaded_verticalDrawingReal
;
private
float
loaded_verticalDrawingK
=
1
;
// bool picLikeASquare = false;
private
int
loaded_verticalDrawingNumber
=
-
1
;
private
int
loaded_verticalatk
=
-
1
;
private
int
loaded_verticaldef
=
-
1
;
...
...
@@ -1119,40 +1114,32 @@ public class gameCard : OCGobject
private
void
card_verticle_drawing_handler
()
{
if
(
game_object_verticle_drawing
==
null
||
loaded_verticalDrawingCode
!=
data
.
Id
||
if
(
game_object_verticle_drawing
==
null
||
loaded_verticalDrawingReal
!=
Program
.
getVerticalTransparency
()
>
0.5f
)
{
if
(
Program
.
getVerticalTransparency
()
>
0.5f
)
{
var
texture
=
GameTextureManager
.
get
(
data
.
Id
,
GameTextureType
.
card_verticle_drawing
);
if
(
texture
!
=
null
)
loaded_verticalDrawingK
=
1
;
//GameTextureManager.getK
(data.Id, GameTextureType.card_verticle_drawing);
if
(
game_object_verticle_drawing
=
=
null
)
{
loaded_verticalDrawingCode
=
data
.
Id
;
loaded_verticalDrawingK
=
GameTextureManager
.
getK
(
data
.
Id
,
GameTextureType
.
card_verticle_drawing
);
// picLikeASquare = GameTextureManager.getB(data.Id, GameTextureType.card_verticle_drawing);
if
(
game_object_verticle_drawing
==
null
)
{
game_object_verticle_drawing
=
create
(
Program
.
I
().
mod_simple_quad
,
gameObject
.
transform
.
position
,
new
Vector3
(
60
,
0
,
0
));
VerticleTransparency
=
1f
;
}
if
(
loaded_verticalDrawingReal
!=
Program
.
getVerticalTransparency
()
>
0.5f
)
{
loaded_verticalDrawingReal
=
Program
.
getVerticalTransparency
()
>
0.5f
;
game_object_verticle_drawing
.
transform
.
localScale
=
Vector3
.
zero
;
}
game_object_verticle_drawing
=
create
(
Program
.
I
().
mod_simple_quad
,
gameObject
.
transform
.
position
,
new
Vector3
(
60
,
0
,
0
));
VerticleTransparency
=
1f
;
}
game_object_verticle_drawing
.
GetComponent
<
Renderer
>().
material
.
mainTexture
=
texture
;
k_verticle
=
texture
.
width
/
(
float
)
texture
.
height
;
if
(
loaded_verticalDrawingReal
!=
Program
.
getVerticalTransparency
()
>
0.5f
)
{
loaded_verticalDrawingReal
=
Program
.
getVerticalTransparency
()
>
0.5f
;
game_object_verticle_drawing
.
transform
.
localScale
=
Vector3
.
zero
;
}
var
texture
=
game_object_verticle_drawing
.
GetComponent
<
Renderer
>().
material
.
mainTexture
;
k_verticle
=
texture
.
width
/
(
float
)
texture
.
height
;
}
else
{
var
texture
=
GameTextureManager
.
N
;
loaded_verticalDrawingCode
=
data
.
Id
;
loaded_verticalDrawingK
=
1
;
// picLikeASquare = true;
if
(
game_object_verticle_drawing
==
null
)
{
game_object_verticle_drawing
=
create
(
Program
.
I
().
mod_simple_quad
,
gameObject
.
transform
.
position
,
...
...
@@ -1173,14 +1160,6 @@ public class gameCard : OCGobject
else
{
var
trans
=
1f
;
//if (opMonsterWithBackGroundCard && loaded_verticalDrawingK < 0.9f && ability / loaded_verticalDrawingK > 2600f / 0.9f)
//{
// trans = 0.5f;
//}
//else
//{
// trans = 1f;
//}
trans
*=
Program
.
getVerticalTransparency
();
if
(
trans
<
0
)
trans
=
0
;
if
(
trans
>
1
)
trans
=
1
;
...
...
@@ -1405,8 +1384,8 @@ public class gameCard : OCGobject
public
void
set_data
(
Card
d
)
{
data
=
d
;
//caculateAbility();
if
(
Program
.
I
().
cardDescription
.
ifShowingThisCard
(
data
))
showMeLeft
();
LoadCard
();
}
public
void
set_code
(
int
code
)
...
...
@@ -1448,49 +1427,28 @@ public class gameCard : OCGobject
private
int
loaded_specialHint
=
-
1
;
private
bool
cardCodeChangedButNowLoadedPic
;
private
void
card_picture_handler
()
private
async
void
LoadCard
()
{
if
(
loaded_cardCode
!=
data
.
Id
)
{
loaded_cardCode
=
data
.
Id
;
cardCodeChangedButNowLoadedPic
=
true
;
}
if
(
loaded_cardPictureCode
!=
data
.
Id
)
{
var
texture
=
GameTextureManager
.
get
(
data
.
Id
,
GameTextureType
.
card_picture
,
p
.
controller
==
0
?
GameTextureManager
.
myBack
:
GameTextureManager
.
opBack
);
if
(
texture
!=
null
)
{
loaded_cardPictureCode
=
data
.
Id
;
gameObject_face
.
GetComponent
<
Renderer
>().
material
.
mainTexture
=
texture
;
}
else
{
if
(
cardCodeChangedButNowLoadedPic
)
{
gameObject_face
.
GetComponent
<
Renderer
>().
material
.
mainTexture
=
GameTextureManager
.
unknown
;
cardCodeChangedButNowLoadedPic
=
false
;
}
}
}
gameObject_face
.
GetComponent
<
Renderer
>().
material
.
mainTexture
=
await
GameTextureManager
.
GetCardPicture
(
data
.
Id
,
p
.
controller
==
0
?
GameTextureManager
.
myBack
:
GameTextureManager
.
opBack
);
if
(
game_object_verticle_drawing
)
game_object_verticle_drawing
.
GetComponent
<
Renderer
>().
material
.
mainTexture
=
await
GameTextureManager
.
GetCardCloseUp
(
data
.
Id
);
}
private
void
card_picture_handler
()
{
if
(
p
.
controller
!=
loaded_back
)
try
{
loaded_back
=
(
int
)
p
.
controller
;
UIHelper
.
getByName
(
gameObject
,
"back"
).
GetComponent
<
Renderer
>().
material
.
mainTexture
=
{
loaded_back
=
(
int
)
p
.
controller
;
UIHelper
.
getByName
(
gameObject
,
"back"
).
GetComponent
<
Renderer
>().
material
.
mainTexture
=
loaded_back
==
0
?
GameTextureManager
.
myBack
:
GameTextureManager
.
opBack
;
if
(
data
.
Id
==
0
)
UIHelper
.
getByName
(
gameObject
,
"face"
).
GetComponent
<
Renderer
>().
material
.
mainTexture
=
loaded_back
==
0
?
GameTextureManager
.
myBack
:
GameTextureManager
.
opBack
;
if
(
data
.
Id
==
0
)
UIHelper
.
getByName
(
gameObject
,
"face"
).
GetComponent
<
Renderer
>().
material
.
mainTexture
=
loaded_back
==
0
?
GameTextureManager
.
myBack
:
GameTextureManager
.
opBack
;
del_one_tail
(
GameStringHelper
.
opHint
);
if
(
loaded_back
!=
controllerBased
)
add_string_tail
(
GameStringHelper
.
opHint
);
}
catch
(
Exception
e
)
{
Debug
.
Log
(
e
);
}
del_one_tail
(
GameStringHelper
.
opHint
);
if
(
loaded_back
!=
controllerBased
)
add_string_tail
(
GameStringHelper
.
opHint
);
}
var
special_hint
=
0
;
if
((
p
.
position
&
(
int
)
CardPosition
.
FaceDown
)
>
0
)
...
...
@@ -2007,37 +1965,36 @@ public class gameCard : OCGobject
if
(
show_off_disabled
)
{
refreshFunctions
.
Add
(
SOH_dis
);
SOH_dis
(
);
Program
.
I
().
ocgcore
.
Sleep
(
42
);
}
else
if
(
show_off_shokewave
)
{
if
(
Program
.
I
().
setting
.
setting
.
showoff
.
value
==
false
||
File
.
Exists
(
"picture/closeup/"
+
data
.
Id
+
".png"
)
==
false
||
data
.
Attack
<
Program
.
I
().
setting
.
atk
&&
data
.
Level
<
Program
.
I
().
setting
.
star
)
if
(
Program
.
I
().
setting
.
setting
.
showoff
.
value
&&
File
.
Exists
(
"picture/closeup/"
+
data
.
Id
+
".png"
)
&&
(
data
.
Attack
>=
Program
.
I
().
setting
.
atk
||
data
.
Level
>=
Program
.
I
().
setting
.
star
))
{
refreshFunctions
.
Add
(
SOH_nSum
);
Program
.
I
().
ocgcore
.
Sleep
(
30
);
SOH_sum
(
);
Program
.
I
().
ocgcore
.
Sleep
(
72
);
}
else
{
refreshFunctions
.
Add
(
SOH_sum
);
Program
.
I
().
ocgcore
.
Sleep
(
72
);
SOH_nSum
(
);
Program
.
I
().
ocgcore
.
Sleep
(
30
);
}
}
else
{
if
(
Program
.
I
().
setting
.
setting
.
showoffWhenActived
.
value
==
false
||
File
.
Exists
(
"picture/closeup/"
+
data
.
Id
+
".png"
)
==
false
)
if
(
Program
.
I
().
setting
.
setting
.
showoffWhenActived
.
value
&&
File
.
Exists
(
"picture/closeup/"
+
data
.
Id
+
".png"
))
{
refreshFunctions
.
Add
(
SOH_nAct
);
Program
.
I
().
ocgcore
.
Sleep
(
42
);
SOH_act
();
}
else
{
refreshFunctions
.
Add
(
SOH_act
);
Program
.
I
().
ocgcore
.
Sleep
(
42
);
SOH_nAct
();
}
Program
.
I
().
ocgcore
.
Sleep
(
42
);
}
}
...
...
@@ -2047,112 +2004,76 @@ public class gameCard : OCGobject
private
int
show_off_begin_time
;
private
void
SOH_act
()
{
var
tex
=
GameTextureManager
.
get
(
data
.
Id
,
GameTextureType
.
card_picture
);
var
texc
=
GameTextureManager
.
get
(
data
.
Id
,
GameTextureType
.
card_feature
);
if
(
tex
!=
null
)
if
(
texc
!=
null
)
{
var
k
=
GameTextureManager
.
getK
(
data
.
Id
,
GameTextureType
.
card_feature
);
refreshFunctions
.
Remove
(
SOH_act
);
var
shower
=
create
(
Program
.
I
().
Pro1_superCardShowerA
,
Program
.
I
().
ocgcore
.
centre
(
true
),
Vector3
.
zero
,
false
,
Program
.
I
().
ui_main_2d
).
GetComponent
<
YGO1superShower
>();
shower
.
card
.
mainTexture
=
tex
;
shower
.
closeup
.
mainTexture
=
texc
;
shower
.
closeup
.
height
=
(
int
)
(
500f
/
k
);
shower
.
closeup
.
width
=
(
int
)
(
500f
/
k
*
texc
.
width
/
texc
.
height
);
Ocgcore
.
LRCgo
=
shower
.
gameObject
;
destroy
(
shower
.
gameObject
,
0.7f
,
false
,
true
);
}
}
private
void
SOH_nAct
()
{
var
tex
=
GameTextureManager
.
get
(
data
.
Id
,
GameTextureType
.
card_picture
);
if
(
tex
!=
null
)
{
refreshFunctions
.
Remove
(
SOH_nAct
);
var
shower
=
create
(
Program
.
I
().
Pro1_CardShower
,
Program
.
I
().
ocgcore
.
centre
(),
Vector3
.
zero
,
false
,
Program
.
I
().
ui_main_2d
).
GetComponent
<
pro1CardShower
>();
shower
.
card
.
mainTexture
=
tex
;
shower
.
mask
.
mainTexture
=
GameTextureManager
.
Mask
;
shower
.
disable
.
mainTexture
=
GameTextureManager
.
negated
;
shower
.
transform
.
localScale
=
Vector3
.
zero
;
shower
.
gameObject
.
transform
.
localScale
=
new
Vector3
(
Screen
.
height
/
650f
,
Screen
.
height
/
650f
,
Screen
.
height
/
650f
);
shower
.
run
();
Ocgcore
.
LRCgo
=
shower
.
gameObject
;
destroy
(
shower
.
gameObject
,
0.7f
,
false
,
true
);
}
}
private
void
SOH_sum
()
{
var
tex
=
GameTextureManager
.
get
(
data
.
Id
,
GameTextureType
.
card_picture
);
var
texc
=
GameTextureManager
.
get
(
data
.
Id
,
GameTextureType
.
card_feature
);
if
(
tex
!=
null
)
if
(
texc
!=
null
)
{
var
k
=
GameTextureManager
.
getK
(
data
.
Id
,
GameTextureType
.
card_feature
);
refreshFunctions
.
Remove
(
SOH_sum
);
var
shower
=
create
(
Program
.
I
().
Pro1_superCardShower
,
Program
.
I
().
ocgcore
.
centre
(
true
),
Vector3
.
zero
,
false
,
Program
.
I
().
ui_main_2d
).
GetComponent
<
YGO1superShower
>();
shower
.
card
.
mainTexture
=
tex
;
shower
.
closeup
.
mainTexture
=
texc
;
shower
.
closeup
.
height
=
(
int
)
(
500f
/
k
);
shower
.
closeup
.
width
=
(
int
)
(
500f
/
k
*
texc
.
width
/
texc
.
height
);
Ocgcore
.
LRCgo
=
shower
.
gameObject
;
destroy
(
shower
.
gameObject
,
2f
,
false
,
true
);
}
}
private
void
SOH_nSum
()
{
var
tex
=
GameTextureManager
.
get
(
data
.
Id
,
GameTextureType
.
card_picture
);
if
(
tex
!=
null
)
{
refreshFunctions
.
Remove
(
SOH_nSum
);
var
shower
=
create
(
Program
.
I
().
Pro1_CardShower
,
Program
.
I
().
ocgcore
.
centre
(),
Vector3
.
zero
,
false
,
Program
.
I
().
ui_main_2d
).
GetComponent
<
pro1CardShower
>();
shower
.
card
.
mainTexture
=
tex
;
shower
.
mask
.
mainTexture
=
GameTextureManager
.
Mask
;
shower
.
disable
.
mainTexture
=
GameTextureManager
.
negated
;
shower
.
transform
.
localScale
=
Vector3
.
zero
;
iTween
.
ScaleTo
(
shower
.
gameObject
,
iTween
.
Hash
(
"scale"
,
new
Vector3
(
Screen
.
height
/
650f
,
Screen
.
height
/
650f
,
Screen
.
height
/
650f
),
"time"
,
0.5f
));
Ocgcore
.
LRCgo
=
shower
.
gameObject
;
destroy
(
shower
.
gameObject
,
0.5f
,
false
,
true
);
}
}
private
void
SOH_dis
()
{
var
tex
=
GameTextureManager
.
get
(
data
.
Id
,
GameTextureType
.
card_picture
);
if
(
tex
!=
null
)
{
refreshFunctions
.
Remove
(
SOH_dis
);
var
shower
=
create
(
Program
.
I
().
Pro1_CardShower
,
Program
.
I
().
ocgcore
.
centre
(),
Vector3
.
zero
,
false
,
Program
.
I
().
ui_main_2d
).
GetComponent
<
pro1CardShower
>();
shower
.
card
.
mainTexture
=
tex
;
shower
.
mask
.
mainTexture
=
GameTextureManager
.
Mask
;
shower
.
disable
.
mainTexture
=
GameTextureManager
.
negated
;
shower
.
transform
.
localScale
=
Vector3
.
zero
;
shower
.
gameObject
.
transform
.
localScale
=
new
Vector3
(
Screen
.
height
/
650f
,
Screen
.
height
/
650f
,
Screen
.
height
/
650f
);
shower
.
Dis
();
Ocgcore
.
LRCgo
=
shower
.
gameObject
;
destroy
(
shower
.
gameObject
,
0.7f
,
false
,
true
);
}
private
async
void
SOH_act
()
{
var
k
=
1
;
//GameTextureManager.getK(data.Id, GameTextureType.card_feature);
var
shower
=
create
(
Program
.
I
().
Pro1_superCardShowerA
,
Program
.
I
().
ocgcore
.
centre
(
true
),
Vector3
.
zero
,
false
,
Program
.
I
().
ui_main_2d
).
GetComponent
<
YGO1superShower
>();
shower
.
card
.
mainTexture
=
await
GameTextureManager
.
GetCardPicture
(
data
.
Id
);
shower
.
closeup
.
mainTexture
=
await
GameTextureManager
.
GetCardCloseUp
(
data
.
Id
);
shower
.
closeup
.
height
=
(
int
)
(
500f
/
k
);
shower
.
closeup
.
width
=
(
int
)
(
500f
/
k
*
shower
.
closeup
.
mainTexture
.
width
/
shower
.
closeup
.
mainTexture
.
height
);
Ocgcore
.
LRCgo
=
shower
.
gameObject
;
destroy
(
shower
.
gameObject
,
0.7f
,
false
,
true
);
}
private
async
void
SOH_nAct
()
{
var
shower
=
create
(
Program
.
I
().
Pro1_CardShower
,
Program
.
I
().
ocgcore
.
centre
(),
Vector3
.
zero
,
false
,
Program
.
I
().
ui_main_2d
).
GetComponent
<
pro1CardShower
>();
shower
.
card
.
mainTexture
=
await
GameTextureManager
.
GetCardPicture
(
data
.
Id
);
shower
.
mask
.
mainTexture
=
GameTextureManager
.
Mask
;
shower
.
disable
.
mainTexture
=
GameTextureManager
.
negated
;
shower
.
transform
.
localScale
=
Vector3
.
zero
;
shower
.
gameObject
.
transform
.
localScale
=
Utils
.
UIHeight
()
/
650f
*
Vector3
.
one
;
shower
.
run
();
Ocgcore
.
LRCgo
=
shower
.
gameObject
;
destroy
(
shower
.
gameObject
,
0.7f
,
false
,
true
);
}
private
async
void
SOH_sum
()
{
var
k
=
1
;
//GameTextureManager.getK(data.Id, GameTextureType.card_feature);
var
shower
=
create
(
Program
.
I
().
Pro1_superCardShower
,
Program
.
I
().
ocgcore
.
centre
(
true
),
Vector3
.
zero
,
false
,
Program
.
I
().
ui_main_2d
).
GetComponent
<
YGO1superShower
>();
shower
.
card
.
mainTexture
=
await
GameTextureManager
.
GetCardPicture
(
data
.
Id
);
shower
.
closeup
.
mainTexture
=
await
GameTextureManager
.
GetCardCloseUp
(
data
.
Id
);
shower
.
closeup
.
height
=
(
int
)
(
500f
/
k
);
shower
.
closeup
.
width
=
(
int
)
(
500f
/
k
*
shower
.
closeup
.
mainTexture
.
width
/
shower
.
closeup
.
mainTexture
.
height
);
Ocgcore
.
LRCgo
=
shower
.
gameObject
;
destroy
(
shower
.
gameObject
,
2f
,
false
,
true
);
}
private
async
void
SOH_nSum
()
{
var
shower
=
create
(
Program
.
I
().
Pro1_CardShower
,
Program
.
I
().
ocgcore
.
centre
(),
Vector3
.
zero
,
false
,
Program
.
I
().
ui_main_2d
).
GetComponent
<
pro1CardShower
>();
shower
.
card
.
mainTexture
=
await
GameTextureManager
.
GetCardPicture
(
data
.
Id
);
shower
.
mask
.
mainTexture
=
GameTextureManager
.
Mask
;
shower
.
disable
.
mainTexture
=
GameTextureManager
.
negated
;
shower
.
transform
.
localScale
=
Vector3
.
zero
;
shower
.
transform
.
DOScale
(
Utils
.
UIHeight
()
/
650f
*
Vector3
.
one
,
0.5f
);
Ocgcore
.
LRCgo
=
shower
.
gameObject
;
destroy
(
shower
.
gameObject
,
0.5f
,
false
,
true
);
}
private
async
void
SOH_dis
()
{
var
shower
=
create
(
Program
.
I
().
Pro1_CardShower
,
Program
.
I
().
ocgcore
.
centre
(),
Vector3
.
zero
,
false
,
Program
.
I
().
ui_main_2d
).
GetComponent
<
pro1CardShower
>();
shower
.
card
.
mainTexture
=
await
GameTextureManager
.
GetCardPicture
(
data
.
Id
);
shower
.
mask
.
mainTexture
=
GameTextureManager
.
Mask
;
shower
.
disable
.
mainTexture
=
GameTextureManager
.
negated
;
shower
.
transform
.
localScale
=
Vector3
.
zero
;
shower
.
gameObject
.
transform
.
localScale
=
Utils
.
UIHeight
()
/
650f
*
Vector3
.
one
;
shower
.
Dis
();
Ocgcore
.
LRCgo
=
shower
.
gameObject
;
destroy
(
shower
.
gameObject
,
0.7f
,
false
,
true
);
}
public
void
sortButtons
()
...
...
Assets/SibylSystem/Ocgcore/OCGobjects/gameField.cs
View file @
edfd3f53
...
...
@@ -176,7 +176,7 @@ public class GameField : OCGobject
{
if
(
File
.
Exists
(
"texture/duel/field.png"
))
{
var
textureField
=
UIHelper
.
g
etTexture2D
(
"texture/duel/field.png"
);
var
textureField
=
UIHelper
.
G
etTexture2D
(
"texture/duel/field.png"
);
var
textureFieldSliced
=
UIHelper
.
sliceField
(
textureField
);
leftT
.
mainTexture
=
textureFieldSliced
[
0
];
midT
.
mainTexture
=
textureFieldSliced
[
1
];
...
...
@@ -197,7 +197,7 @@ public class GameField : OCGobject
{
if
(
File
.
Exists
(
"texture/duel/newfield.png"
))
{
var
textureField
=
UIHelper
.
g
etTexture2D
(
"texture/duel/newfield.png"
);
var
textureField
=
UIHelper
.
G
etTexture2D
(
"texture/duel/newfield.png"
);
var
textureFieldSliced
=
UIHelper
.
sliceField
(
textureField
);
leftT
.
mainTexture
=
textureFieldSliced
[
0
];
midT
.
mainTexture
=
textureFieldSliced
[
1
];
...
...
@@ -494,8 +494,8 @@ public class GameField : OCGobject
break
;
}
if
(
tex
==
null
)
tex
=
UIHelper
.
g
etTexture2D
(
"picture/field/"
+
code
+
".png"
);
if
(
tex
==
null
)
tex
=
UIHelper
.
g
etTexture2D
(
"picture/field/"
+
code
+
".jpg"
);
if
(
tex
==
null
)
tex
=
UIHelper
.
G
etTexture2D
(
"picture/field/"
+
code
+
".png"
);
if
(
tex
==
null
)
tex
=
UIHelper
.
G
etTexture2D
(
"picture/field/"
+
code
+
".jpg"
);
if
(
tex
!=
null
)
{
UIHelper
.
getByName
<
UITexture
>(
gameObject
,
"field_"
+
player
).
mainTexture
=
tex
;
...
...
@@ -573,9 +573,7 @@ public class GameField : OCGobject
if
(
Ocgcore
.
inSkiping
)
return
;
if
(
only
)
destroy
(
big_string
);
big_string
=
create
(
Program
.
I
().
New_phase
,
Program
.
I
().
ocgcore
.
centre
(),
Vector3
.
zero
,
false
,
Program
.
I
().
ui_main_2d
,
true
,
new
Vector3
(
Screen
.
height
/
1000f
*
Program
.
fieldSize
,
Screen
.
height
/
1000f
*
Program
.
fieldSize
,
Screen
.
height
/
1000f
*
Program
.
fieldSize
));
Program
.
I
().
ui_main_2d
,
true
,
Utils
.
UIHeight
()
/
1000f
*
Program
.
fieldSize
*
Vector3
.
one
);
big_string
.
GetComponentInChildren
<
UITexture
>().
mainTexture
=
tex
;
Program
.
I
().
ocgcore
.
Sleep
(
40
);
big_string
.
AddComponent
<
animation_screen_lock2
>();
...
...
Assets/SibylSystem/Ocgcore/Ocgcore.cs
View file @
edfd3f53
...
...
@@ -55,7 +55,7 @@ public class Ocgcore : ServantWithCardDescription
private
readonly
List
<
gameCard
>
cardsSelected
=
new
List
<
gameCard
>();
private
bool
clearAllShowedB
;
private
bool
clearTimeFlag
;
private
long
code_for_show
;
private
int
code_for_show
;
public
Condition
condition
=
Condition
.
duel
;
public
List
<
string
>
confirmedCards
=
new
List
<
string
>();
...
...
@@ -474,11 +474,11 @@ public class Ocgcore : ServantWithCardDescription
Arrow
.
gameObject
.
SetActive
(
false
);
replayShowAll
=
Config
.
Get
(
"replayShowAll"
,
"0"
)
!=
"0"
;
reportShowAll
=
Config
.
Get
(
"reportShowAll"
,
"0"
)
!=
"0"
;
gameInfo
=
Program
.
I
().
new_ui_gameInfo
;
gameInfo
.
ini
();
UIHelper
.
InterGameObject
(
gameInfo
.
gameObject
);
shiftCondition
(
Condition
.
duel
);
...
...
@@ -7586,7 +7586,7 @@ public class Ocgcore : ServantWithCardDescription
if
(
leftExcited
)
if
(
Input
.
GetKey
(
KeyCode
.
A
)
==
false
)
leftExcited
=
false
;
//gameInfo.keepChain_set(false);
//gameInfo.keepChain_set(false);
}
base
.
ES_mouseUpEmpty
();
...
...
@@ -7603,7 +7603,7 @@ public class Ocgcore : ServantWithCardDescription
if
(
leftExcited
)
if
(
Input
.
GetKey
(
KeyCode
.
A
)
==
false
)
leftExcited
=
false
;
//gameInfo.keepChain_set(false);
//gameInfo.keepChain_set(false);
base
.
ES_mouseUpGameObject
(
gameObject
);
}
...
...
@@ -7613,7 +7613,7 @@ public class Ocgcore : ServantWithCardDescription
if
(
rightExcited
)
if
(
Input
.
GetKey
(
KeyCode
.
S
)
==
false
)
rightExcited
=
false
;
//gameInfo.ignoreChain_set(false);
//gameInfo.ignoreChain_set(false);
if
(
gameInfo
.
queryHashedButton
(
"sendSelected"
))
{
sendSelectedCards
();
...
...
@@ -7655,37 +7655,23 @@ public class Ocgcore : ServantWithCardDescription
target
.
animation_confirm_screenCenter
(
new
Vector3
(-
30
,
0
,
0
),
0.2f
,
0.5f
);
}
public
void
animation_show_card_code
(
long
code
)
public
void
animation_show_card_code
(
int
code
)
{
code_for_show
=
code
;
AddUpdateAction_s
(
animation_show_card_code_handler
);
animation_show_card_code_handler
(
);
Sleep
(
30
);
}
private
void
animation_show_card_code_handler
()
private
async
void
animation_show_card_code_handler
()
{
var
texture
=
GameTextureManager
.
get
(
code_for_show
,
GameTextureType
.
card_picture
);
if
(
texture
!=
null
)
{
RemoveUpdateAction_s
(
animation_show_card_code_handler
);
//Vector3 position = Program.I().main_camera.ScreenToWorldPoint(new Vector3(getScreenCenter(), Screen.height / 2f, 10));
//GameObject obj = create_s(Program.I().mod_simple_quad);
//obj.AddComponent<animation_screen_lock>().screen_point = new Vector3(getScreenCenter(), Screen.height / 2f, 6);
//obj.transform.eulerAngles = new Vector3(60, 0, 0);
//obj.GetComponent<Renderer>().material.mainTexture = texture;
//obj.transform.localPosition = position;
//obj.transform.localScale = new Vector3(3.2f, 4.6f, 1f);
//destroy(obj, 1f);
var
shower
=
create
(
Program
.
I
().
Pro1_CardShower
,
Program
.
I
().
ocgcore
.
centre
(),
Vector3
.
zero
,
false
,
Program
.
I
().
ui_main_2d
).
GetComponent
<
pro1CardShower
>();
shower
.
card
.
mainTexture
=
texture
;
shower
.
mask
.
mainTexture
=
GameTextureManager
.
Mask
;
shower
.
disable
.
mainTexture
=
GameTextureManager
.
negated
;
shower
.
gameObject
.
transform
.
localScale
=
new
Vector3
(
Screen
.
height
/
650f
,
Screen
.
height
/
650f
,
Screen
.
height
/
650f
);
destroy
(
shower
.
gameObject
,
0.5f
);
}
var
shower
=
create
(
Program
.
I
().
Pro1_CardShower
,
Program
.
I
().
ocgcore
.
centre
(),
Vector3
.
zero
,
false
,
Program
.
I
().
ui_main_2d
).
GetComponent
<
pro1CardShower
>();
shower
.
card
.
mainTexture
=
await
GameTextureManager
.
GetCardPicture
(
code_for_show
);
shower
.
mask
.
mainTexture
=
GameTextureManager
.
Mask
;
shower
.
disable
.
mainTexture
=
GameTextureManager
.
negated
;
shower
.
gameObject
.
transform
.
localScale
=
Utils
.
UIHeight
()
/
650f
*
Vector3
.
one
;
destroy
(
shower
.
gameObject
,
0.5f
);
}
private
class
linkMask
...
...
Assets/SibylSystem/ResourceManagers/GameTextureManager.cs
View file @
edfd3f53
using
System
;
using
System.Collections.Generic
;
using
System.Drawing
;
using
System.Drawing.Imaging
;
using
System.Collections.Generic
;
using
System.IO
;
using
System.Runtime.InteropServices
;
using
System.Text.RegularExpressions
;
using
System.Threading
;
using
System.Threading.Tasks
;
using
UnityEngine
;
using
YGOSharp
;
using
YGOSharp.OCGWrapper.Enums
;
using
Color
=
UnityEngine
.
Color
;
public
enum
GameTextureType
{
card_picture
=
0
,
card_verticle_drawing
=
1
,
card_feature
=
3
}
public
class
GameTextureManager
{
private
static
bool
bLock
;
private
static
readonly
Stack
<
PictureResource
>
waitLoadStack
=
new
Stack
<
PictureResource
>();
private
static
readonly
Dictionary
<
ulong
,
PictureResource
>
loadedList
=
new
Dictionary
<
ulong
,
PictureResource
>();
private
static
readonly
Dictionary
<
ulong
,
bool
>
addedMap
=
new
Dictionary
<
ulong
,
bool
>();
private
static
readonly
BetterList
<
UIPictureResource
>
allUI
=
new
BetterList
<
UIPictureResource
>();
public
static
Texture2D
myBack
;
public
static
Texture2D
opBack
;
public
static
Texture2D
unknown
;
public
static
Texture2D
attack
;
public
static
Texture2D
negated
;
public
static
Texture2D
bar
;
public
static
Texture2D
exBar
;
public
static
Texture2D
lp
;
public
static
Texture2D
time
;
public
static
Texture2D
L
;
public
static
Texture2D
R
;
public
static
Texture2D
Chain
;
public
static
Texture2D
Mask
;
public
static
Texture2D
N
;
public
static
Texture2D
LINK
;
public
static
Texture2D
LINKm
;
public
static
Texture2D
nt
;
public
static
Texture2D
bp
;
public
static
Texture2D
ep
;
public
static
Texture2D
mp1
;
public
static
Texture2D
mp2
;
public
static
Texture2D
dp
;
public
static
Texture2D
sp
;
public
static
Texture2D
phase
;
public
static
Texture2D
rs
;
public
static
Texture2D
ts
;
public
static
bool
uiLoaded
;
public
static
Color
chainColor
=
Color
.
white
;
public
static
void
clearUnloaded
()
internal
static
void
initialize
()
{
while
(
true
)
try
{
while
(
waitLoadStack
.
Count
>
0
)
{
var
a
=
waitLoadStack
.
Pop
();
addedMap
.
Remove
(((
ulong
)
a
.
type
<<
32
)
|
(
ulong
)
a
.
code
);
}
break
;
}
catch
(
Exception
e
)
{
Thread
.
Sleep
(
10
);
Debug
.
Log
(
e
);
}
attack
=
UIHelper
.
GetTexture2D
(
"texture/duel/attack.png"
);
myBack
=
UIHelper
.
GetTexture2D
(
"texture/duel/me.jpg"
);
opBack
=
UIHelper
.
GetTexture2D
(
"texture/duel/opponent.jpg"
);
unknown
=
UIHelper
.
GetTexture2D
(
"texture/duel/unknown.jpg"
);
negated
=
UIHelper
.
GetTexture2D
(
"texture/duel/negated.png"
);
bar
=
UIHelper
.
GetTexture2D
(
"texture/duel/healthBar/bg.png"
);
exBar
=
UIHelper
.
GetTexture2D
(
"texture/duel/healthBar/excited.png"
);
time
=
UIHelper
.
GetTexture2D
(
"texture/duel/healthBar/t.png"
);
lp
=
UIHelper
.
GetTexture2D
(
"texture/duel/healthBar/lp.png"
);
L
=
UIHelper
.
GetTexture2D
(
"texture/duel/L.png"
);
R
=
UIHelper
.
GetTexture2D
(
"texture/duel/R.png"
);
LINK
=
UIHelper
.
GetTexture2D
(
"texture/duel/link.png"
);
LINKm
=
UIHelper
.
GetTexture2D
(
"texture/duel/linkMask.png"
);
Chain
=
UIHelper
.
GetTexture2D
(
"texture/duel/chain.png"
);
Mask
=
UIHelper
.
GetTexture2D
(
"texture/duel/mask.png"
);
nt
=
UIHelper
.
GetTexture2D
(
"texture/duel/phase/nt.png"
);
bp
=
UIHelper
.
GetTexture2D
(
"texture/duel/phase/bp.png"
);
ep
=
UIHelper
.
GetTexture2D
(
"texture/duel/phase/ep.png"
);
mp1
=
UIHelper
.
GetTexture2D
(
"texture/duel/phase/mp1.png"
);
mp2
=
UIHelper
.
GetTexture2D
(
"texture/duel/phase/mp2.png"
);
dp
=
UIHelper
.
GetTexture2D
(
"texture/duel/phase/dp.png"
);
sp
=
UIHelper
.
GetTexture2D
(
"texture/duel/phase/sp.png"
);
phase
=
UIHelper
.
GetTexture2D
(
"texture/duel/phase/phase.png"
);
rs
=
UIHelper
.
GetTexture2D
(
"texture/duel/phase/rs.png"
);
ts
=
UIHelper
.
GetTexture2D
(
"texture/duel/phase/ts.png"
);
N
=
new
Texture2D
(
10
,
10
);
for
(
var
i
=
0
;
i
<
10
;
i
++)
for
(
var
a
=
0
;
a
<
10
;
a
++)
N
.
SetPixel
(
i
,
a
,
new
Color
(
0
,
0
,
0
,
0
));
N
.
Apply
();
ColorUtility
.
TryParseHtmlString
(
File
.
ReadAllText
(
"texture/duel/chainColor.txt"
),
out
chainColor
);
}
public
static
void
clearAll
()
{
while
(
true
)
try
{
waitLoadStack
.
Clear
();
loadedList
.
Clear
();
addedMap
.
Clear
();
break
;
}
catch
(
Exception
e
)
{
Thread
.
Sleep
(
10
);
Debug
.
Log
(
e
);
}
}
private
static
void
thread_run
()
{
while
(
Program
.
Running
)
try
{
Thread
.
Sleep
(
50
);
var
thu
=
0
;
while
(
waitLoadStack
.
Count
>
0
)
{
thu
++;
if
(
thu
==
10
)
{
Thread
.
Sleep
(
50
);
thu
=
0
;
}
if
(
bLock
==
false
)
{
PictureResource
pic
;
pic
=
waitLoadStack
.
Pop
();
try
{
pic
.
pCard
=
(
CardsManager
.
Get
((
int
)
pic
.
code
).
Type
&
(
int
)
CardType
.
Pendulum
)
>
0
;
}
catch
(
Exception
e
)
{
Debug
.
Log
(
"e 0"
+
e
);
}
if
(
pic
.
type
==
GameTextureType
.
card_feature
)
try
{
ProcessingCardFeature
(
pic
);
}
catch
(
Exception
e
)
{
Debug
.
Log
(
"e 1"
+
e
);
}
if
(
pic
.
type
==
GameTextureType
.
card_picture
)
try
{
ProcessingCardPicture
(
pic
);
}
catch
(
Exception
e
)
{
Debug
.
Log
(
"e 2"
+
e
);
}
if
(
pic
.
type
==
GameTextureType
.
card_verticle_drawing
)
try
{
ProcessingVerticleDrawing
(
pic
);
}
catch
(
Exception
e
)
{
Debug
.
Log
(
"e 3"
+
e
);
}
}
}
}
catch
(
Exception
e
)
{
Debug
.
Log
(
"erroe 1"
+
e
);
}
}
private
static
BitmapHelper
getCloseup
(
PictureResource
pic
)
{
BitmapHelper
bitmap
=
null
;
var
found
=
false
;
var
code
=
pic
.
code
.
ToString
();
foreach
(
var
zip
in
GameZipManager
.
Zips
)
{
if
(
zip
.
Name
.
ToLower
().
EndsWith
(
"script.zip"
))
continue
;
foreach
(
var
file
in
zip
.
EntryFileNames
)
if
(
Regex
.
IsMatch
(
file
.
ToLower
(),
"closeup/"
+
code
+
"\\.png$"
))
{
var
ms
=
new
MemoryStream
();
var
e
=
zip
[
file
];
e
.
Extract
(
ms
);
bitmap
=
new
BitmapHelper
(
ms
);
found
=
true
;
break
;
}
if
(
found
)
break
;
}
if
(!
found
)
{
var
path
=
"picture/closeup/"
+
code
+
".png"
;
if
(
File
.
Exists
(
path
))
bitmap
=
new
BitmapHelper
(
path
);
}
return
bitmap
;
}
private
static
byte
[]
getPicture
(
PictureResource
pic
,
out
bool
EightEdition
)
{
EightEdition
=
false
;
var
code
=
pic
.
code
.
ToString
();
foreach
(
var
zip
in
GameZipManager
.
Zips
)
{
if
(
zip
.
Name
.
ToLower
().
EndsWith
(
"script.zip"
))
continue
;
foreach
(
var
file
in
zip
.
EntryFileNames
)
if
(
Regex
.
IsMatch
(
file
.
ToLower
(),
"pics/"
+
code
+
"\\.(jpg|png)$"
))
{
var
ms
=
new
MemoryStream
();
var
e
=
zip
[
file
];
e
.
Extract
(
ms
);
return
ms
.
ToArray
();
}
}
var
path
=
"picture/card/"
+
code
+
".png"
;
if
(!
File
.
Exists
(
path
))
path
=
"picture/card/"
+
code
+
".jpg"
;
if
(!
File
.
Exists
(
path
))
{
EightEdition
=
true
;
path
=
"picture/cardIn8thEdition/"
+
code
+
".png"
;
}
if
(!
File
.
Exists
(
path
))
{
EightEdition
=
true
;
path
=
"picture/cardIn8thEdition/"
+
code
+
".jpg"
;
}
if
(
File
.
Exists
(
path
))
using
(
var
file
=
new
FileStream
(
path
,
FileMode
.
Open
,
FileAccess
.
Read
))
{
file
.
Seek
(
0
,
SeekOrigin
.
Begin
);
var
data
=
new
byte
[
file
.
Length
];
file
.
Read
(
data
,
0
,
(
int
)
file
.
Length
);
return
data
;
}
return
new
byte
[
0
];
}
private
static
void
ProcessingCardFeature
(
PictureResource
pic
)
{
if
(
loadedList
.
ContainsKey
(
hashPic
(
pic
.
code
,
pic
.
type
)))
return
;
var
EightEdition
=
false
;
var
bitmap
=
getCloseup
(
pic
);
if
(
bitmap
!=
null
)
{
int
left
;
int
right
;
int
up
;
int
down
;
CutTop
(
bitmap
,
out
left
,
out
right
,
out
up
,
out
down
);
up
=
CutLeft
(
bitmap
,
up
);
down
=
CutRight
(
bitmap
,
down
);
right
=
CutButton
(
bitmap
,
right
);
var
width
=
right
-
left
;
var
height
=
down
-
up
;
pic
.
hashed_data
=
new
float
[
width
,
height
,
4
];
for
(
var
w
=
0
;
w
<
width
;
w
++)
for
(
var
h
=
0
;
h
<
height
;
h
++)
{
var
color
=
bitmap
.
GetPixel
(
left
+
w
,
up
+
h
);
var
a
=
color
.
A
/
255f
;
if
(
w
<
40
)
if
(
a
>
w
/
(
float
)
40
)
a
=
w
/
(
float
)
40
;
if
(
w
>
width
-
40
)
if
(
a
>
1f
-
(
w
-
(
width
-
40
))
/
(
float
)
40
)
a
=
1f
-
(
w
-
(
width
-
40
))
/
(
float
)
40
;
if
(
h
<
40
)
if
(
a
>
h
/
(
float
)
40
)
a
=
h
/
(
float
)
40
;
if
(
h
>
height
-
40
)
if
(
a
>
1f
-
(
h
-
(
height
-
40
))
/
(
float
)
40
)
a
=
1f
-
(
h
-
(
height
-
40
))
/
(
float
)
40
;
pic
.
hashed_data
[
w
,
height
-
h
-
1
,
0
]
=
color
.
R
/
255f
;
pic
.
hashed_data
[
w
,
height
-
h
-
1
,
1
]
=
color
.
G
/
255f
;
pic
.
hashed_data
[
w
,
height
-
h
-
1
,
2
]
=
color
.
B
/
255f
;
pic
.
hashed_data
[
w
,
height
-
h
-
1
,
3
]
=
a
;
}
caculateK
(
pic
);
loadedList
.
Add
(
hashPic
(
pic
.
code
,
pic
.
type
),
pic
);
}
else
{
var
data
=
getPicture
(
pic
,
out
EightEdition
);
if
(
data
.
Length
==
0
)
{
pic
.
hashed_data
=
new
float
[
10
,
10
,
4
];
for
(
var
w
=
0
;
w
<
10
;
w
++)
for
(
var
h
=
0
;
h
<
10
;
h
++)
{
pic
.
hashed_data
[
w
,
h
,
0
]
=
0
;
pic
.
hashed_data
[
w
,
h
,
1
]
=
0
;
pic
.
hashed_data
[
w
,
h
,
2
]
=
0
;
pic
.
hashed_data
[
w
,
h
,
3
]
=
0
;
}
loadedList
.
Add
(
hashPic
(
pic
.
code
,
pic
.
type
),
pic
);
}
else
{
var
stream
=
new
MemoryStream
(
data
);
bitmap
=
new
BitmapHelper
(
stream
);
pic
.
hashed_data
=
getCuttedPic
(
bitmap
,
pic
.
pCard
,
EightEdition
);
var
width
=
pic
.
hashed_data
.
GetLength
(
0
);
var
height
=
pic
.
hashed_data
.
GetLength
(
1
);
var
size
=
(
int
)
(
height
*
0.8
);
var
empWidth
=
(
width
-
size
)
/
2
;
var
empHeight
=
(
height
-
size
)
/
2
;
var
right
=
width
-
empWidth
;
var
buttom
=
height
-
empHeight
;
for
(
var
w
=
0
;
w
<
width
;
w
++)
for
(
var
h
=
0
;
h
<
height
;
h
++)
{
var
a
=
pic
.
hashed_data
[
w
,
h
,
3
];
if
(
w
<
empWidth
)
if
(
a
>
w
/
(
float
)
empWidth
)
a
=
w
/
(
float
)
empWidth
;
if
(
h
<
empHeight
)
if
(
a
>
h
/
(
float
)
empHeight
)
a
=
h
/
(
float
)
empHeight
;
if
(
w
>
right
)
if
(
a
>
1f
-
(
w
-
right
)
/
(
float
)
empWidth
)
a
=
1f
-
(
w
-
right
)
/
(
float
)
empWidth
;
if
(
h
>
buttom
)
if
(
a
>
1f
-
(
h
-
buttom
)
/
(
float
)
empHeight
)
a
=
1f
-
(
h
-
buttom
)
/
(
float
)
empHeight
;
pic
.
hashed_data
[
w
,
h
,
3
]
=
a
*
0.7f
;
}
loadedList
.
Add
(
hashPic
(
pic
.
code
,
pic
.
type
),
pic
);
}
}
}
private
static
void
caculateK
(
PictureResource
pic
)
{
//int width = pic.hashed_data.GetLength(0);
//int height = pic.hashed_data.GetLength(1);
//int left = 0;
//int right = width;
//if (width > height)
//{
// left = (width - height) / 2;
// right = width - left;
//}
//int all = 0;
//for (int h = 0; h < height; h++)
//{
// for (int w = left; w < right; w++)
// {
// if (pic.hashed_data[w, h, 3] > 0.05f)
// {
// all += 1;
// }
// }
//}
//float result = ((float)all) / (((float)height) * ((float)(height)));
//pic.k = result + 0.4f;
//if (pic.k > 1)
//{
// pic.k = 1f;
//}
//if (pic.k < 0)
//{
// pic.k = 0.1f;
//}
var
width
=
pic
.
hashed_data
.
GetLength
(
0
);
var
height
=
pic
.
hashed_data
.
GetLength
(
1
);
var
h
=
0
;
for
(
h
=
height
-
1
;
h
>
0
;
h
--)
{
var
all
=
0
;
for
(
var
w
=
0
;
w
<
width
;
w
++)
if
(
pic
.
hashed_data
[
w
,
h
,
3
]
>
0.05f
)
all
+=
1
;
if
(
all
*
5
>
width
)
break
;
}
pic
.
k
=
h
/
(
float
)
height
;
if
(
pic
.
k
>
1
)
pic
.
k
=
1f
;
if
(
pic
.
k
<
0
)
pic
.
k
=
0.1f
;
}
private
static
float
[,,]
getCuttedPic
(
BitmapHelper
bitmap
,
bool
pCard
,
bool
EightEdition
)
{
int
left
=
0
,
top
=
0
,
right
=
bitmap
.
colors
.
GetLength
(
0
),
buttom
=
bitmap
.
colors
.
GetLength
(
1
);
//right is width and buttom is height now
if
(
EightEdition
)
{
if
(
pCard
)
{
left
=
(
int
)
(
16f
*
right
/
177f
);
right
=
(
int
)
(
162f
*
right
/
177f
);
top
=
(
int
)
(
50f
*
buttom
/
254f
);
buttom
=
(
int
)
(
158f
*
buttom
/
254f
);
}
else
{
left
=
(
int
)
(
26f
*
right
/
177f
);
right
=
(
int
)
(
152f
*
right
/
177f
);
top
=
(
int
)
(
55f
*
buttom
/
254f
);
buttom
=
(
int
)
(
180f
*
buttom
/
254f
);
}
}
else
{
if
(
pCard
)
{
left
=
(
int
)
(
25f
*
right
/
322f
);
right
=
(
int
)
(
290f
*
right
/
322f
);
top
=
(
int
)
(
73f
*
buttom
/
402f
);
buttom
=
(
int
)
(
245f
*
buttom
/
402f
);
}
else
{
left
=
(
int
)
(
40f
*
right
/
322f
);
right
=
(
int
)
(
280f
*
right
/
322f
);
top
=
(
int
)
(
75f
*
buttom
/
402f
);
buttom
=
(
int
)
(
280f
*
buttom
/
402f
);
}
}
var
returnValue
=
new
float
[
right
-
left
,
buttom
-
top
,
4
];
for
(
var
w
=
0
;
w
<
right
-
left
;
w
++)
for
(
var
h
=
0
;
h
<
buttom
-
top
;
h
++)
{
var
color
=
bitmap
.
GetPixel
(
left
+
w
,
buttom
-
1
-
h
);
returnValue
[
w
,
h
,
0
]
=
color
.
R
/
255f
;
returnValue
[
w
,
h
,
1
]
=
color
.
G
/
255f
;
returnValue
[
w
,
h
,
2
]
=
color
.
B
/
255f
;
returnValue
[
w
,
h
,
3
]
=
color
.
A
/
255f
;
}
return
returnValue
;
}
private
static
int
CutButton
(
BitmapHelper
bitmap
,
int
right
)
{
for
(
var
w
=
bitmap
.
colors
.
GetLength
(
0
)
-
1
;
w
>=
0
;
w
--)
for
(
var
h
=
0
;
h
<
bitmap
.
colors
.
GetLength
(
1
);
h
++)
{
var
color
=
bitmap
.
GetPixel
(
w
,
h
);
if
(
color
.
A
>
10
)
{
right
=
w
;
return
right
;
}
}
return
right
;
loadedPicture
.
Clear
();
loadedCloseUp
.
Clear
();
}
private
static
int
CutRight
(
BitmapHelper
bitmap
,
int
down
)
{
for
(
var
h
=
bitmap
.
colors
.
GetLength
(
1
)
-
1
;
h
>=
0
;
h
--)
for
(
var
w
=
0
;
w
<
bitmap
.
colors
.
GetLength
(
0
);
w
++)
{
var
color
=
bitmap
.
GetPixel
(
w
,
h
);
if
(
color
.
A
>
10
)
{
down
=
h
;
return
down
;
}
}
return
down
;
}
private
static
readonly
Dictionary
<
int
,
Task
<
Texture2D
>>
loadedPicture
=
new
Dictionary
<
int
,
Task
<
Texture2D
>>();
private
static
readonly
Dictionary
<
int
,
Task
<
Texture2D
>>
loadedCloseUp
=
new
Dictionary
<
int
,
Task
<
Texture2D
>>();
private
static
readonly
Dictionary
<
string
,
Texture2D
>
loadedUI
=
new
Dictionary
<
string
,
Texture2D
>();
p
rivate
static
int
CutLeft
(
BitmapHelper
bitmap
,
int
up
)
p
ublic
static
Task
<
Texture2D
>
GetCardPicture
(
int
code
)
{
for
(
var
h
=
0
;
h
<
bitmap
.
colors
.
GetLength
(
1
);
h
++)
for
(
var
w
=
0
;
w
<
bitmap
.
colors
.
GetLength
(
0
);
w
++)
{
var
color
=
bitmap
.
GetPixel
(
w
,
h
);
if
(
color
.
A
>
10
)
{
up
=
h
;
return
up
;
}
}
return
up
;
return
GetCardPicture
(
code
,
myBack
);
}
p
rivate
static
void
CutTop
(
BitmapHelper
bitmap
,
out
int
left
,
out
int
right
,
out
int
up
,
out
int
down
)
p
ublic
static
async
Task
<
Texture2D
>
GetCardPicture
(
int
code
,
Texture2D
zero
)
{
///////切边算法
left
=
0
;
right
=
bitmap
.
colors
.
GetLength
(
0
);
up
=
0
;
down
=
bitmap
.
colors
.
GetLength
(
1
);
for
(
var
w
=
0
;
w
<
bitmap
.
colors
.
GetLength
(
0
);
w
++)
for
(
var
h
=
0
;
h
<
bitmap
.
colors
.
GetLength
(
1
);
h
++)
if
(
code
==
0
)
return
zero
;
if
(
loadedPicture
.
TryGetValue
(
code
,
out
var
cached
))
return
await
cached
;
foreach
(
var
extname
in
new
[]
{
".png"
,
".jpg"
})
{
var
color
=
bitmap
.
GetPixel
(
w
,
h
)
;
if
(
color
.
A
>
10
)
var
path
=
$"picture/card/
{
code
}{
extname
}
"
;
if
(
File
.
Exists
(
path
)
)
{
left
=
w
;
return
;
var
result
=
UIHelper
.
GetTexture2DAsync
(
path
);
loadedPicture
.
Add
(
code
,
result
);
return
await
result
;
}
}
}
private
static
void
ProcessingVerticleDrawing
(
PictureResource
pic
)
{
if
(
loadedList
.
ContainsKey
(
hashPic
(
pic
.
code
,
pic
.
type
)))
return
;
var
bitmap
=
getCloseup
(
pic
);
if
(
bitmap
==
null
)
{
bool
EightEdition
;
var
data
=
getPicture
(
pic
,
out
EightEdition
);
if
(
data
.
Length
==
0
)
return
;
var
stream
=
new
MemoryStream
(
data
);
bitmap
=
new
BitmapHelper
(
stream
);
pic
.
hashed_data
=
getCuttedPic
(
bitmap
,
pic
.
pCard
,
EightEdition
);
softVtype
(
pic
,
0.5f
);
pic
.
k
=
1
;
//pic.autoMade = true;
}
else
{
int
left
;
int
right
;
int
up
;
int
down
;
CutTop
(
bitmap
,
out
left
,
out
right
,
out
up
,
out
down
);
up
=
CutLeft
(
bitmap
,
up
);
down
=
CutRight
(
bitmap
,
down
);
right
=
CutButton
(
bitmap
,
right
);
var
width
=
right
-
left
;
var
height
=
down
-
up
;
pic
.
hashed_data
=
new
float
[
width
,
height
,
4
];
for
(
var
w
=
0
;
w
<
width
;
w
++)
for
(
var
h
=
0
;
h
<
height
;
h
++)
{
var
color
=
bitmap
.
GetPixel
(
left
+
w
,
up
+
h
);
pic
.
hashed_data
[
w
,
height
-
h
-
1
,
0
]
=
color
.
R
/
255f
;
pic
.
hashed_data
[
w
,
height
-
h
-
1
,
1
]
=
color
.
G
/
255f
;
pic
.
hashed_data
[
w
,
height
-
h
-
1
,
2
]
=
color
.
B
/
255f
;
pic
.
hashed_data
[
w
,
height
-
h
-
1
,
3
]
=
color
.
A
/
255f
;
}
float
wholeUNalpha
=
0
;
for
(
var
w
=
0
;
w
<
width
;
w
++)
{
if
(
pic
.
hashed_data
[
w
,
0
,
3
]
>
0.1f
)
wholeUNalpha
+=
Math
.
Abs
(
w
-
width
/
2
)
/
(
float
)
(
width
/
2
);
if
(
pic
.
hashed_data
[
w
,
height
-
1
,
3
]
>
0.1f
)
wholeUNalpha
+=
1
;
}
for
(
var
h
=
0
;
h
<
height
;
h
++)
{
if
(
pic
.
hashed_data
[
0
,
h
,
3
]
>
0.1f
)
wholeUNalpha
+=
1
;
if
(
pic
.
hashed_data
[
width
-
1
,
h
,
3
]
>
0.1f
)
wholeUNalpha
+=
1
;
}
if
(
wholeUNalpha
>=
(
width
+
height
)
*
0.5f
*
0.12f
)
softVtype
(
pic
,
0.7f
);
caculateK
(
pic
);
}
loadedList
.
Add
(
hashPic
(
pic
.
code
,
pic
.
type
),
pic
);
return
unknown
;
}
p
rivate
static
void
softVtype
(
PictureResource
pic
,
float
si
)
p
ublic
static
async
Task
<
Texture2D
>
GetCardCloseUp
(
int
code
)
{
var
width
=
pic
.
hashed_data
.
GetLength
(
0
);
var
height
=
pic
.
hashed_data
.
GetLength
(
1
);
var
size
=
(
int
)
(
height
*
si
);
var
empWidth
=
(
width
-
size
)
/
2
;
var
empHeight
=
(
height
-
size
)
/
2
;
var
right
=
width
-
empWidth
;
var
buttom
=
height
-
empHeight
;
var
dui
=
(
float
)
Math
.
Sqrt
(
width
/
2
*
(
width
/
2
)
+
height
/
2
*
(
height
/
2
));
for
(
var
w
=
0
;
w
<
width
;
w
++)
for
(
var
h
=
0
;
h
<
height
;
h
++)
{
var
a
=
pic
.
hashed_data
[
w
,
h
,
3
];
if
(
h
<
height
/
2
)
{
var
l
=
(
float
)
Math
.
Sqrt
((
width
/
2
-
w
)
*
(
width
/
2
-
w
)
+
(
height
/
2
-
h
)
*
(
height
/
2
-
h
));
l
-=
width
*
0.3f
;
if
(
l
<
0
)
l
=
0
;
var
alpha
=
1f
-
l
/
(
0.6f
*
(
dui
-
width
*
0.3f
));
if
(
alpha
<
0
)
alpha
=
0
;
if
(
a
>
alpha
)
a
=
alpha
;
}
if
(
w
<
empWidth
)
if
(
a
>
w
/
(
float
)
empWidth
)
a
=
w
/
(
float
)
empWidth
;
if
(
h
<
empHeight
)
if
(
a
>
h
/
(
float
)
empHeight
)
a
=
h
/
(
float
)
empHeight
;
if
(
w
>
right
)
if
(
a
>
1f
-
(
w
-
right
)
/
(
float
)
empWidth
)
a
=
1f
-
(
w
-
right
)
/
(
float
)
empWidth
;
if
(
h
>
buttom
)
if
(
a
>
1f
-
(
h
-
buttom
)
/
(
float
)
empHeight
)
a
=
1f
-
(
h
-
buttom
)
/
(
float
)
empHeight
;
pic
.
hashed_data
[
w
,
h
,
3
]
=
a
;
}
}
private
static
void
ProcessingCardPicture
(
PictureResource
pic
)
{
if
(
loadedList
.
ContainsKey
(
hashPic
(
pic
.
code
,
pic
.
type
)))
return
;
bool
EightEdition
;
var
data
=
getPicture
(
pic
,
out
EightEdition
);
if
(
data
.
Length
>
0
)
{
pic
.
data
=
data
;
loadedList
.
Add
(
hashPic
(
pic
.
code
,
pic
.
type
),
pic
);
}
else
{
if
(
pic
.
code
>
0
)
pic
.
u_data
=
unknown
;
else
pic
.
u_data
=
myBack
;
loadedList
.
Add
(
hashPic
(
pic
.
code
,
pic
.
type
),
pic
);
}
}
private
static
ulong
hashPic
(
long
code
,
GameTextureType
type
)
{
return
((
ulong
)
type
<<
32
)
|
(
ulong
)
code
;
}
public
static
Texture2D
get
(
long
code
,
GameTextureType
type
,
Texture2D
nullReturnValue
=
null
)
{
try
{
PictureResource
r
;
if
(
loadedList
.
TryGetValue
(
hashPic
(
code
,
type
),
out
r
))
{
Texture2D
re
=
null
;
if
(
r
.
u_data
!=
null
)
{
if
(
r
.
u_data
==
myBack
)
return
nullReturnValue
;
return
r
.
u_data
;
}
if
(
r
.
data
!=
null
)
{
re
=
new
Texture2D
(
400
,
600
);
re
.
LoadImage
(
r
.
data
);
r
.
u_data
=
re
;
return
re
;
}
if
(
r
.
hashed_data
!=
null
)
{
var
width
=
r
.
hashed_data
.
GetLength
(
0
);
var
height
=
r
.
hashed_data
.
GetLength
(
1
);
var
cols
=
new
Color
[
width
*
height
];
re
=
new
Texture2D
(
width
,
height
);
for
(
var
h
=
0
;
h
<
height
;
h
++)
for
(
var
w
=
0
;
w
<
width
;
w
++)
cols
[
h
*
width
+
w
]
=
new
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
.
Apply
();
r
.
u_data
=
re
;
return
re
;
}
}
else
{
if
(!
addedMap
.
ContainsKey
(
hashPic
(
code
,
type
)))
{
var
a
=
new
PictureResource
(
type
,
code
,
nullReturnValue
);
bLock
=
true
;
waitLoadStack
.
Push
(
a
);
bLock
=
false
;
addedMap
.
Add
(((
ulong
)
type
<<
32
)
|
(
ulong
)
code
,
true
);
}
}
}
catch
(
Exception
e
)
if
(
loadedCloseUp
.
TryGetValue
(
code
,
out
var
cached
))
return
await
cached
;
var
path
=
$"picture/closeup/
{
code
}
.png"
;
if
(
File
.
Exists
(
path
))
{
Debug
.
Log
(
"BIGERROR1:"
+
e
);
var
result
=
UIHelper
.
GetTexture2DAsync
(
path
);
loadedCloseUp
.
Add
(
code
,
result
);
return
await
result
;
}
return
null
;
}
public
static
float
getK
(
long
code
,
GameTextureType
type
)
{
float
ret
=
1
;
PictureResource
r
;
if
(
loadedList
.
TryGetValue
(
hashPic
(
code
,
type
),
out
r
))
ret
=
r
.
k
;
return
ret
;
}
public
static
Texture2D
get
(
string
name
)
{
if
(
uiLoaded
==
false
)
{
uiLoaded
=
true
;
var
fileInfos
=
new
DirectoryInfo
(
"texture/ui"
).
GetFiles
();
for
(
var
i
=
0
;
i
<
fileInfos
.
Length
;
i
++)
if
(
fileInfos
[
i
].
Name
.
Length
>
4
)
if
(
fileInfos
[
i
].
Name
.
Substring
(
fileInfos
[
i
].
Name
.
Length
-
4
,
4
)
==
".png"
)
{
var
r
=
new
UIPictureResource
();
r
.
name
=
fileInfos
[
i
].
Name
.
Substring
(
0
,
fileInfos
[
i
].
Name
.
Length
-
4
);
r
.
data
=
UIHelper
.
getTexture2D
(
"texture/ui/"
+
fileInfos
[
i
].
Name
);
allUI
.
Add
(
r
);
}
}
Texture2D
re
=
null
;
for
(
var
i
=
0
;
i
<
allUI
.
size
;
i
++)
if
(
allUI
[
i
].
name
==
name
)
{
re
=
allUI
[
i
].
data
;
break
;
}
if
(
re
==
null
)
{
}
return
re
;
}
internal
static
void
initialize
()
{
attack
=
UIHelper
.
getTexture2D
(
"texture/duel/attack.png"
);
myBack
=
UIHelper
.
getTexture2D
(
"texture/duel/me.jpg"
);
opBack
=
UIHelper
.
getTexture2D
(
"texture/duel/opponent.jpg"
);
unknown
=
UIHelper
.
getTexture2D
(
"texture/duel/unknown.jpg"
);
negated
=
UIHelper
.
getTexture2D
(
"texture/duel/negated.png"
);
bar
=
UIHelper
.
getTexture2D
(
"texture/duel/healthBar/bg.png"
);
exBar
=
UIHelper
.
getTexture2D
(
"texture/duel/healthBar/excited.png"
);
time
=
UIHelper
.
getTexture2D
(
"texture/duel/healthBar/t.png"
);
lp
=
UIHelper
.
getTexture2D
(
"texture/duel/healthBar/lp.png"
);
L
=
UIHelper
.
getTexture2D
(
"texture/duel/L.png"
);
R
=
UIHelper
.
getTexture2D
(
"texture/duel/R.png"
);
LINK
=
UIHelper
.
getTexture2D
(
"texture/duel/link.png"
);
LINKm
=
UIHelper
.
getTexture2D
(
"texture/duel/linkMask.png"
);
Chain
=
UIHelper
.
getTexture2D
(
"texture/duel/chain.png"
);
Mask
=
UIHelper
.
getTexture2D
(
"texture/duel/mask.png"
);
nt
=
UIHelper
.
getTexture2D
(
"texture/duel/phase/nt.png"
);
bp
=
UIHelper
.
getTexture2D
(
"texture/duel/phase/bp.png"
);
ep
=
UIHelper
.
getTexture2D
(
"texture/duel/phase/ep.png"
);
mp1
=
UIHelper
.
getTexture2D
(
"texture/duel/phase/mp1.png"
);
mp2
=
UIHelper
.
getTexture2D
(
"texture/duel/phase/mp2.png"
);
dp
=
UIHelper
.
getTexture2D
(
"texture/duel/phase/dp.png"
);
sp
=
UIHelper
.
getTexture2D
(
"texture/duel/phase/sp.png"
);
phase
=
UIHelper
.
getTexture2D
(
"texture/duel/phase/phase.png"
);
rs
=
UIHelper
.
getTexture2D
(
"texture/duel/phase/rs.png"
);
ts
=
UIHelper
.
getTexture2D
(
"texture/duel/phase/ts.png"
);
N
=
new
Texture2D
(
10
,
10
);
for
(
var
i
=
0
;
i
<
10
;
i
++)
for
(
var
a
=
0
;
a
<
10
;
a
++)
N
.
SetPixel
(
i
,
a
,
new
Color
(
0
,
0
,
0
,
0
));
N
.
Apply
();
try
{
ColorUtility
.
TryParseHtmlString
(
File
.
ReadAllText
(
"texture/duel/chainColor.txt"
),
out
chainColor
);
}
catch
(
Exception
)
{
}
var
main
=
new
Thread
(
thread_run
);
main
.
Start
();
}
public
class
BitmapHelper
{
public
System
.
Drawing
.
Color
[,]
colors
;
public
BitmapHelper
(
string
path
)
{
Bitmap
bitmap
;
try
{
bitmap
=
(
Bitmap
)
Image
.
FromFile
(
path
);
}
catch
(
Exception
)
{
bitmap
=
new
Bitmap
(
10
,
10
);
for
(
var
i
=
0
;
i
<
10
;
i
++)
for
(
var
w
=
0
;
w
<
10
;
w
++)
bitmap
.
SetPixel
(
i
,
w
,
System
.
Drawing
.
Color
.
White
);
}
init
(
bitmap
);
}
public
BitmapHelper
(
MemoryStream
stream
)
{
Bitmap
bitmap
;
try
{
bitmap
=
(
Bitmap
)
Image
.
FromStream
(
stream
);
}
catch
(
Exception
)
{
bitmap
=
new
Bitmap
(
10
,
10
);
for
(
var
i
=
0
;
i
<
10
;
i
++)
for
(
var
w
=
0
;
w
<
10
;
w
++)
bitmap
.
SetPixel
(
i
,
w
,
System
.
Drawing
.
Color
.
White
);
}
init
(
bitmap
);
}
private
void
init
(
Bitmap
bitmap
)
{
var
bmpData
=
bitmap
.
LockBits
(
new
Rectangle
(
0
,
0
,
bitmap
.
Width
,
bitmap
.
Height
),
ImageLockMode
.
ReadOnly
,
PixelFormat
.
Format32bppArgb
);
var
ptr
=
bmpData
.
Scan0
;
var
bytes
=
Math
.
Abs
(
bmpData
.
Stride
)
*
bitmap
.
Height
;
var
rgbValues
=
new
byte
[
bytes
];
Marshal
.
Copy
(
ptr
,
rgbValues
,
0
,
bytes
);
colors
=
new
System
.
Drawing
.
Color
[
bitmap
.
Width
,
bitmap
.
Height
];
for
(
var
counter
=
0
;
counter
<
rgbValues
.
Length
;
counter
+=
4
)
{
var
i_am
=
counter
/
4
;
colors
[
i_am
%
bitmap
.
Width
,
i_am
/
bitmap
.
Width
]
=
System
.
Drawing
.
Color
.
FromArgb
(
rgbValues
[
counter
+
3
],
rgbValues
[
counter
+
2
],
rgbValues
[
counter
+
1
],
rgbValues
[
counter
+
0
]);
}
bitmap
.
UnlockBits
(
bmpData
);
bitmap
.
Dispose
();
}
public
System
.
Drawing
.
Color
GetPixel
(
int
a
,
int
b
)
{
return
colors
[
a
,
b
];
}
}
private
class
PictureResource
{
public
readonly
long
code
;
//public bool autoMade = false;
public
byte
[]
data
;
public
float
[,,]
hashed_data
;
public
float
k
=
1
;
public
Texture2D
nullReturen
;
public
bool
pCard
;
public
readonly
GameTextureType
type
;
public
Texture2D
u_data
;
public
PictureResource
(
GameTextureType
t
,
long
c
,
Texture2D
n
)
{
type
=
t
;
code
=
c
;
nullReturen
=
n
;
}
}
private
class
UIPictureResource
public
static
Texture2D
GetUI
(
string
name
)
{
public
Texture2D
data
;
public
string
name
;
var
path
=
$"texture/ui/
{
name
}
.png"
;
if
(
loadedUI
.
TryGetValue
(
path
,
out
var
cached
))
return
cached
;
var
result
=
UIHelper
.
GetTexture2D
(
path
);
loadedUI
.
Add
(
path
,
result
);
return
result
;
}
}
\ No newline at end of file
Assets/SibylSystem/Room/Room.cs
View file @
edfd3f53
...
...
@@ -684,7 +684,7 @@ public class Room : WindowServantSP
else
{
realPlayers
[
i
].
SetNotNull
(
true
);
realPlayers
[
i
].
s
etName
(
roomPlayers
[
i
].
name
);
realPlayers
[
i
].
S
etName
(
roomPlayers
[
i
].
name
);
realPlayers
[
i
].
SetIFcanKick
(
is_host
&&
i
!=
selftype
);
realPlayers
[
i
].
setIfMe
(
i
==
selftype
);
realPlayers
[
i
].
setIfprepared
(
roomPlayers
[
i
].
prep
);
...
...
Assets/SibylSystem/SelectDeck/selectDeck.cs
View file @
edfd3f53
...
...
@@ -261,7 +261,7 @@ public class selectDeck : WindowServantSP
private
void
printSelected
()
{
GameTextureManager
.
clearUnloaded
();
//
GameTextureManager.clearUnloaded();
Deck
deck
;
DeckManager
.
FromYDKtoCodedDeck
(
"deck/"
+
deckSelected
+
".ydk"
,
out
deck
);
var
mainAll
=
0
;
...
...
@@ -287,7 +287,7 @@ public class selectDeck : WindowServantSP
if
((
c
.
Type
&
(
uint
)
CardType
.
Monster
)
>
0
)
mainMonster
++;
if
((
c
.
Type
&
(
uint
)
CardType
.
Spell
)
>
0
)
mainSpell
++;
if
((
c
.
Type
&
(
uint
)
CardType
.
Trap
)
>
0
)
mainTrap
++;
quickCards
[
currentIndex
].
reCode
(
item
)
;
quickCards
[
currentIndex
].
code
=
item
;
var
v
=
UIHelper
.
get_hang_lieArry
(
mainAll
-
1
,
hangshu
);
quickCards
[
currentIndex
].
transform
.
localPosition
=
new
Vector3
(
...
...
@@ -307,7 +307,7 @@ public class selectDeck : WindowServantSP
if
((
c
.
Type
&
(
uint
)
CardType
.
Monster
)
>
0
)
sideMonster
++;
if
((
c
.
Type
&
(
uint
)
CardType
.
Spell
)
>
0
)
sideSpell
++;
if
((
c
.
Type
&
(
uint
)
CardType
.
Trap
)
>
0
)
sideTrap
++;
quickCards
[
currentIndex
].
reCode
(
item
)
;
quickCards
[
currentIndex
].
code
=
item
;
quickCards
[
currentIndex
].
transform
.
localPosition
=
new
Vector3
(
-
176.3f
+
UIHelper
.
get_left_right_indexZuo
(
0
,
352f
,
sideAll
-
1
,
deck
.
Side
.
Count
,
10
)
...
...
@@ -327,7 +327,7 @@ public class selectDeck : WindowServantSP
if
((
c
.
Type
&
(
uint
)
CardType
.
Synchro
)
>
0
)
extraSync
++;
if
((
c
.
Type
&
(
uint
)
CardType
.
Xyz
)
>
0
)
extraXyz
++;
if
((
c
.
Type
&
(
uint
)
CardType
.
Link
)
>
0
)
extraLink
++;
quickCards
[
currentIndex
].
reCode
(
item
)
;
quickCards
[
currentIndex
].
code
=
item
;
quickCards
[
currentIndex
].
transform
.
localPosition
=
new
Vector3
(
-
176.3f
+
UIHelper
.
get_left_right_indexZuo
(
0
,
352f
,
extraAll
-
1
,
deck
.
Extra
.
Count
,
10
)
...
...
Assets/SibylSystem/Servant.cs
View file @
edfd3f53
using
System
;
using
System.Collections.Generic
;
using
DefaultNamespace
;
using
DG.Tweening
;
using
UnityEngine
;
using
UnityEngine.Assertions
;
...
...
@@ -644,12 +645,12 @@ public class Servant
defbutton
.
transform
.
localPosition
=
new
Vector3
(
62.8f
,
0f
,
0f
);
}
var
cardPicLoader
_
=
currentMSwindow
.
AddComponent
<
cardPicLoader
>();
cardPicLoader
_
.
code
=
code
;
cardPicLoader
_
.
uiTexture
=
atkpic
;
cardPicLoader
_
=
currentMSwindow
.
AddComponent
<
cardPicLoader
>();
cardPicLoader
_
.
code
=
int
.
Parse
(
def
.
value
)
==
(
int
)
CardPosition
.
FaceDownDefence
?
0
:
code
;
cardPicLoader
_
.
uiTexture
=
UIHelper
.
getByName
<
UITexture
>(
currentMSwindow
,
"defPic_"
)
;
var
cardPicLoader
=
currentMSwindow
.
AddComponent
<
cardPicLoader
>();
cardPicLoader
.
uiTexture
=
atkpic
;
cardPicLoader
.
code
=
code
;
cardPicLoader
=
currentMSwindow
.
AddComponent
<
cardPicLoader
>();
cardPicLoader
.
uiTexture
=
UIHelper
.
getByName
<
UITexture
>(
currentMSwindow
,
"defPic_"
)
;
cardPicLoader
.
code
=
int
.
Parse
(
def
.
value
)
==
(
int
)
CardPosition
.
FaceDownDefence
?
0
:
code
;
}
public
void
RMSshow_tp
(
string
hashCode
,
messageSystemValue
jiandao
,
messageSystemValue
shitou
,
...
...
@@ -711,7 +712,8 @@ public class Servant
Program
.
I
().
ui_main_2d
);
UIHelper
.
InterGameObject
(
currentMSwindow
);
UIHelper
.
getByName
<
UITexture
>(
currentMSwindow
,
"face_"
).
mainTexture
=
UIHelper
.
getFace
(
name
);
MyCard
.
LoadAvatar
(
name
,
texture
=>
UIHelper
.
getByName
<
UITexture
>(
currentMSwindow
,
"face_"
).
mainTexture
=
texture
);
UIHelper
.
registEvent
(
currentMSwindow
,
"yes_"
,
ES_RMSpremono
,
new
messageSystemValue
());
}
...
...
Assets/SibylSystem/deckManager/DeckManager.cs
View file @
edfd3f53
...
...
@@ -799,19 +799,18 @@ public class DeckManager : ServantWithCardDescription
});
}
private
GameObject
itemOnListProducer
(
string
[]
A
rgs
)
private
GameObject
itemOnListProducer
(
string
[]
a
rgs
)
{
GameObject
returnValue
=
null
;
returnValue
=
create
(
Program
.
I
().
new_ui_cardOnSearchList
,
Vector3
.
zero
,
Vector3
.
zero
,
false
,
var
returnValue
=
create
(
Program
.
I
().
new_ui_cardOnSearchList
,
Vector3
.
zero
,
Vector3
.
zero
,
false
,
Program
.
I
().
ui_back_ground_2d
);
UIHelper
.
getRealEventGameObject
(
returnValue
).
name
=
A
rgs
[
0
];
UIHelper
.
trySetLableText
(
returnValue
,
A
rgs
[
2
]);
var
cardPicLoader
_
=
UIHelper
.
getRealEventGameObject
(
returnValue
).
AddComponent
<
cardPicLoader
>();
cardPicLoader
_
.
code
=
int
.
Parse
(
Args
[
0
]
);
cardPicLoader
_
.
data
=
CardsManager
.
Get
(
int
.
Parse
(
Args
[
0
])
);
cardPicLoader
_
.
uiTexture
=
UIHelper
.
getByName
<
UITexture
>(
returnValue
,
"pic_"
);
cardPicLoader
_
.
ico
=
UIHelper
.
getByName
<
ban_icon
>(
returnValue
);
cardPicLoader
_
.
ico
.
show
(
3
);
UIHelper
.
getRealEventGameObject
(
returnValue
).
name
=
a
rgs
[
0
];
UIHelper
.
trySetLableText
(
returnValue
,
a
rgs
[
2
]);
var
cardPicLoader
=
UIHelper
.
getRealEventGameObject
(
returnValue
).
AddComponent
<
cardPicLoader
>();
cardPicLoader
.
uiTexture
=
UIHelper
.
getByName
<
UITexture
>(
returnValue
,
"pic_"
);
cardPicLoader
.
code
=
int
.
Parse
(
args
[
0
]
);
cardPicLoader
.
data
=
CardsManager
.
Get
(
int
.
Parse
(
args
[
0
])
);
cardPicLoader
.
ico
=
UIHelper
.
getByName
<
ban_icon
>(
returnValue
);
cardPicLoader
.
ico
.
show
(
3
);
return
returnValue
;
}
...
...
Assets/old/Deck_manager/mats/ban_icon.cs
View file @
edfd3f53
...
...
@@ -20,12 +20,12 @@ public class ban_icon : MonoBehaviour
UITexture
t
=
gameObject
.
GetComponent
<
UITexture
>();
if
(
t
!=
null
)
{
t
.
mainTexture
=
GameTextureManager
.
get
(
"ban_"
+
i
.
ToString
());
t
.
mainTexture
=
GameTextureManager
.
GetUI
(
"ban_"
+
i
.
ToString
());
}
else
{
Renderer
r
=
GetComponent
<
Renderer
>();
r
.
material
.
mainTexture
=
GameTextureManager
.
get
(
"ban_"
+
i
.
ToString
());
r
.
material
.
mainTexture
=
GameTextureManager
.
GetUI
(
"ban_"
+
i
.
ToString
());
}
}
}
Assets/old/Ocgcore/button/all_button.png.meta
View file @
edfd3f53
...
...
@@ -60,6 +60,7 @@ TextureImporter:
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMasterTextureLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
...
...
@@ -376,6 +377,19 @@ TextureImporter:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable:
all_button_6: 21300012
all_button_3: 21300006
all_button_4: 21300008
all_button_11: 21300022
all_button_2: 21300004
all_button_1: 21300002
all_button_10: 21300020
all_button_8: 21300016
all_button_7: 21300014
all_button_0: 21300000
all_button_5: 21300010
all_button_9: 21300018
spritePackingTag: button_ocgcore
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
...
...
Assets/old/Ocgcore/numbers/num.png.meta
View file @
edfd3f53
...
...
@@ -144,6 +144,7 @@ TextureImporter:
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMasterTextureLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
...
...
@@ -1048,6 +1049,47 @@ TextureImporter:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable:
num_29: 21300058
num_2: 21300004
num_18: 21300036
num_25: 21300050
num_10: 21300020
num_19: 21300038
num_15: 21300030
num_20: 21300040
num_38: 21300076
num_3: 21300006
num_30: 21300060
num_16: 21300032
num_1: 21300002
num_37: 21300074
num_22: 21300044
num_11: 21300022
num_26: 21300052
num_39: 21300078
num_0: 21300000
num_23: 21300046
num_32: 21300064
num_9: 21300018
num_14: 21300028
num_27: 21300054
num_24: 21300048
num_12: 21300024
num_5: 21300010
num_21: 21300042
num_34: 21300068
num_31: 21300062
num_8: 21300016
num_28: 21300056
num_17: 21300034
num_13: 21300026
num_36: 21300072
num_6: 21300012
num_33: 21300066
num_35: 21300070
num_7: 21300014
num_4: 21300008
spritePackingTag: ocgcore_numbers
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
...
...
Assets/old/Ocgcore/numbers/num2.png.meta
View file @
edfd3f53
...
...
@@ -84,6 +84,7 @@ TextureImporter:
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMasterTextureLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
...
...
@@ -568,6 +569,27 @@ TextureImporter:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable:
num2_11: 21300022
num2_6: 21300012
num2_8: 21300016
num2_9: 21300018
num2_5: 21300010
num2_17: 21300034
num2_18: 21300036
num2_1: 21300002
num2_0: 21300000
num2_12: 21300024
num2_10: 21300020
num2_14: 21300028
num2_15: 21300030
num2_4: 21300008
num2_19: 21300038
num2_13: 21300026
num2_16: 21300032
num2_3: 21300006
num2_2: 21300004
num2_7: 21300014
spritePackingTag: num2
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
...
...
Assets/old/UiverseAssests/TextMesh Pro/Resources/Sprites/Default Sprite Atlas.psd.meta
View file @
edfd3f53
...
...
@@ -75,6 +75,7 @@ TextureImporter:
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMasterTextureLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
...
...
@@ -349,6 +350,17 @@ TextureImporter:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable:
Default Sprite Atlas_8: 21300030
Default Sprite Atlas_6: 21300016
Default Sprite Atlas_2: 21300010
Default Sprite Atlas_3: 21300006
Default Sprite Atlas_5: 21300026
Default Sprite Atlas_7: 21300028
Default Sprite Atlas_9: 21300032
Default Sprite Atlas_0: 21300024
Default Sprite Atlas_1: 21300020
Default Sprite Atlas_4: 21300022
spritePackingTag:
pSDRemoveMatte: 1
pSDShowRemoveMatteOption: 1
...
...
ProjectSettings/MemorySettings.asset
0 → 100644
View file @
edfd3f53
%YAML
1.1
%TAG
!u!
tag:unity3d.com,2011:
---
!u!387306366
&1
MemorySettings
:
m_ObjectHideFlags
:
0
m_EditorMemorySettings
:
m_MainAllocatorBlockSize
:
-1
m_ThreadAllocatorBlockSize
:
-1
m_MainGfxBlockSize
:
-1
m_ThreadGfxBlockSize
:
-1
m_CacheBlockSize
:
-1
m_TypetreeBlockSize
:
-1
m_ProfilerBlockSize
:
-1
m_ProfilerEditorBlockSize
:
-1
m_BucketAllocatorGranularity
:
-1
m_BucketAllocatorBucketsCount
:
-1
m_BucketAllocatorBlockSize
:
-1
m_BucketAllocatorBlockCount
:
-1
m_ProfilerBucketAllocatorGranularity
:
-1
m_ProfilerBucketAllocatorBucketsCount
:
-1
m_ProfilerBucketAllocatorBlockSize
:
-1
m_ProfilerBucketAllocatorBlockCount
:
-1
m_TempAllocatorSizeMain
:
-1
m_JobTempAllocatorBlockSize
:
-1
m_BackgroundJobTempAllocatorBlockSize
:
-1
m_JobTempAllocatorReducedBlockSize
:
-1
m_TempAllocatorSizeGIBakingWorker
:
-1
m_TempAllocatorSizeNavMeshWorker
:
-1
m_TempAllocatorSizeAudioWorker
:
-1
m_TempAllocatorSizeCloudWorker
:
-1
m_TempAllocatorSizeGfx
:
-1
m_TempAllocatorSizeJobWorker
:
-1
m_TempAllocatorSizeBackgroundWorker
:
-1
m_TempAllocatorSizePreloadManager
:
-1
m_PlatformMemorySettings
:
{}
ProjectSettings/boot.config
0 → 100644
View file @
edfd3f53
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