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
3c0eb8f7
Commit
3c0eb8f7
authored
Dec 29, 2022
by
Chunchi Che
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add Deck component
parent
6e500450
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
65 additions
and
46 deletions
+65
-46
src/ui/Duel/deck.ts
src/ui/Duel/deck.ts
+0
-46
src/ui/Duel/deck_.tsx
src/ui/Duel/deck_.tsx
+63
-0
src/ui/Duel/main.tsx
src/ui/Duel/main.tsx
+2
-0
No files found.
src/ui/Duel/deck.ts
deleted
100644 → 0
View file @
6e500450
import
*
as
BABYLON
from
"
@babylonjs/core
"
;
import
*
as
CONFIG
from
"
../../config/ui
"
;
export
default
(
scene
:
BABYLON
.
Scene
)
=>
{
// 卡组
const
deck
=
BABYLON
.
MeshBuilder
.
CreateBox
(
"
deck
"
,
CONFIG
.
DeckSlotShape
(),
scene
);
// 位置
deck
.
position
=
new
BABYLON
.
Vector3
(
3.2
,
CONFIG
.
DeckSlotShape
().
depth
/
2
+
CONFIG
.
Floating
,
-
3.3
);
// 旋转
deck
.
rotation
=
CONFIG
.
DeckSlotRotation
();
// 材质
const
deckMaterial
=
new
BABYLON
.
StandardMaterial
(
"
deckMaterial
"
,
scene
);
deckMaterial
.
diffuseColor
=
CONFIG
.
DeckColor
();
deck
.
material
=
deckMaterial
;
// 额外卡组
const
extraDeck
=
BABYLON
.
MeshBuilder
.
CreateBox
(
"
exraDeck
"
,
CONFIG
.
ExtraDeckSlotShape
(),
scene
);
// 位置
extraDeck
.
position
=
new
BABYLON
.
Vector3
(
-
3.3
,
CONFIG
.
ExtraDeckSlotShape
().
depth
/
2
+
CONFIG
.
Floating
,
-
3.3
);
// 旋转
extraDeck
.
rotation
=
CONFIG
.
DeckSlotRotation
();
// 材质
const
extraDeckMaterial
=
new
BABYLON
.
StandardMaterial
(
"
extraDeckMaterial
"
,
scene
);
extraDeckMaterial
.
diffuseColor
=
CONFIG
.
ExtraDeckColor
();
extraDeck
.
material
=
extraDeckMaterial
;
};
src/ui/Duel/deck_.tsx
0 → 100644
View file @
3c0eb8f7
import
*
as
BABYLON
from
"
@babylonjs/core
"
;
import
*
as
CONFIG
from
"
../../config/ui
"
;
const
Deck
=
()
=>
(
<>
<
CommonDeck
/>
<
ExtraDeck
/>
</>
);
const
CommonDeck
=
()
=>
{
const
shape
=
CONFIG
.
DeckSlotShape
();
const
position
=
new
BABYLON
.
Vector3
(
3.2
,
shape
.
depth
/
2
+
CONFIG
.
Floating
,
-
3.3
);
const
rotation
=
CONFIG
.
DeckSlotRotation
();
return
(
<
box
name=
"common-deck"
width=
{
shape
.
width
}
height=
{
shape
.
height
}
depth=
{
shape
.
depth
}
position=
{
position
}
rotation=
{
rotation
}
>
<
standardMaterial
name=
"common-deck-mat"
diffuseColor=
{
CONFIG
.
DeckColor
()
}
/>
</
box
>
);
};
const
ExtraDeck
=
()
=>
{
const
shape
=
CONFIG
.
ExtraDeckSlotShape
();
const
position
=
new
BABYLON
.
Vector3
(
-
3.3
,
shape
.
depth
/
2
+
CONFIG
.
Floating
,
-
3.3
);
const
rotation
=
CONFIG
.
DeckSlotRotation
();
return
(
<
box
name=
"extra-deck"
width=
{
shape
.
width
}
height=
{
shape
.
height
}
depth=
{
shape
.
depth
}
position=
{
position
}
rotation=
{
rotation
}
>
<
standardMaterial
name=
"extra-deck-mat"
diffuseColor=
{
CONFIG
.
ExtraDeckColor
()
}
/>
</
box
>
);
};
export
default
Deck
;
src/ui/Duel/main.tsx
View file @
3c0eb8f7
...
@@ -9,6 +9,7 @@ import CardModal from "./cardModal";
...
@@ -9,6 +9,7 @@ import CardModal from "./cardModal";
import
HintNotification
from
"
./hintNotification
"
;
import
HintNotification
from
"
./hintNotification
"
;
import
Magics
from
"
./magics_
"
;
import
Magics
from
"
./magics_
"
;
import
Field
from
"
./field_
"
;
import
Field
from
"
./field_
"
;
import
Deck
from
"
./deck_
"
;
const
NeosDuel
=
()
=>
(
const
NeosDuel
=
()
=>
(
<>
<>
...
@@ -23,6 +24,7 @@ const NeosDuel = () => (
...
@@ -23,6 +24,7 @@ const NeosDuel = () => (
<
Monsters
/>
<
Monsters
/>
<
Magics
/>
<
Magics
/>
<
Field
/>
<
Field
/>
<
Deck
/>
<
Ground
/>
<
Ground
/>
</
Provider
>
</
Provider
>
</
Scene
>
</
Scene
>
...
...
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