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
7be44462
Commit
7be44462
authored
Jul 27, 2025
by
hex
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix and optimized
parent
dde96b6a
Pipeline
#39607
failed
Changes
9
Pipelines
1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
15083 additions
and
7321 deletions
+15083
-7321
Assets/ArtSystem/deckManager/MonoCardInDeckManager.cs
Assets/ArtSystem/deckManager/MonoCardInDeckManager.cs
+14
-15
Assets/ArtSystem/gameInfo/gameInfo.cs
Assets/ArtSystem/gameInfo/gameInfo.cs
+1030
-305
Assets/SibylSystem/Ocgcore/OCGobjects/gameField.cs
Assets/SibylSystem/Ocgcore/OCGobjects/gameField.cs
+662
-527
Assets/SibylSystem/Program.cs
Assets/SibylSystem/Program.cs
+9
-6
Assets/SibylSystem/deckManager/DeckManager.cs
Assets/SibylSystem/deckManager/DeckManager.cs
+14
-29
Assets/StreamingAssets/ygopro2-data.zip
Assets/StreamingAssets/ygopro2-data.zip
+0
-0
Assets/YGOSharp/Deck.cs
Assets/YGOSharp/Deck.cs
+5
-5
Assets/old/UiverseAssests/art_plugin/attack_light_line/ocgcore/mod_ocgcore_atk_fire.prefab
...gin/attack_light_line/ocgcore/mod_ocgcore_atk_fire.prefab
+13161
-6371
UserSettings/Layouts/default-2021.dwlt
UserSettings/Layouts/default-2021.dwlt
+188
-63
No files found.
Assets/ArtSystem/deckManager/MonoCardInDeckManager.cs
View file @
7be44462
...
...
@@ -42,21 +42,20 @@ public class MonoCardInDeckManager : MonoBehaviour
if
(
isDraging
)
{
gameObject
.
transform
.
position
+=
(
getGoo
dPosition
(
4
)
-
gameObject
.
transform
.
position
)
*
0.3f
;
(
GetMouseWorl
dPosition
(
4
)
-
gameObject
.
transform
.
position
)
*
0.3f
;
}
if
(
Vector3
.
Distance
(
Vector3
.
zero
,
gameObject
.
transform
.
position
)
>
50
&&
bool_physicalON
)
{
killIt
();
KillCard
();
}
}
public
void
killIt
()
public
void
KillCard
()
{
if
(
Program
.
I
().
deckManager
.
condition
==
DeckManager
.
Condition
.
changeSide
)
{
gameObject
.
transform
.
position
=
new
Vector3
(
0
,
5
,
0
);
e
ndDrag
();
E
ndDrag
();
if
(
Program
.
I
().
deckManager
.
cardInDragging
==
this
)
{
Program
.
I
().
deckManager
.
cardInDragging
=
null
;
...
...
@@ -74,7 +73,7 @@ public class MonoCardInDeckManager : MonoBehaviour
}
}
public
Vector3
getGoo
dPosition
(
float
height
)
public
Vector3
GetMouseWorl
dPosition
(
float
height
)
{
float
x
=
Input
.
mousePosition
.
x
;
float
y
=
Input
.
mousePosition
.
y
;
...
...
@@ -97,7 +96,7 @@ public class MonoCardInDeckManager : MonoBehaviour
return
to_ltemp
;
}
public
void
b
eginDrag
()
public
void
B
eginDrag
()
{
physicalOFF
();
physicalHalfON
();
...
...
@@ -105,7 +104,7 @@ public class MonoCardInDeckManager : MonoBehaviour
transform
.
DORotate
(
new
Vector3
(
90
,
0
,
0
),
0.6f
).
SetDelay
(
0
);
}
public
void
e
ndDrag
()
public
void
E
ndDrag
()
{
physicalON
();
stopDragThisFrame
=
true
;
...
...
@@ -113,18 +112,18 @@ public class MonoCardInDeckManager : MonoBehaviour
if
(
Input
.
GetKey
(
KeyCode
.
LeftControl
)
||
Input
.
GetKey
(
KeyCode
.
RightControl
)
||
getIfAlive
()
==
false
||
!
IsAlive
()
)
{
Vector3
from_position
=
getGoo
dPosition
(
4
);
Vector3
to_position
=
getGoo
dPosition
(
0
);
Vector3
from_position
=
GetMouseWorl
dPosition
(
4
);
Vector3
to_position
=
GetMouseWorl
dPosition
(
0
);
Vector3
delta_position
=
to_position
-
from_position
;
GetComponent
<
Rigidbody
>().
AddForce
(
delta_position
*
1000
);
dying
=
true
;
}
}
public
void
tweenToVector
AndFall
(
Vector3
position
,
Vector3
rotation
,
float
delay
=
0
)
public
void
TweenToPosition
AndFall
(
Vector3
position
,
Vector3
rotation
,
float
delay
=
0
)
{
var
rigidbody
=
GetComponent
<
Rigidbody
>();
if
(
rigidbody
!=
null
)
rigidbody
.
Sleep
();
...
...
@@ -173,7 +172,7 @@ public class MonoCardInDeckManager : MonoBehaviour
public
bool
IsInDeckArea
()
{
// 此逻辑专门用于检查卡片是否在物理上位于有效的卡组区域内。
Vector3
to_ltemp
=
refLectPosition
(
gameObject
.
transform
.
position
);
Vector3
to_ltemp
=
ReflectPositionToGround
(
gameObject
.
transform
.
position
);
if
(
to_ltemp
.
x
<
-
15.2f
||
to_ltemp
.
x
>
15.2f
)
{
return
false
;
...
...
@@ -181,7 +180,7 @@ public class MonoCardInDeckManager : MonoBehaviour
return
true
;
}
public
bool
getIf
Alive
()
public
bool
Is
Alive
()
{
// 步骤 1: 检查不可逆的“死亡”状态,这在任何模式下都适用。
if
(
died
||
gameObject
.
transform
.
position
.
y
<
-
0.5f
)
...
...
@@ -200,7 +199,7 @@ public class MonoCardInDeckManager : MonoBehaviour
}
}
public
static
Vector3
refLectPosition
(
Vector3
pos
)
public
static
Vector3
ReflectPositionToGround
(
Vector3
pos
)
{
Vector3
to_ltemp
=
pos
;
Vector3
dv
=
to_ltemp
-
Program
.
I
().
main_camera
.
transform
.
position
;
...
...
Assets/ArtSystem/gameInfo/gameInfo.cs
View file @
7be44462
This diff is collapsed.
Click to expand it.
Assets/SibylSystem/Ocgcore/OCGobjects/gameField.cs
View file @
7be44462
This diff is collapsed.
Click to expand it.
Assets/SibylSystem/Program.cs
View file @
7be44462
...
...
@@ -273,6 +273,9 @@ public class Program : MonoBehaviour
public
static
Vector3
cameraPosition
=
new
Vector3
(
0
,
23
,
-
23
);
public
static
Vector3
cameraRotation
=
new
Vector3
(
60
,
0
,
0
);
// public static Vector3 cameraPosition = new Vector3(0, 23, -40);
// public static Vector3 cameraRotation = new Vector3(35, 0, 0);
public
static
bool
cameraFacing
=
false
;
public
static
float
verticleScale
=
5f
;
...
...
@@ -747,8 +750,8 @@ public class Program : MonoBehaviour
{
camera_game_main
=
this
.
main_camera
;
}
camera_game_main
.
transform
.
position
=
new
Vector3
(
0
,
23
,
-
23
)
;
camera_game_main
.
transform
.
eulerAngles
=
new
Vector3
(
60
,
0
,
0
)
;
camera_game_main
.
transform
.
position
=
cameraPosition
;
camera_game_main
.
transform
.
eulerAngles
=
cameraRotation
;
camera_game_main
.
transform
.
localScale
=
new
Vector3
(
1
,
1
,
1
);
camera_game_main
.
rect
=
new
Rect
(
0
,
0
,
1
,
1
);
camera_game_main
.
depth
=
0
;
...
...
@@ -779,8 +782,8 @@ public class Program : MonoBehaviour
camera_container_3d
.
cullingMask
=
(
int
)
Mathf
.
Pow
(
2
,
9
);
camera_container_3d
.
fieldOfView
=
75
;
camera_container_3d
.
rect
=
camera_game_main
.
rect
;
camera_container_3d
.
transform
.
position
=
new
Vector3
(
0
,
23
,
-
23
)
;
camera_container_3d
.
transform
.
eulerAngles
=
new
Vector3
(
60
,
0
,
0
)
;
camera_container_3d
.
transform
.
position
=
cameraPosition
;
camera_container_3d
.
transform
.
eulerAngles
=
cameraRotation
;
camera_container_3d
.
transform
.
localScale
=
new
Vector3
(
1
,
1
,
1
);
camera_container_3d
.
rect
=
new
Rect
(
0
,
0
,
1
,
1
);
camera_container_3d
.
clearFlags
=
CameraClearFlags
.
Depth
;
...
...
@@ -818,8 +821,8 @@ public class Program : MonoBehaviour
camera_main_3d
.
cullingMask
=
(
int
)
Mathf
.
Pow
(
2
,
10
);
camera_main_3d
.
fieldOfView
=
75
;
camera_main_3d
.
rect
=
new
Rect
(
0
,
0
,
1
,
1
);
camera_main_3d
.
transform
.
position
=
new
Vector3
(
0
,
23
,
-
23
)
;
camera_main_3d
.
transform
.
eulerAngles
=
new
Vector3
(
60
,
0
,
0
)
;
camera_main_3d
.
transform
.
position
=
cameraPosition
;
camera_main_3d
.
transform
.
eulerAngles
=
cameraRotation
;
camera_main_3d
.
transform
.
localScale
=
new
Vector3
(
1
,
1
,
1
);
camera_main_3d
.
clearFlags
=
CameraClearFlags
.
Depth
;
...
...
Assets/SibylSystem/deckManager/DeckManager.cs
View file @
7be44462
...
...
@@ -148,21 +148,6 @@ public class DeckManager : ServantWithCardDescription
itemOnListProducer
,
86
);
// Program.go(
// 500,
// () =>
// {
// List<MonoCardInDeckManager> cs = new List<MonoCardInDeckManager>();
// for (int i = 0; i < 300; i++)
// {
// cs.Add(createCard());
// }
// for (int i = 0; i < 300; i++)
// {
// destroyCard(cs[i]);
// }
// }
// );
}
GameObject
itemOnListProducer
(
string
[]
Args
)
...
...
@@ -1461,7 +1446,7 @@ public class DeckManager : ServantWithCardDescription
{
// 判定为拖拽,开始拖拽卡牌
cardInDragging
=
cardForLongPress
;
cardInDragging
.
b
eginDrag
();
cardInDragging
.
B
eginDrag
();
cardForLongPress
=
null
;
// 清除长按检测状态
isContinuouslyAdding
=
false
;
// 确保连续添加状态也被重置
}
...
...
@@ -1633,12 +1618,12 @@ public class DeckManager : ServantWithCardDescription
if
((
cardInSearchResult
.
data
.
Type
&
(
UInt32
)
CardType
.
Token
)
==
0
)
{
MonoCardInDeckManager
card
=
createCard
();
card
.
transform
.
position
=
card
.
getGoodPosition
(
4
);
card
.
transform
.
position
=
card
.
GetMouseWorldPosition
(
4f
);
card
.
cardData
=
cardInSearchResult
.
data
;
card
.
gameObject
.
layer
=
16
;
deck
.
IMain
.
Add
(
card
);
cardInDragging
=
card
;
card
.
b
eginDrag
();
card
.
B
eginDrag
();
}
}
}
...
...
@@ -1650,11 +1635,11 @@ public class DeckManager : ServantWithCardDescription
if
(
cardInDragging
!=
null
)
{
// 第一步:终止拖拽,设置物理状态
cardInDragging
.
e
ndDrag
();
cardInDragging
.
E
ndDrag
();
// 第二步:逻辑判断是否仍应纳入卡组
if
(
condition
==
Condition
.
changeSide
&&
!
cardInDragging
.
IsInDeckArea
())
{
}
else
if
(
cardInDragging
.
getIf
Alive
())
else
if
(
cardInDragging
.
Is
Alive
())
{
deckDirty
=
true
;
}
...
...
@@ -1684,7 +1669,7 @@ public class DeckManager : ServantWithCardDescription
Program
.
pointedGameObject
.
GetComponent
<
MonoCardInDeckManager
>();
if
(
cardInDeck
!=
null
)
{
cardInDeck
.
killIt
();
// 标记为待删除
cardInDeck
.
KillCard
();
// 标记为待删除
// 从数据结构中移除
deck
.
IMain
.
Remove
(
cardInDeck
);
deck
.
IExtra
.
Remove
(
cardInDeck
);
...
...
@@ -1734,7 +1719,7 @@ public class DeckManager : ServantWithCardDescription
if
(
checkBanlistAvail
(
data
.
Id
))
{
MonoCardInDeckManager
card
=
createCard
();
card
.
transform
.
position
=
card
.
getGoodPosition
(
4
);
card
.
transform
.
position
=
card
.
GetMouseWorldPosition
(
4f
);
card
.
cardData
=
data
;
card
.
gameObject
.
layer
=
16
;
if
(
data
.
IsExtraCard
())
...
...
@@ -1974,11 +1959,11 @@ public class DeckManager : ServantWithCardDescription
Vector3
rightPosition
=
right
.
gameObject
.
transform
.
position
;
if
(
leftPosition
.
y
>
3f
)
{
leftPosition
=
MonoCardInDeckManager
.
refLectPosition
(
leftPosition
);
leftPosition
=
MonoCardInDeckManager
.
ReflectPositionToGround
(
leftPosition
);
}
if
(
rightPosition
.
y
>
3f
)
{
rightPosition
=
MonoCardInDeckManager
.
refLectPosition
(
rightPosition
);
rightPosition
=
MonoCardInDeckManager
.
ReflectPositionToGround
(
rightPosition
);
}
if
(
leftPosition
.
z
>
-
3
&&
rightPosition
.
z
>
-
3
)
{
...
...
@@ -2020,7 +2005,7 @@ public class DeckManager : ServantWithCardDescription
for
(
int
i
=
0
;
i
<
deckTemp
.
Count
;
i
++)
{
Vector3
p
=
deckTemp
[
i
].
gameObject
.
transform
.
position
;
if
(
deckTemp
[
i
].
getIfAlive
()
==
true
)
if
(
deckTemp
[
i
].
IsAlive
()
)
{
if
(
p
.
z
>
-
8
)
{
...
...
@@ -2179,7 +2164,7 @@ public class DeckManager : ServantWithCardDescription
// tweenToVectorAndFall 本身就是DoTween动画, 它会独立运行,
// 而我们的Sequence只负责在正确的时间点触发它。
card
.
tweenToVector
AndFall
(
toVector
,
new
Vector3
(
90
,
0
,
0
));
card
.
TweenToPosition
AndFall
(
toVector
,
new
Vector3
(
90
,
0
,
0
));
});
}
...
...
@@ -2247,7 +2232,7 @@ public class DeckManager : ServantWithCardDescription
0.6f
+
Mathf
.
Sin
((
90
-
toAngle
.
x
)
/
180f
*
Mathf
.
PI
)
*
k
,
11.8f
-
v
.
x
*
4f
);
deck
.
IMain
[
i
].
tweenToVector
AndFall
(
toVector
,
toAngle
);
deck
.
IMain
[
i
].
TweenToPosition
AndFall
(
toVector
,
toAngle
);
}
for
(
int
i
=
0
;
i
<
deck
.
IExtra
.
Count
;
i
++)
{
...
...
@@ -2265,7 +2250,7 @@ public class DeckManager : ServantWithCardDescription
0.6f
+
Mathf
.
Sin
((
90
-
toAngle
.
x
)
/
180f
*
Mathf
.
PI
)
*
k
,
-
6.2f
);
deck
.
IExtra
[
i
].
tweenToVector
AndFall
(
toVector
,
toAngle
);
deck
.
IExtra
[
i
].
TweenToPosition
AndFall
(
toVector
,
toAngle
);
}
for
(
int
i
=
0
;
i
<
deck
.
ISide
.
Count
;
i
++)
...
...
@@ -2284,7 +2269,7 @@ public class DeckManager : ServantWithCardDescription
0.6f
+
Mathf
.
Sin
((
90
-
toAngle
.
x
)
/
180f
*
Mathf
.
PI
)
*
k
,
-
12f
);
deck
.
ISide
[
i
].
tweenToVector
AndFall
(
toVector
,
toAngle
);
deck
.
ISide
[
i
].
TweenToPosition
AndFall
(
toVector
,
toAngle
);
}
}
...
...
Assets/StreamingAssets/ygopro2-data.zip
View file @
7be44462
No preview for this file type
Assets/YGOSharp/Deck.cs
View file @
7be44462
...
...
@@ -166,22 +166,22 @@ namespace YGOSharp
{
foreach
(
var
item
in
stack
)
{
if
(
item
.
cardData
.
Id
==
code
&&
item
.
getIf
Alive
())
if
(
item
.
cardData
.
Id
==
code
&&
item
.
Is
Alive
())
{
returnValue
++;
continue
;
}
if
(
item
.
cardData
.
Alias
==
code
&&
item
.
getIf
Alive
())
if
(
item
.
cardData
.
Alias
==
code
&&
item
.
Is
Alive
())
{
returnValue
++;
continue
;
}
if
(
item
.
cardData
.
Id
==
al
&&
item
.
getIf
Alive
())
if
(
item
.
cardData
.
Id
==
al
&&
item
.
Is
Alive
())
{
returnValue
++;
continue
;
}
if
(
item
.
cardData
.
Alias
==
al
&&
item
.
getIf
Alive
()
&&
al
>
0
)
if
(
item
.
cardData
.
Alias
==
al
&&
item
.
Is
Alive
()
&&
al
>
0
)
{
returnValue
++;
continue
;
...
...
@@ -244,7 +244,7 @@ namespace YGOSharp
public
List
<
MonoCardInDeckManager
>
getAllObjectCardAndDeload
()
{
List
<
MonoCardInDeckManager
>
r
=
new
List
<
MonoCardInDeckManager
>();
IList
<
MonoCardInDeckManager
>[]
stacks
=
{
IMain
,
IExtra
,
ISide
,
IRemoved
};
IList
<
MonoCardInDeckManager
>[]
stacks
=
{
IMain
,
IExtra
,
ISide
,
IRemoved
};
foreach
(
var
stack
in
stacks
)
{
foreach
(
var
item
in
stack
)
...
...
Assets/old/UiverseAssests/art_plugin/attack_light_line/ocgcore/mod_ocgcore_atk_fire.prefab
View file @
7be44462
This diff is collapsed.
Click to expand it.
UserSettings/Layouts/default-2021.dwlt
View file @
7be44462
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment