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
0
Issues
0
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
love_飞影
Neos
Commits
da024111
Commit
da024111
authored
Jan 01, 2023
by
Chunchi Che
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update cemetery ui
parent
46794a85
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
50 additions
and
12 deletions
+50
-12
src/ui/Duel/cemetery.tsx
src/ui/Duel/cemetery.tsx
+48
-12
src/ui/Duel/main.tsx
src/ui/Duel/main.tsx
+2
-0
No files found.
src/ui/Duel/cemetery.tsx
View file @
da024111
import
*
as
BABYLON
from
"
@babylonjs/core
"
;
import
*
as
CONFIG
from
"
../../config/ui
"
;
import
{
Cemetery
}
from
"
../../reducers/duel/util
"
;
import
{
selectMeCemetery
,
selectOpCemetery
,
}
from
"
../../reducers/duel/cemeretySlice
"
;
import
{
useAppSelector
}
from
"
../../hook
"
;
const
Cemetery
=
()
=>
{
const
shape
=
CONFIG
.
CemeterySlotShape
();
const
position
=
new
BABYLON
.
Vector3
(
3.2
,
shape
.
depth
/
2
+
CONFIG
.
Floating
,
-
2.0
const
shape
=
CONFIG
.
CemeterySlotShape
();
const
depth
=
0.2
;
const
Cemeteries
=
()
=>
{
const
meCemetery
=
useAppSelector
(
selectMeCemetery
).
cemetery
;
const
opCemetery
=
useAppSelector
(
selectOpCemetery
).
cemetery
;
return
(
<>
<
CCemetery
state=
{
meCemetery
}
position=
{
cemeteryPosition
(
0
,
meCemetery
.
length
)
}
rotation=
{
CONFIG
.
CardSlotRotation
(
false
)
}
/>
<
CCemetery
state=
{
opCemetery
}
position=
{
cemeteryPosition
(
1
,
opCemetery
.
length
)
}
rotation=
{
CONFIG
.
CardSlotRotation
(
true
)
}
/>
</>
);
const
rotation
=
CONFIG
.
CemeterySlotRotation
()
;
}
;
const
CCemetery
=
(
props
:
{
state
:
Cemetery
[];
position
:
BABYLON
.
Vector3
;
rotation
:
BABYLON
.
Vector3
;
})
=>
{
return
(
<
box
name=
"cemetery"
width=
{
shape
.
width
}
height=
{
shape
.
height
}
depth=
{
shape
.
dep
th
}
position=
{
position
}
rotation=
{
rotation
}
depth=
{
depth
*
props
.
state
.
leng
th
}
position=
{
p
rops
.
p
osition
}
rotation=
{
props
.
rotation
}
>
<
standardMaterial
name=
"cemetery-mat"
diffuseColor=
{
CONFIG
.
CemeteryColor
()
}
diffuseTexture=
{
new
BABYLON
.
Texture
(
`http://localhost:3030/images/card_back.jpg`
)
}
alpha=
{
props
.
state
.
length
==
0
?
0
:
1
}
/>
</
box
>
);
};
export
default
Cemetery
;
const
cemeteryPosition
=
(
player
:
number
,
cemeteryLength
:
number
)
=>
{
const
x
=
player
==
0
?
3.2
:
-
3.2
;
const
y
=
(
depth
*
cemeteryLength
)
/
2
+
CONFIG
.
Floating
;
const
z
=
player
==
0
?
-
2.0
:
2.0
;
return
new
BABYLON
.
Vector3
(
x
,
y
,
z
);
};
export
default
Cemeteries
;
src/ui/Duel/main.tsx
View file @
da024111
...
...
@@ -11,6 +11,7 @@ import Magics from "./magics";
import
Field
from
"
./field
"
;
import
Deck
from
"
./deck
"
;
import
Exclusion
from
"
./exclusion
"
;
import
Cemeteries
from
"
./cemetery
"
;
// Ref: https://github.com/brianzinn/react-babylonjs/issues/126
const
NeosDuel
=
()
=>
(
...
...
@@ -27,6 +28,7 @@ const NeosDuel = () => (
<
Magics
/>
<
Field
/>
<
Deck
/>
<
Cemeteries
/>
<
Exclusion
/>
<
Ground
/>
</
Provider
>
...
...
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