I’m currently working on a project where I’ve developed a custom module, let’s call it BLABLA.GUI, whith custom type extending BABYLON.GUI. This module is contained within a file named “blabla.gui.js”. I’m looking to utilize this module in conjunction with the Unity exporter. My main goal is to streamline the process without having to export all of my TypeScript classes or modify the existing code extensively with the
module XXXX {
...
const v = new BABYLON.Vector3(0,0,0);
...
}
pattern.
Could anyone provide guidance or suggestions on how to effectively integrate BLABLA.GUI with the Unity exporter to achieve this?
according to the documentation
Native JavaScript Libraries (renamed to .bjs) that are included anywhere in the Assets folder will be packaged up and included in your project script file
however when putting the file into a folder in the Assets and trying to reference any of the class into my typescript, this not work
const c = new BLABLA.GUI.Component(..)
Failed to find the BLABLA.
Do i need a specific tsconfig setup to generate my module to be compatible ?
Do i need to provide the d.ts types somehow ?
Hi all, just following up on my previous query (along with @Lukas_Make_Games ) about the Unity Exporter project extension. Noticed it’s been a few days without a single response, even after @sebavan ping to the creator. I understand it’s not an official Babylonjs tools, but any updates would be greatly appreciated.
Thanks!
@MackeyK24 was not pinged cause I messed up in his pseudo on the previous message… Now he should be but please bear with him as he might be focused on other things or be OOF this week
Hey guys… So the babylon toolkit using regular script tags. I dont really like importing modules. If you look at the exported engine.html page that is generated for you. you see all the scripts that get loaded for that project. You can customize a copy of engine.html and save it in the /Assets/[Config] folder and that custom engine.html will get used instead.
But it would be easier to just your custom class to the Unity Project. You can add .js, .ts and d.ts files to any folder in the Unity Project.
So you can generate declaration files for your component and add both the script and declaration files to your Unity Projects:
blabla.gui.js
blabla.gui.d.ts
Or you could create your custom gui component in the Unity Project like MyGuiComponent.ts like @Pryme8 suggested:
Thank you for taking the time to respond. I’ve already using the solutions you suggested. My question was bit different, so i assume importing module on the fly is not possible.
Thank’s again.