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
97cfd7b2
Commit
97cfd7b2
authored
Nov 29, 2022
by
Chunchi Che
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
subscribe hands change in ui
parent
eeeeb3f9
Pipeline
#18168
passed with stages
in 2 minutes and 27 seconds
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
1 deletion
+21
-1
src/ui/Duel/simpleDuel/mod.tsx
src/ui/Duel/simpleDuel/mod.tsx
+21
-1
No files found.
src/ui/Duel/simpleDuel/mod.tsx
View file @
97cfd7b2
...
...
@@ -6,7 +6,7 @@
import
{
IDuelPlate
,
TypeSelector
}
from
"
../duel
"
;
import
{
useAppSelector
}
from
"
../../../hook
"
;
import
React
,
{
useEffect
,
useRef
}
from
"
react
"
;
import
type
{
RootStat
e
}
from
"
../../../store
"
;
import
{
RootState
,
observeStor
e
}
from
"
../../../store
"
;
import
*
as
BABYLON
from
"
@babylonjs/core
"
;
import
renderHands
from
"
./hands
"
;
import
renderMonsters
from
"
./monsters
"
;
...
...
@@ -107,6 +107,26 @@ export default class SimpleDuelPlateImpl implements IDuelPlate {
});
},
[
canvasRef
,
hands
]);
useEffect
(()
=>
{
// 监听状态变化,并实现动画
const
onHandsChange
=
(
prev_hands
:
CardMeta
[]
|
null
,
cur_hands
:
CardMeta
[]
)
=>
{
console
.
log
(
`
${
prev_hands
}
change to
${
cur_hands
}
`
);
};
const
unsubscribe
=
observeStore
(
this
.
handsSelector
||
defaultHandsSelector
,
onHandsChange
);
return
()
=>
{
// 取消监听
unsubscribe
();
};
},
[]);
return
(
<
canvas
width=
{
window
.
innerWidth
}
...
...
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