diff --git a/src/babylonjs-hook.tsx b/src/babylonjs-hook.tsx index e675a50..d1fe8fe 100644 --- a/src/babylonjs-hook.tsx +++ b/src/babylonjs-hook.tsx @@ -1,5 +1,10 @@ import React, { useEffect, useContext, useRef, useState } from 'react'; -import { Engine, Scene, Nullable, EngineOptions, SceneOptions, EventState, Observer, Camera } from '@babylonjs/core'; +import { Camera } from '@babylonjs/core/Cameras/camera' +import { Engine } from '@babylonjs/core/Engines/engine' +import { EngineOptions } from '@babylonjs/core/Engines/thinEngine' +import { EventState, Observer } from '@babylonjs/core/Misc/observable' +import { Scene, SceneOptions } from '@babylonjs/core/scene' +import { Nullable } from '@babylonjs/core/types' import { SceneContext, SceneContextType } from './scene'; import { EngineCanvasContext, EngineCanvasContextType } from './engine'; @@ -201,4 +206,4 @@ export default (props: BabylonjsProps) => { ); -} \ No newline at end of file +} diff --git a/src/engine.tsx b/src/engine.tsx index 4299744..1cc6b6e 100644 --- a/src/engine.tsx +++ b/src/engine.tsx @@ -1,5 +1,6 @@ -import { Engine, Nullable } from '@babylonjs/core'; -import React, { createContext, useContext } from'react'; +import React, { createContext, useContext } from 'react' +import { Engine } from '@babylonjs/core/Engines/engine' +import { Nullable } from '@babylonjs/core/types' export type EngineCanvasContextType = { engine: Nullable diff --git a/src/scene.tsx b/src/scene.tsx index a053460..5605f59 100644 --- a/src/scene.tsx +++ b/src/scene.tsx @@ -1,5 +1,6 @@ -import { Nullable, Scene } from '@babylonjs/core'; -import { createContext, useContext } from 'react'; +import { createContext, useContext } from 'react' +import { Scene } from '@babylonjs/core/scene' +import { Nullable } from '@babylonjs/core/types' export type SceneContextType = { scene: Nullable @@ -14,4 +15,4 @@ export const SceneContext = createContext({ /** * Get the scene from the context. */ -export const useScene = (): Nullable => useContext(SceneContext).scene; \ No newline at end of file +export const useScene = (): Nullable => useContext(SceneContext).scene;