Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
N
Neos
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
Neos
Commits
8ad1ec59
Commit
8ad1ec59
authored
Nov 29, 2022
by
Chunchi Che
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update hands
parent
73863a6f
Pipeline
#18174
passed with stages
in 2 minutes and 30 seconds
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
3 deletions
+7
-3
src/ui/Duel/simpleDuel/config.ts
src/ui/Duel/simpleDuel/config.ts
+4
-1
src/ui/Duel/simpleDuel/hands.ts
src/ui/Duel/simpleDuel/hands.ts
+2
-1
src/ui/Duel/simpleDuel/mod.tsx
src/ui/Duel/simpleDuel/mod.tsx
+1
-1
No files found.
src/ui/Duel/simpleDuel/config.ts
View file @
8ad1ec59
...
@@ -47,7 +47,10 @@ export const Floating = 0.02;
...
@@ -47,7 +47,10 @@ export const Floating = 0.02;
// 手牌
// 手牌
export
const
HandShape
=
()
=>
{
export
const
HandShape
=
()
=>
{
return
{
width
:
0.5
,
height
:
0.75
};
return
{
width
:
0.8
,
height
:
1
};
};
export
const
HandRotation
=
()
=>
{
return
new
BABYLON
.
Vector3
(
1
,
0
,
0
);
};
};
export
const
HandColor
=
()
=>
{
export
const
HandColor
=
()
=>
{
return
BABYLON
.
Color3
.
White
();
return
BABYLON
.
Color3
.
White
();
...
...
src/ui/Duel/simpleDuel/hands.ts
View file @
8ad1ec59
...
@@ -5,7 +5,7 @@ import { CardMeta } from "../../../api/cards";
...
@@ -5,7 +5,7 @@ import { CardMeta } from "../../../api/cards";
export
default
(
hands
:
CardMeta
[],
scene
:
BABYLON
.
Scene
)
=>
{
export
default
(
hands
:
CardMeta
[],
scene
:
BABYLON
.
Scene
)
=>
{
const
groundShape
=
CONFIG
.
GroundShape
();
const
groundShape
=
CONFIG
.
GroundShape
();
const
handShape
=
CONFIG
.
HandShape
();
const
handShape
=
CONFIG
.
HandShape
();
const
gap
=
groundShape
.
width
/
hands
.
length
;
const
gap
=
groundShape
.
width
/
(
hands
.
length
-
1
)
;
const
left
=
-
(
groundShape
.
width
/
2
);
const
left
=
-
(
groundShape
.
width
/
2
);
hands
.
forEach
((
item
,
idx
,
_
)
=>
{
hands
.
forEach
((
item
,
idx
,
_
)
=>
{
const
hand
=
BABYLON
.
MeshBuilder
.
CreatePlane
(
const
hand
=
BABYLON
.
MeshBuilder
.
CreatePlane
(
...
@@ -19,6 +19,7 @@ export default (hands: CardMeta[], scene: BABYLON.Scene) => {
...
@@ -19,6 +19,7 @@ export default (hands: CardMeta[], scene: BABYLON.Scene) => {
handShape
.
height
/
2
,
handShape
.
height
/
2
,
-
(
groundShape
.
height
/
2
)
-
1
-
(
groundShape
.
height
/
2
)
-
1
);
);
hand
.
rotation
=
CONFIG
.
HandRotation
();
// 材质
// 材质
const
handMaterial
=
new
BABYLON
.
StandardMaterial
(
"
handMaterial
"
,
scene
);
const
handMaterial
=
new
BABYLON
.
StandardMaterial
(
"
handMaterial
"
,
scene
);
// 材质贴纸
// 材质贴纸
...
...
src/ui/Duel/simpleDuel/mod.tsx
View file @
8ad1ec59
...
@@ -31,7 +31,7 @@ export default class SimpleDuelPlateImpl implements IDuelPlate {
...
@@ -31,7 +31,7 @@ export default class SimpleDuelPlateImpl implements IDuelPlate {
// 默认的手牌Selector,返回五个code为-1的Card。
// 默认的手牌Selector,返回五个code为-1的Card。
const
defaultHandsSelector
=
(
_
:
RootState
)
=>
{
const
defaultHandsSelector
=
(
_
:
RootState
)
=>
{
return
[]
;
return
new
Array
(
5
).
fill
({
id
:
10000
,
data
:
{},
text
:
{}
})
;
};
};
const
hands
=
useAppSelector
(
this
.
handsSelector
||
defaultHandsSelector
);
const
hands
=
useAppSelector
(
this
.
handsSelector
||
defaultHandsSelector
);
...
...
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