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
cd0de481
Commit
cd0de481
authored
Nov 29, 2022
by
Chunchi Che
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feat/hands' into 'main'
update hands See merge request
mycard/Neos!25
parents
73863a6f
8ad1ec59
Pipeline
#18175
passed with stages
in 2 minutes and 33 seconds
Changes
3
Pipelines
1
Hide 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 @
cd0de481
...
...
@@ -47,7 +47,10 @@ export const Floating = 0.02;
// 手牌
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
=
()
=>
{
return
BABYLON
.
Color3
.
White
();
...
...
src/ui/Duel/simpleDuel/hands.ts
View file @
cd0de481
...
...
@@ -5,7 +5,7 @@ import { CardMeta } from "../../../api/cards";
export
default
(
hands
:
CardMeta
[],
scene
:
BABYLON
.
Scene
)
=>
{
const
groundShape
=
CONFIG
.
GroundShape
();
const
handShape
=
CONFIG
.
HandShape
();
const
gap
=
groundShape
.
width
/
hands
.
length
;
const
gap
=
groundShape
.
width
/
(
hands
.
length
-
1
)
;
const
left
=
-
(
groundShape
.
width
/
2
);
hands
.
forEach
((
item
,
idx
,
_
)
=>
{
const
hand
=
BABYLON
.
MeshBuilder
.
CreatePlane
(
...
...
@@ -19,6 +19,7 @@ export default (hands: CardMeta[], scene: BABYLON.Scene) => {
handShape
.
height
/
2
,
-
(
groundShape
.
height
/
2
)
-
1
);
hand
.
rotation
=
CONFIG
.
HandRotation
();
// 材质
const
handMaterial
=
new
BABYLON
.
StandardMaterial
(
"
handMaterial
"
,
scene
);
// 材质贴纸
...
...
src/ui/Duel/simpleDuel/mod.tsx
View file @
cd0de481
...
...
@@ -31,7 +31,7 @@ export default class SimpleDuelPlateImpl implements IDuelPlate {
// 默认的手牌Selector,返回五个code为-1的Card。
const
defaultHandsSelector
=
(
_
:
RootState
)
=>
{
return
[]
;
return
new
Array
(
5
).
fill
({
id
:
10000
,
data
:
{},
text
:
{}
})
;
};
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