Commit 409b9de6 authored by Chunchi Che's avatar Chunchi Che

add CardModal and HintNotification in BabylonCanvas

parent 9f7b0964
...@@ -4,22 +4,28 @@ import { ReactReduxContext, Provider } from "react-redux"; ...@@ -4,22 +4,28 @@ import { ReactReduxContext, Provider } from "react-redux";
import * as BABYLON from "@babylonjs/core"; import * as BABYLON from "@babylonjs/core";
import * as CONFIG from "../../config/ui"; import * as CONFIG from "../../config/ui";
import DuelHands from "./hands_"; import DuelHands from "./hands_";
import CardModal from "./cardModal";
import HintNotification from "./hintNotification";
const BabylonCanvas = () => ( const BabylonCanvas = () => (
<ReactReduxContext.Consumer> <>
{({ store }) => ( <ReactReduxContext.Consumer>
<Engine antialias adaptToDeviceRatio canvasId="babylonJS"> {({ store }) => (
<Scene> <Engine antialias adaptToDeviceRatio canvasId="babylonJS">
<Provider store={store}> <Scene>
<DuelCamera /> <Provider store={store}>
<DuelLight /> <DuelCamera />
<DuelHands /> <DuelLight />
<DuelGround /> <DuelHands />
</Provider> <DuelGround />
</Scene> </Provider>
</Engine> </Scene>
)} </Engine>
</ReactReduxContext.Consumer> )}
</ReactReduxContext.Consumer>
<CardModal />
<HintNotification />
</>
); );
const DuelCamera = () => ( const DuelCamera = () => (
......
...@@ -13,7 +13,7 @@ export default function () { ...@@ -13,7 +13,7 @@ export default function () {
<Route path="/" element={<JoinRoom />} /> <Route path="/" element={<JoinRoom />} />
<Route path="/:player/:passWd/:ip" element={<WaitRoom />} /> <Route path="/:player/:passWd/:ip" element={<WaitRoom />} />
<Route path="/mora" element={<Mora />} /> <Route path="/mora" element={<Mora />} />
<Route path="/duel" element={<Duel />} /> <Route path="/duel" element={<BabylonCanvas />} />
<Route path="/react-babylon" element={<BabylonCanvas />} /> <Route path="/react-babylon" element={<BabylonCanvas />} />
</Routes> </Routes>
); );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment