BabylonJS / BabylonToolkit

Home of the community maintained Unity & Unreal exporters for Babylon.js
179 stars 47 forks source link

How to get the BABYLON.Scene? #45

Closed tidus2020 closed 2 years ago

tidus2020 commented 2 years ago

I want use scene.actionManager to manage the keyboard and pointer input.

MackeyK24 commented 2 years ago

So what is your question ?

tidus2020 commented 2 years ago

So what is your question ?

I mean...how to get scene instance in the scriptComponent?

In babylon, i can create the new BABYLON.Scene in the entry "Main.ts", but in UnityExporter, the entry is SceneController and i need to code in the script.

MackeyK24 commented 2 years ago

the toolkit is scene loader based. So you export a scene in gltf format from the exporter... Then you load that scene... the babylon.manager.js has the gltf extensions required to support all the unity features.

So you dont create new a scene manually... but you load a scene instead for the Unity content

if you want to manually create your scene then you would use SceneLoader.AppendScene or ImportMeshes to load your unity content and have all the unity stuff supported