Hi @julien-moreau I’ve got a couple of questions regarding editor v4
I’m using version 4-rc1 on Windows 10
In my workspace I have several projects which represent individual levels of my game. For example projectA, projectB and projectC Now when I’m switching between those projects I would assume that, when I hit the play-button, the current project which I have switched to will be executed. This is not the case. What I’ve found out so far is that I have to modify the script src/index.ts and adapt import { runScene } from "./scenes/projectA"; and const rootUrl = "./scenes/projectA/"; to the scene I’v switched to so it is executed when hitting the play-button. Now, is there a way to automatically have the correct project executed when switched to without modifying src/index.ts?
I have a bunch of scripts within this projects which are basically always the same. For example script scene.ts is the same for projectA, projectB and projectC. I have to copy this script 3 times for every project which is quite cumbersome if I have to make edits because of that redundancy. Is there a way to share scripts within projects?
Thanks for the great editor. Hopefully you have some advice
For the 2. I 100% agree with you and I already started a fix to allow accessing the root folder “src” for all projects. That means, if you have shared components, that you will be able to create a folder named “shared” (for example) and let all your projects accessing this folder. This will also reduce the final bundle size. To follow the progress, I just created the issue here: Give Full Access To "src" Folder In Scripts Assets · Issue #250 · BabylonJS/Editor · GitHub
Both your questions are then bug reports, the 2. will be fixed ASAP and I’ll try to find a solution for the 1.
Hey @holger the the reusable scripts across scenes, there will be a breaking change
If you decorated your properties in your components (@visibleInInspector, @fromScene, etc.) you’ll have to import from “decorators.ts” instead of “tools.ts”. Because else the imports will be cyclical and you’ll get errors .